/* =========================================
   Woo Shop Filter Page – wsf-style.css
   ========================================= */

/* ── CSS Variables ── */
.wsf-wrapper {
    --wsf-accent:     #7b2d5e;
    --wsf-accent2:    #a04080;
    --wsf-text:       #1a1a1a;
    --wsf-muted:      #888;
    --wsf-border:     #e8e8e8;
    --wsf-card-bg:    #ffffff;
    --wsf-sidebar-bg: #faf9f7;
    --wsf-pill-bg:    #f0f0f0;
    --wsf-pill-txt:   #555;
    --wsf-badge-bg:   #fff0ec;
    --wsf-badge-txt:  #c0392b;
    --wsf-badge-bdr:  #f5c6c0;
    --wsf-radius:     12px;
    --wsf-shadow:     0 2px 12px rgba(0,0,0,0.07);
    --wsf-cols:       4;
    font-family: inherit;
    position: relative;
}

/* ══════════════════════════════════════
   LAYOUT: sidebar + main
══════════════════════════════════════ */
.wsf-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ── Sidebar ── */
.wsf-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.wsf-sidebar-inner {
    background: var(--wsf-sidebar-bg);
    border-radius: var(--wsf-radius);
    padding: 16px 0 8px;
}

/* ── Main ── */
.wsf-main {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* ══════════════════════════════════════
   TOP BAR
══════════════════════════════════════ */
.wsf-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.wsf-page-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--wsf-text);
    margin: 0;
    line-height: 1.2;
}
.wsf-showing {
    font-size: 0.82rem;
    color: var(--wsf-muted);
    white-space: nowrap;
}
.wsf-sort-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--wsf-muted);
    white-space: nowrap;
}
.wsf-sort-select {
    border: 1.5px solid var(--wsf-border);
    border-radius: 20px;
    padding: 5px 28px 5px 12px;
    font-size: 0.82rem;
    color: var(--wsf-text);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
}
.wsf-sort-select:focus {
    border-color: var(--wsf-accent);
}

/* ══════════════════════════════════════
   SIDEBAR FILTER GROUPS
══════════════════════════════════════ */
.wsf-filter-group {
    border-bottom: 1px solid var(--wsf-border);
    padding: 0 16px;
}
.wsf-fg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--wsf-text);
    user-select: none;
}
.wsf-chevron {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--wsf-muted);
    transition: transform .2s;
    transform: rotate(180deg);
}
.wsf-chevron.open {
    transform: rotate(0deg);
}
.wsf-fg-body {
    display: none;
    padding-bottom: 12px;
    flex-direction: column;
    gap: 8px;
}
.wsf-fg-body.open {
    display: flex;
}

/* Radio / Checkbox labels */
.wsf-radio,
.wsf-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--wsf-text);
    cursor: pointer;
}
.wsf-radio input,
.wsf-checkbox input {
    accent-color: var(--wsf-accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Price inputs */
.wsf-price-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.wsf-price-field {
    width: 70px;
    border: 1.5px solid var(--wsf-border);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.8rem;
    outline: none;
    color: var(--wsf-text);
}
.wsf-price-field:focus { border-color: var(--wsf-accent); }
.wsf-price-apply {
    width: 100%;
    background: var(--wsf-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 0;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .16s;
}
.wsf-price-apply:hover { opacity: .85; }

/* Clear all filters */
.wsf-clear-filters {
    display: block;
    width: calc(100% - 32px);
    margin: 14px 16px 6px;
    background: none;
    border: 1.5px solid var(--wsf-border);
    border-radius: 20px;
    padding: 7px 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--wsf-muted);
    cursor: pointer;
    text-align: center;
    transition: border-color .16s, color .16s;
}
.wsf-clear-filters:hover {
    border-color: var(--wsf-accent);
    color: var(--wsf-accent);
}

/* ══════════════════════════════════════
   PRODUCT GRID
══════════════════════════════════════ */
.wsf-grid {
    display: grid;
    grid-template-columns: repeat(var(--wsf-cols, 4), 1fr);
    gap: 16px;
    width: 100%;
}

/* ══════════════════════════════════════
   PRODUCT CARD  (same design as wwv-card)
══════════════════════════════════════ */
.wsf-card {
    background: var(--wsf-card-bg);
    border-radius: var(--wsf-radius);

    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    transition: box-shadow .22s, transform .22s;
    padding-bottom: 10px;
}
.wsf-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Badge */
.wsf-badge {
    position: absolute;
    top: 9px;
    left: 9px;
    background: var(--wsf-badge-bg);
    color: var(--wsf-badge-txt);
    border: 1.5px solid var(--wsf-badge-bdr);
    border-radius: 20px;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 8px;
    z-index: 3;
    white-space: nowrap;
    line-height: 1.4;
}

/* Image */
.wsf-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--wsf-radius) var(--wsf-radius) 0 0;
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
    background: #f5f5f5;
}
.wsf-img-wrap img,
.wsf-img-wrap .wsf-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Info */
.wsf-info {
    padding: 9px 11px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* Sale meta */
.wsf-sale-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    min-height: 18px;
}
.wsf-sale-pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--wsf-badge-bg);
    color: var(--wsf-badge-txt);
    border: 1.5px solid var(--wsf-badge-bdr);
    white-space: nowrap;
    line-height: 1.4;
}
.wsf-save-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #27ae60;
    white-space: nowrap;
}
.wsf-save-label bdi { color: inherit; }

/* Weight pills */
.wsf-weights {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    row-gap: 4px;
}
.wsf-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--wsf-pill-bg);
    color: var(--wsf-pill-txt);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
    user-select: none;
    white-space: nowrap;
    line-height: 1.3;
}
.wsf-pill:hover { border-color: var(--wsf-accent); color: var(--wsf-accent); }
.wsf-pill.active {
    background: var(--wsf-accent);
    color: #fff;
    border-color: var(--wsf-accent);
}
.wsf-divider {
    display: inline-block;
    width: 1px;
    height: 14px;
    background: #ddd;
    margin: 0 3px;
    vertical-align: middle;
    align-self: center;
    flex-shrink: 0;
}

/* Title */
.wsf-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}
.wsf-title a { color: var(--wsf-text); text-decoration: none; }
.wsf-title a:hover { color: var(--wsf-accent); }

/* Price row */
.wsf-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
}
.wsf-prices {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}
.wsf-mrp {
    font-size: 24px;
    color: var(--wsf-muted);
    text-decoration: line-through;
    font-weight: 600;
}
.wsf-mrp del, .wsf-mrp del bdi { color: inherit; }
.wsf-sale-price {
    font-size: 0.96rem;
    color: var(--wsf-text);
    font-weight: 900;
}
.wsf-sale-price bdi { color: inherit; }

/* Cart button */
.wsf-cart-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wsf-accent2), var(--wsf-accent));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(123,45,94,.35);
    transition: transform .16s, box-shadow .16s;
    flex-shrink: 0;
    text-decoration: none;
    padding: 0;
}
.wsf-cart-btn:hover { transform: scale(1.1); box-shadow: 0 5px 16px rgba(123,45,94,.5); }
.wsf-cart-btn svg { width: 17px; height: 17px; pointer-events: none; }

/* ══════════════════════════════════════
   LOADING SPINNER
══════════════════════════════════════ */
.wsf-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--wsf-radius);
}
.wsf-loading.active { display: flex; }
.wsf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--wsf-border);
    border-top-color: var(--wsf-accent);
    border-radius: 50%;
    animation: wsf-spin .7s linear infinite;
}
@keyframes wsf-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.wsf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.wsf-page-btn {
    padding: 9px 22px;
    border-radius: 24px;
    border: 2px solid var(--wsf-border);
    background: #fff;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--wsf-text);
    cursor: pointer;
    transition: all .18s;
}
.wsf-page-btn:hover:not(:disabled) {
    background: var(--wsf-accent);
    border-color: var(--wsf-accent);
    color: #fff;
}
.wsf-page-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.wsf-page-info {
    font-size: 0.82rem;
    color: var(--wsf-muted);
    font-weight: 700;
    white-space: nowrap;
}

/* ══════════════════════════════════════
   NO PRODUCTS
══════════════════════════════════════ */
.wsf-no-products {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--wsf-muted);
    font-style: italic;
}

/* ══════════════════════════════════════
   HELPER
══════════════════════════════════════ */
.wsf-hidden { display: none !important; }

/* ══════════════════════════════════════
   MOBILE BAR (shown only on mobile)
══════════════════════════════════════ */
.wsf-mobile-bar {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.wsf-filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1.5px solid var(--wsf-border);
    border-radius: 20px;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--wsf-text);
    cursor: pointer;
    transition: border-color .16s;
}
.wsf-filter-toggle:hover { border-color: var(--wsf-accent); color: var(--wsf-accent); }
.wsf-mobile-showing {
    font-size: 0.78rem;
    color: var(--wsf-muted);
}
.wsf-mobile-sort {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--wsf-muted);
}
.wsf-mobile-only { display: none; }

/* Mobile sidebar overlay */
.wsf-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 999;
}
.wsf-overlay.active { display: block; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1024px) {
    .wsf-grid { --wsf-cols: 3; }
}

@media (max-width: 768px) {
    /* Show mobile bar */
    .wsf-mobile-bar { display: flex; }
    .wsf-mobile-only { display: flex; }

    /* Hide desktop topbar sort on mobile */
    .wsf-topbar { display: none; }

    /* Layout: no sidebar inline */
    .wsf-layout { gap: 0; }

    /* Sidebar becomes a slide-in drawer */
    .wsf-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 240px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        background: #fff;
        border-radius: 0;
        transition: left .3s cubic-bezier(0.4,0,0.2,1);
        box-shadow: none;
        overflow-y: auto;
    }
    .wsf-sidebar.open {
        left: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }
    .wsf-sidebar-inner {
        border-radius: 0;
        min-height: 100%;
        padding-bottom: 24px;
    }
    .wsf-sidebar-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 16px 16px 12px;
        font-size: 1rem;
        font-weight: 800;
        border-bottom: 1px solid var(--wsf-border);
        margin-bottom: 4px;
    }
    .wsf-close-sidebar {
        background: none;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
        color: var(--wsf-muted);
        line-height: 1;
        padding: 0;
    }

    /* Grid 2 columns on mobile */
    .wsf-grid { --wsf-cols: 2; gap: 10px; }

    .wsf-pill { font-size: 0.6rem; padding: 2px 7px; }
    .wsf-title { font-size: 0.78rem; }
    .wsf-sale-price { font-size: 0.88rem; }
    .wsf-cart-btn { width: 32px; height: 32px; }
    .wsf-cart-btn svg { width: 15px; height: 15px; }
    .wsf-info { padding: 7px 9px 0; gap: 5px; }
    .wsf-badge { font-size: 0.58rem; padding: 2px 6px; }
}

@media (max-width: 480px) {
    .wsf-grid { --wsf-cols: 2; gap: 8px; }
    .wsf-page-title { font-size: 1.25rem; }
}
/* ── TOPBAR FIX: full width above sidebar+grid ── */
.wsf-wrapper {
    display: flex;
    flex-direction: column;
}
.wsf-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    width: 100%;
    order: -1;
}
.wsf-topbar-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.wsf-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    width: 100%;
}

/* ══════════════════════════════════════
   FILTER DISABLED (wsf-no-sidebar)
   When admin turns off the filter sidebar,
   hide sidebar-related UI and expand grid.
══════════════════════════════════════ */
.wsf-no-sidebar .wsf-sidebar,
.wsf-no-sidebar .wsf-overlay,
.wsf-no-sidebar .wsf-mobile-bar { display: none !important; }

.wsf-no-sidebar .wsf-main { width: 100%; }

/* ══════════════════════════════════════
   CUSTOM OVERRIDES — Client Requirements
   ══════════════════════════════════════ */

/* ── Page / Category Title ── */
.wsf-page-title {
    font-size: 40px !important;
    color: #601050 !important;
    font-weight: 800;
    line-height: 1.2;
}

/* ── Product Count / Showing ── */
.wsf-showing,
.wsf-mobile-showing {
    font-size: 20px !important;
    font-weight: 400 !important;
    color: #601050 !important;
    white-space: nowrap;
}

/* ── Product Title ── */
.wsf-title {
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 1.4;
    margin: 0;
    /* WRAP FIX: allow title to wrap naturally — NO truncation */
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.wsf-title a {
    color: #601050 !important;
    text-decoration: none;
    display: block;         /* full width so wrapping works correctly */
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
}
.wsf-title a:hover {
    color: #8a1a70 !important;
}

/* ── Variant / Weight Pills ── */
.wsf-pill {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #601050 !important;
    border-color: transparent;
}
.wsf-pill:hover {
    border-color: #601050 !important;
    color: #601050 !important;
    background: #f5e6f2 !important;
}
.wsf-pill.active {
    background: #601050 !important;
    color: #fff !important;
    border-color: #601050 !important;
}

/* ── Prices ── */
/* Regular / MRP (strikethrough) — black */
.wsf-mrp {
    font-size: 18px !important;
    color: #000000 !important;
    font-weight: 500;
    text-decoration: line-through;
}
.wsf-mrp del,
.wsf-mrp del bdi {
    color: #000000 !important;
}

/* Sale price — dark/light black (#555) */
.wsf-sale-price {
    font-size: 18px !important;
    color: #555555 !important;
    font-weight: 700 !important;
}
.wsf-sale-price bdi {
    color: inherit !important;
}

/* ══════════════════════════════════════
   MOBILE RESPONSIVE OVERRIDES
   ══════════════════════════════════════ */
@media (max-width: 768px) {
    /* Category title scales down on mobile */
    .wsf-page-title {
        font-size: 24px !important;
    }

    /* Count */
    .wsf-showing,
    .wsf-mobile-showing {
        font-size: 14px !important;
    }

    /* Product title stays readable but smaller */
    .wsf-title {
        font-size: 14px !important;
        font-weight: 400 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
    }
    .wsf-title a {
        white-space: normal !important;
    }

    /* Variants */
    .wsf-pill {
        font-size: 11px !important;
        font-weight: 600 !important;
        padding: 2px 7px !important;
    }

    /* Prices */
    .wsf-mrp {
        font-size: 13px !important;
    }
    .wsf-sale-price {
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .wsf-page-title {
        font-size: 20px !important;
    }
    .wsf-title {
        font-size: 13px !important;
    }
    .wsf-pill {
        font-size: 10px !important;
        padding: 2px 6px !important;
    }
    .wsf-mrp,
    .wsf-sale-price {
        font-size: 12px !important;
    }
}
