/* Standalone Archive Grid + AJAX Filter — unique prefix: waf-a9f3c2 */
.waf-a9f3c2-root {
    --waf-gap: 8px;
    --waf-columns: 4;
    position: relative;
    width: 100%;
    color: #111;
    font-family: "Assistant", sans-serif;
}

.waf-a9f3c2-root button,
.waf-a9f3c2-root input,
.waf-a9f3c2-root select,
.waf-a9f3c2-root textarea {
    font-family: inherit;
}

.waf-a9f3c2-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 22px;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    direction: ltr;
}

.waf-a9f3c2-open-filter,
.waf-a9f3c2-view-buttons button {
    border: 0 !important;
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
    cursor: pointer;
}

.waf-a9f3c2-open-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 400;
}
.waf-a9f3c2-filter-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: #fff;
    stroke: currentColor;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.waf-a9f3c2-view-buttons { display: flex; align-items: center; gap: 10px; }
.waf-a9f3c2-view-buttons button { display: flex; align-items: center; justify-content: center; padding: 5px; opacity: .45; }
.waf-a9f3c2-view-buttons button.is-active { opacity: 1; }
.waf-a9f3c2-view-buttons svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.25; }

.waf-a9f3c2-grid {
    display: grid;
    grid-template-columns: repeat(var(--waf-columns), minmax(0, 1fr));
    gap: 30px var(--waf-gap);
    width: 100%;
    padding-top: 8px;
    direction: rtl;
    transition: opacity .2s ease;
}
.waf-a9f3c2-grid.is-two-columns { --waf-columns: 2; }
.waf-a9f3c2-root.is-loading .waf-a9f3c2-grid { opacity: .42; pointer-events: none; }

.waf-a9f3c2-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: transparent;
    direction: ltr;
}

.waf-a9f3c2-media {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f5f5f5;
    cursor: pointer;
}

.waf-a9f3c2-slider,
.waf-a9f3c2-slide { position: absolute; inset: 0; }
.waf-a9f3c2-slide { opacity: 0; visibility: hidden; transition: opacity .28s ease; }
.waf-a9f3c2-slide.is-active { opacity: 1; visibility: visible; }
.waf-a9f3c2-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.waf-a9f3c2-arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 36px;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
    transform: translateY(-50%);
    font-size: 25px;
    font-weight: 300;
}
.waf-a9f3c2-prev { left: 1px; }
.waf-a9f3c2-next { right: 1px; }

.waf-a9f3c2-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}
.waf-a9f3c2-badges span { padding: 4px 8px; font-size: 9px; font-weight: 700; }
.waf-a9f3c2-new { background: #fff; color: #111; }
.waf-a9f3c2-sale { background: #e30613; color: #fff; }

.waf-a9f3c2-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
    font-size: 24px;
    line-height: 1;
}
.waf-a9f3c2-heart.is-active {
    font-family: Arial, sans-serif;
    color: #111 !important;
}

.waf-a9f3c2-size-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 8;
    display: flex;
    height: 40px;
    padding-left: 0;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.waf-a9f3c2-card:hover .waf-a9f3c2-size-panel,
.waf-a9f3c2-card.is-size-open .waf-a9f3c2-size-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.waf-a9f3c2-size {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 2px;
    border: 0 !important;
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-size: 10px;
    text-transform: uppercase;
}
.waf-a9f3c2-size:hover,
.waf-a9f3c2-size:focus,
.waf-a9f3c2-size:active,
.waf-a9f3c2-size.is-added {
    border-radius: 0 !important;
    background: #111 !important;
    color: #fff !important;
}
.waf-a9f3c2-size.is-loading { opacity: .5; }

.waf-a9f3c2-size-toggle {
    display: none;
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 10;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    border: 1px solid #d5d5d5 !important;
    border-radius: 50%;
    background: #fff !important;
    color: #555 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.08) !important;
    font-size: 14px;
    line-height: 1;
}
.waf-a9f3c2-cross { display: none; }
.waf-a9f3c2-card.is-size-open .waf-a9f3c2-plus { display: none; }
.waf-a9f3c2-card.is-size-open .waf-a9f3c2-cross { display: inline; }

.waf-a9f3c2-dots {
    position: absolute;
    bottom: 9px;
    left: 50%;
    z-index: 7;
    display: flex;
    align-items: center;
    gap: 4px;
    transform: translateX(-50%);
}
.waf-a9f3c2-dots span { width: 5px; height: 4px; border-radius: 4px; background: #999; }
.waf-a9f3c2-dots span.is-active { width: 15px; background: #111; }
.waf-a9f3c2-card.is-size-open .waf-a9f3c2-dots { display: none; }

.waf-a9f3c2-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    padding: 10px 8px 0;
    direction: ltr;
}
.waf-a9f3c2-colors { display: flex; align-items: center; gap: 6px; min-height: 16px; }
.waf-a9f3c2-color {
    width: 13px;
    height: 13px;
    min-width: 13px;
    padding: 0;
    border: 1px solid #b8b8b8 !important;
    border-radius: 50%;
    background-position: center;
    background-size: cover;
    box-shadow: none !important;
}
.waf-a9f3c2-color.is-selected {
    border: 1px solid #111 !important;
}
.waf-a9f3c2-title { margin: 0; overflow: hidden; font-size: 11px; font-weight: 400; line-height: 1.4; text-align: right; white-space: nowrap; text-overflow: ellipsis; direction: rtl; }
.waf-a9f3c2-title a { color: #111; font-family: inherit; text-decoration: none; }
.waf-a9f3c2-price { grid-column: 1 / -1; font-size: 11px; line-height: 1.4; text-align: left; }
.waf-a9f3c2-price del { color: #888; margin-right: 5px; }
.waf-a9f3c2-price ins { color: #e30613; text-decoration: none; font-weight: 700; }

/* WooCommerce may inject this after the AJAX add-to-cart event. */
.waf-a9f3c2-root a.added_to_cart.wc-forward,
.waf-a9f3c2-root .added_to_cart.wc-forward {
    display: none !important;
}

.waf-a9f3c2-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99980;
    background: rgba(0,0,0,.58);
    opacity: 0;
    transition: opacity .25s ease;
}
.waf-a9f3c2-backdrop.is-open { opacity: 1; }
.waf-a9f3c2-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    width: min(400px, 88vw);
    background: #fff;
    color: #111;
    transform: translateX(-101%);
    transition: transform .3s cubic-bezier(.25,.46,.45,.94);
    direction: rtl;
}
.waf-a9f3c2-drawer.is-open { transform: translateX(0); }
.waf-a9f3c2-no-scroll { overflow: hidden !important; }

.waf-a9f3c2-drawer-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 70px;
    padding: 10px 55px;
    border-bottom: 1px solid #ddd;
}
.waf-a9f3c2-drawer-head h2 {
    width: 100%;
    margin: 0;
    font-size: 17px;
    font-weight: 400;
    text-align: right;
    direction: rtl;
}
.waf-a9f3c2-close {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    color: #111 !important;
    box-shadow: none !important;
    transform: translateY(-50%);
    font-size: 23px;
}
.waf-a9f3c2-drawer-body { flex: 1; overflow-y: auto; padding: 18px 38px 100px; }
.waf-a9f3c2-drawer fieldset { margin: 0 0 28px; padding: 0; border: 0; }
.waf-a9f3c2-drawer legend { width: 100%; margin-bottom: 12px; font-size: 12px; font-weight: 600; }
.waf-a9f3c2-sort label { display: block; margin: 0 0 9px; font-size: 12px; cursor: pointer; }
.waf-a9f3c2-sort input { accent-color: #111; }

.waf-a9f3c2-options { display: flex; flex-wrap: wrap; gap: 7px; }
.waf-a9f3c2-size-filter input,
.waf-a9f3c2-color-filters input { position: absolute; opacity: 0; pointer-events: none; }
.waf-a9f3c2-size-filter span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #ddd;
    font-size: 11px;
    cursor: pointer;
}
.waf-a9f3c2-size-filter input:checked + span { border-color: #111; background: #111; color: #fff; }
.waf-a9f3c2-color-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.waf-a9f3c2-color-filters span {
    display: block;
    width: 32px;
    height: 32px;
    border: 2px solid #fff;
    border-radius: 50%;
    outline: 1px solid #ccc;
    background-position: center;
    background-size: cover;
    cursor: pointer;
}
.waf-a9f3c2-color-filters input:checked + span { outline: 2px solid #111; }

.waf-a9f3c2-drawer-actions {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #ddd;
    background: #fff;
}
.waf-a9f3c2-drawer-actions button { height: 46px; border-radius: 0; box-shadow: none !important; font-size: 12px; }
.waf-a9f3c2-apply { border: 1px solid #111 !important; background: #111 !important; color: #fff !important; }
.waf-a9f3c2-reset { border: 1px solid #ddd !important; background: #fff !important; color: #111 !important; }
.waf-a9f3c2-message { padding: 30px; text-align: center; font-size: 13px; }
.waf-a9f3c2-no-products {
    grid-column: 1 / -1;
    width: 100%;
    padding: 50px 20px;
    text-align: center;
    font-size: 14px;
    color: #111;
}
.waf-a9f3c2-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 36px 10px 8px;
    direction: ltr;
}
.waf-a9f3c2-pagination[hidden] { display: none !important; }
.waf-a9f3c2-pagination button {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d8d8d8;
    border-radius: 0;
    background: #fff;
    color: #111;
    box-shadow: none;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}
.waf-a9f3c2-pagination button:hover,
.waf-a9f3c2-pagination button:focus,
.waf-a9f3c2-pagination button[aria-current="page"] {
    border-color: #111;
    background: #111;
    color: #fff;
}
.waf-a9f3c2-pagination button:disabled { cursor: default; opacity: 1; }
.waf-a9f3c2-pagination .waf-a9f3c2-load-more {
    width: min(280px, 100%);
    height: 44px;
    border-color: #111;
    font-size: 13px;
    direction: rtl;
}

@media (max-width: 1024px) {
    .waf-a9f3c2-root { --waf-columns: 4; }
    .waf-a9f3c2-grid.is-two-columns { --waf-columns: 2; }
}

@media (max-width: 767px) {
    .waf-a9f3c2-root { --waf-columns: 2; --waf-gap: 5px; }
    .waf-a9f3c2-grid.is-two-columns { --waf-columns: 2; }
    .waf-a9f3c2-view-buttons { display: none; }
    .waf-a9f3c2-toolbar { min-height: 44px; padding: 0 8px; }
    .waf-a9f3c2-media { aspect-ratio: 3 / 4; }
    .waf-a9f3c2-size-toggle { display: flex; }
    .waf-a9f3c2-card:hover .waf-a9f3c2-size-panel:not(:focus-within) { opacity: 0; visibility: hidden; transform: translateY(100%); }
    .waf-a9f3c2-card.is-size-open .waf-a9f3c2-size-panel { opacity: 1; visibility: visible; transform: translateY(0); }
    .waf-a9f3c2-details { padding: 8px 5px 0; gap: 5px 6px; }
    .waf-a9f3c2-title,
    .waf-a9f3c2-price { font-size: 9px; }
    .waf-a9f3c2-color { width: 11px; height: 11px; min-width: 11px; }
    .waf-a9f3c2-drawer { width: min(340px, 90vw); }
    .waf-a9f3c2-drawer-body { padding: 16px 24px 100px; }
}
.waf-a9f3c2-heart-wrap {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
}

.waf-a9f3c2-heart-wrap .waf-a9f3c2-heart {
    position: static;
}

.waf-a9f3c2-heart.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

/* YITH owns wishlist persistence/AJAX; the archive card keeps its original heart UI. */
.waf-a9f3c2-yith-bridge {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
}

#yith-wcwl-popup-message,
.waf-a9f3c2-yith-bridge .feedback,
.waf-a9f3c2-yith-bridge .yith-wcwl-tooltip {
    display: none !important;
}
