/* ============================================================
   CATEGORY / SINGLE COLLECTION PAGE
   ============================================================ */

body.single-collection-page,
body.single-product-page {
    background: #ffffff;
    color: #1a1a1a;
}

/* ── Marquee (reuses collections.css) ── */

/* ── Navbar override: white background on category/product pages ── */
.category-page-nav {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e5e5;
}

.category-page-nav .nav-link,
.category-page-nav .menu-text {
    color: #1a1a1a !important;
}

.category-page-nav .nav-icon-link svg,
.category-page-nav .hamburger-btn svg,
.category-page-nav .nav-icons svg,
.category-page-nav .region-text,
.category-page-nav .dropdown-arrow svg {
    stroke: #1a1a1a;
    color: #1a1a1a;
}

/* ============================================================
   CATEGORY LAYOUT
   ============================================================ */
.category-container {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-content: start;
    gap: 0;
    min-height: calc(100vh - 142px);
    padding-top: 142px; /* clear fixed navbar + marquee */
}

/* ── Collection Header ── */
.collection-header {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
    padding: 48px 24px 40px;
    border-bottom: 1px solid #e5e5e5;
}

.collection-header-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(22px, 4vw, 38px);
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0;
}

/* ── Filter Sidebar ── */
.filter-sidebar {
    grid-row: 2;
    background: #fff;
    padding: 24px 16px;
    border-right: 1px solid #e5e5e5;
    position: sticky;
    top: 142px;
    height: calc(100vh - 142px);
    overflow-y: auto;
}

.filter-group {
    border-bottom: 1px solid #e5e5e5;
    padding: 12px 0;
}

.filter-group summary {
    list-style: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    user-select: none;
}

.filter-group summary::-webkit-details-marker { display: none; }

.filter-group summary::after {
    content: '+';
    font-size: 16px;
    font-weight: 300;
    transition: transform 0.2s ease;
}

.filter-group[open] summary::after {
    content: '−';
}

.filter-content {
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: #444;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #1a1a1a;
}

/* ── Product Main Area ── */
.category-main {
    grid-row: 2;
    background: #fff;
    padding: 24px 32px;
}

/* ── Toolbar ── */
.category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 24px;
    gap: 16px;
}

.toolbar-left {
    display: flex;
    gap: 8px;
}

.view-btn {
    background: none;
    border: 1px solid #e5e5e5;
    padding: 6px 8px;
    cursor: pointer;
    color: #888;
    border-radius: 2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.view-btn.active,
.view-btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.toolbar-center {
    flex: 1;
    text-align: center;
}

.product-count {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1px;
    color: #1a1a1a;
    text-transform: uppercase;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: #888;
    text-transform: uppercase;
    white-space: nowrap;
}

.sort-select {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    border-bottom: 1px solid #1a1a1a;
    padding: 4px 4px 2px;
    cursor: pointer;
    background: transparent;
    color: #1a1a1a;
    outline: none;
    text-transform: uppercase;
}

/* ── Product Grid ── */
.product-grid {
    display: grid;
    gap: 24px 16px;
}

.product-grid.cols-1 { grid-template-columns: 1fr; }
.product-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.product-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Product Card ── */
.product-card {
    position: relative;
}

.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image-wrap {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: #f5f5f5;
}

.product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.product-card-link:hover .product-image-wrap img {
    transform: scale(1.04);
}

.sold-out-badge {
    position: absolute;
    top: 12px;
    left: 0;
    background: #1a1a1a;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 4px 10px;
    text-transform: uppercase;
}

.product-card-info {
    padding: 10px 0 0;
}

.product-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.4;
}

.product-sku {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: #888;
    margin: 0 0 4px;
}

.product-price {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* ── Quick View button (slides up from bottom of image on hover) ── */

.product-qv-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.82);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 11px 10px;
    border: none;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.22s, transform 0.22s;
    width: 100%;
    z-index: 2;
}

.product-image-wrap:hover .product-qv-btn,
.product-image-wrap:focus-within .product-qv-btn {
    opacity: 1;
    transform: translateY(0);
}

/* ── Quick View Modal ── */

.az-qv-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.az-qv-overlay.open {
    display: flex;
}

.az-qv-modal {
    background: #fff;
    max-width: 820px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    max-height: 92vh;
    overflow: auto;
}

.az-qv-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #1a1a1a;
    line-height: 1;
    z-index: 2;
    padding: 4px;
}

.az-qv-close:hover { color: #555; }

.az-qv-img-col {
    aspect-ratio: 4/5;
    overflow: hidden;
    background: #f5f5f5;
    flex-shrink: 0;
}

.az-qv-img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.az-qv-info {
    padding: 40px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.az-qv-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.5;
    padding-right: 24px;
}

.az-qv-price {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.az-qv-meta {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    color: #888;
    margin: 0;
}

.az-qv-size-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.az-qv-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.az-qv-size-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 7px 14px;
    border: 1px solid #ddd;
    background: #fff;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    border-radius: 0;
}

.az-qv-size-btn:hover,
.az-qv-size-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.az-qv-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.az-qv-add-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 15px 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.az-qv-add-btn:hover    { background: #333; }
.az-qv-add-btn.oos      { background: #aaa; cursor: default; }
.az-qv-add-btn.added    { background: #2e7d32; }

.az-qv-full-link {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    text-decoration: none;
    text-align: center;
    padding: 6px 0;
}

.az-qv-full-link:hover { color: #1a1a1a; }

@media (max-width: 640px) {
    .az-qv-modal    { grid-template-columns: 1fr; }
    .az-qv-img-col  { aspect-ratio: 3/2; max-height: 220px; }
    .az-qv-info     { padding: 24px 20px 24px; }
}

/* ── Mobile-only elements: hidden on desktop ── */
.mobile-filter-bar     { display: none; }
.filter-sidebar-header { display: none; }
.filter-sidebar-footer { display: none; }
.mobile-sort-sheet     { display: none; }
.mobile-panel-backdrop { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .category-container {
        grid-template-columns: 180px 1fr;
    }
    .product-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    /* Container: single column, sidebar removed from flow */
    .category-container {
        grid-template-columns: 1fr;
        padding-top: 110px;
    }

    .collection-header {
        padding: 24px 16px 20px;
    }

    /* === FILTER DRAWER === */
    .filter-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 85%;
        max-width: 340px;
        height: 100vh;
        z-index: 1001;
        overflow-y: auto;
        padding: 0;
        border: none;
        background: #fff;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.14);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .filter-sidebar.open {
        transform: translateX(0);
    }

    /* Drawer header — sticky at top of drawer */
    .filter-sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 20px;
        border-bottom: 1px solid #e5e5e5;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }

    .filter-sidebar-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: #1a1a1a;
    }

    .filter-sidebar-close {
        background: none;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: #1a1a1a;
        line-height: 1;
        padding: 4px 6px;
    }

    /* Filter groups: padding inside drawer */
    .filter-sidebar .filter-group {
        padding: 12px 20px;
    }

    /* Drawer footer — sticky at bottom of drawer */
    .filter-sidebar-footer {
        display: block;
        padding: 16px 20px;
        border-top: 1px solid #e5e5e5;
        position: sticky;
        bottom: 0;
        background: #fff;
    }

    .filter-view-results-btn {
        width: 100%;
        padding: 15px;
        background: #1a1a1a;
        color: #fff;
        font-family: 'Montserrat', sans-serif;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 2px;
        text-transform: uppercase;
        border: none;
        cursor: pointer;
        transition: background 0.2s;
    }

    .filter-view-results-btn:hover { background: #333; }

    /* === MOBILE FILTER / SORT BAR === */
    .mobile-filter-bar {
        display: flex;
        align-items: stretch;
        border-bottom: 1px solid #e5e5e5;
        background: #fff;
        position: sticky;
        top: 110px;
        z-index: 100;
    }

    .mob-filter-btn,
    .mob-sort-btn {
        flex: 1;
        padding: 13px 8px;
        background: none;
        border: none;
        font-family: 'Montserrat', sans-serif;
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        color: #1a1a1a;
    }

    .mob-filter-btn { border-right: 1px solid #e5e5e5; }

    /* View toggle buttons */
    .mob-view-btns {
        display: flex;
        align-items: stretch;
        border-right: 1px solid #e5e5e5;
    }

    .mob-view-btn {
        background: none;
        border: none;
        padding: 0 14px;
        cursor: pointer;
        color: #ccc;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: color 0.15s;
    }

    .mob-view-btn + .mob-view-btn {
        border-left: 1px solid #e5e5e5;
    }

    .mob-view-btn.active { color: #1a1a1a; }

    /* Hide desktop toolbar */
    .category-toolbar { display: none; }

    /* === SORT BOTTOM SHEET === */
    .mobile-sort-sheet {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        z-index: 1001;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        max-height: 80vh;
        overflow-y: auto;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    }

    .mobile-sort-sheet.open {
        transform: translateY(0);
    }

    .mobile-sort-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 18px 24px;
        border-bottom: 1px solid #e5e5e5;
    }

    .mobile-sort-title {
        font-family: 'Montserrat', sans-serif;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: #1a1a1a;
    }

    .mobile-sort-close {
        background: none;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: #1a1a1a;
        line-height: 1;
        padding: 4px 6px;
    }

    .mobile-sort-options {
        padding: 8px 0 24px;
    }

    .mobile-sort-opt {
        display: block;
        width: 100%;
        padding: 14px 24px;
        background: none;
        border: none;
        font-family: 'Montserrat', sans-serif;
        font-size: 13px;
        color: #444;
        cursor: pointer;
        text-align: center;
        transition: color 0.15s;
    }

    .mobile-sort-opt:hover { color: #1a1a1a; }

    .mobile-sort-opt.active {
        font-weight: 700;
        color: #1a1a1a;
    }

    /* === BACKDROP === */
    .mobile-panel-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-panel-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Product area */
    .category-main { padding: 0 16px 16px; }

    /* Single-view: center card info text */
    .product-grid.cols-1 .product-card-info { text-align: center; }
    .product-grid.cols-1 .product-card-rating { justify-content: center; }

    .toolbar-left .view-btn { display: none; }
}

@media (max-width: 480px) {
    .product-grid.cols-2 { gap: 12px 8px; }
    .product-title { font-size: 11px; }
    .product-price { font-size: 12px; }
}
