/* ============================================================
   SHOP / COLLECTION PAGE — Complete Redesign
   ============================================================ */

/* ---- Page-level reset ---- */
body.page-collection #main-content {
    padding-top: 0;
    padding-bottom: 0;
}

/* ============ SHOP HEADER ============ */
.shop-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1a3025 100%);
    color: #fff;
    padding: 48px 0 36px;
    position: relative;
    overflow: hidden;
}
.shop-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(200,162,100,.10) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(200,162,100,.06) 0%, transparent 50%);
    pointer-events: none;
}
.shop-header-inner {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
.shop-header h1 {
    font-size: 1.85rem;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
    color: #fff;
}
.shop-header-desc {
    color: rgba(255,255,255,.65);
    font-size: 0.92rem;
    max-width: 560px;
    line-height: 1.5;
    margin: 0;
}

/* Breadcrumb */
.shop-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
    margin-bottom: 10px;
}
.shop-breadcrumb a {
    color: rgba(255,255,255,.55);
    text-decoration: none;
    transition: color .2s;
}
.shop-breadcrumb a:hover { color: var(--color-accent); }
.shop-breadcrumb .sep { color: rgba(255,255,255,.3); font-size: 0.7rem; }
.shop-breadcrumb .current { color: var(--color-accent); font-weight: 600; }

/* ============ SHOP CONTAINER (sidebar + main) ============ */
.shop-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px 48px;
    align-items: start;
}

/* ============ LEFT SIDEBAR ============ */
.shop-sidebar {
    position: sticky;
    top: calc(var(--header-height, 70px) + 16px);
    max-height: calc(100vh - var(--header-height, 70px) - 32px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--color-gray-100);
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}

/* thin scrollbar */
.shop-sidebar::-webkit-scrollbar { width: 4px; }
.shop-sidebar::-webkit-scrollbar-thumb { background: var(--color-gray-200); border-radius: 4px; }

/* Drawer header — hidden on desktop, shown on mobile/tablet */
.sidebar-drawer-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-gray-100);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 3;
}
.sidebar-drawer-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-primary);
    margin: 0;
}
.sidebar-drawer-header h3 i { color: var(--color-accent); }
.sidebar-drawer-close {
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: none; cursor: pointer;
    background: var(--color-gray-50); color: var(--color-gray-500);
    font-size: 1rem; transition: all .2s;
}
.sidebar-drawer-close:hover { background: var(--color-gray-200); color: var(--color-primary); }

/* Sidebar body */
.sidebar-body { padding: 20px; }

/* Active filters */
.sb-active-filters { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--color-gray-100); }
.sb-active-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sb-active-header span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--color-gray-500); }
.sb-active-header a { font-size: 0.76rem; color: var(--color-accent); font-weight: 500; text-decoration: none; }
.sb-active-header a:hover { text-decoration: underline; }
.sb-active-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 50px; font-size: 0.76rem; font-weight: 600;
    background: rgba(197,33,132,.08); border: 1px solid rgba(197,33,132,.18); color: var(--color-primary);
}
.sb-tag a { color: var(--color-accent); font-size: 1rem; line-height: 1; text-decoration: none; font-weight: 700; }

/* ---- Filter sections ---- */
.sb-section { border-bottom: 1px solid var(--color-gray-100); }
.sb-section:last-child { border-bottom: none; }

.sb-section-title {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 12px 0; border: none; background: none; cursor: pointer;
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: var(--color-primary); transition: color .2s;
}
.sb-section-title:hover { color: var(--color-accent); }
.sb-section-title span { display: flex; align-items: center; gap: 8px; }
.sb-section-title span i { font-size: 0.72rem; color: var(--color-accent); width: 16px; text-align: center; }
.sb-arrow { font-size: 0.55rem; color: var(--color-gray-400); transition: transform .3s; }
.sb-section.collapsed .sb-arrow { transform: rotate(180deg); }

.sb-section-body {
    overflow: hidden;
    max-height: 600px;
    opacity: 1;
    transition: max-height .35s ease, opacity .25s ease, padding .25s ease;
    padding-bottom: 12px;
}
.sb-section.collapsed .sb-section-body {
    max-height: 0; opacity: 0; padding-bottom: 0; pointer-events: none;
}

/* Sort section — desktop hidden */
.sb-section-sort-mobile { display: none; }

/* ---- Category list ---- */
.sb-cat-list { list-style: none; padding: 0; margin: 0; }
.sb-cat-list > li { margin-bottom: 1px; }
.sb-cat-list > li > a,
.sb-cat-row > a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px; border-radius: 8px; font-size: 0.84rem;
    color: var(--color-gray-600); text-decoration: none; font-weight: 500;
    transition: all .2s;
}
.sb-cat-list > li > a:hover,
.sb-cat-row > a:hover { background: var(--color-gray-50); color: var(--color-primary); }
.sb-cat-list > li > a.active,
.sb-cat-row > a.active {
    background: rgba(197,33,132,.08); color: var(--color-accent);
    font-weight: 700; border: 1px solid rgba(197,33,132,.15);
}

/* Parent category row */
.sb-cat-row { display: flex; align-items: center; }
.sb-cat-row > a { flex: 1; font-weight: 600; color: var(--color-primary); }
.sb-cat-toggle {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border: none; background: none; cursor: pointer; color: var(--color-gray-400);
    font-size: 0.6rem; border-radius: 6px; transition: all .2s; flex-shrink: 0;
}
.sb-cat-toggle:hover { background: var(--color-gray-50); color: var(--color-accent); }
.sb-cat-parent.open .sb-cat-toggle i { transform: rotate(180deg); }

/* Child categories */
.sb-cat-children {
    list-style: none; padding: 0 0 0 16px; margin: 0;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .3s ease, opacity .25s ease;
    border-left: 2px solid var(--color-gray-100); margin-left: 12px;
}
.sb-cat-parent.open .sb-cat-children { max-height: 400px; opacity: 1; padding-top: 4px; padding-bottom: 4px; }
.sb-cat-children a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 10px; font-size: 0.8rem; color: var(--color-gray-500);
    text-decoration: none; border-radius: 6px; transition: all .2s;
}
.sb-cat-children a:hover { background: var(--color-gray-50); color: var(--color-primary); padding-left: 14px; }
.sb-cat-children a.active {
    background: rgba(197,33,132,.08); color: var(--color-accent);
    font-weight: 600; border: 1px solid rgba(197,33,132,.15);
}
.sb-count {
    font-size: 0.66rem; background: var(--color-gray-100); color: var(--color-gray-500);
    padding: 2px 8px; border-radius: 50px; font-weight: 600; min-width: 22px; text-align: center;
}
.sb-cat-children a.active .sb-count { background: rgba(197,33,132,.15); color: var(--color-accent); }

/* ---- Price ---- */
.sb-price-links { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.sb-price-link {
    font-size: 0.82rem; color: var(--color-gray-600); padding: 6px 12px;
    border-radius: 8px; text-decoration: none; transition: all .2s;
}
.sb-price-link:hover { background: var(--color-gray-50); color: var(--color-primary); }
.sb-price-link.active {
    background: rgba(197,33,132,.08); color: var(--color-accent); font-weight: 600;
}

.sb-price-form { display: flex; flex-direction: column; gap: 8px; }
.sb-price-inputs { display: flex; flex-direction: column; gap: 8px; }
.sb-price-inputs input {
    flex: 1; padding: 8px 10px; border: 1.5px solid var(--color-gray-200);
    border-radius: 8px; font-size: 0.82rem; outline: none; background: var(--color-gray-50);
    transition: border-color .2s, box-shadow .2s;
}
.sb-price-inputs input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(197,33,132,.08); background: #fff; }
.sb-price-inputs span { display: none; }
.sb-price-btn {
    padding: 8px 16px; border: none; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
    background: linear-gradient(135deg, var(--color-accent), #a01a6c); color: #fff;
    cursor: pointer; transition: all .25s;
}
.sb-price-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(197,33,132,.25); }

/* ---- Simple list (availability, sort) ---- */
.sb-list { list-style: none; padding: 0; margin: 0; }
.sb-list li { margin-bottom: 1px; }
.sb-list a {
    display: block; padding: 7px 12px; font-size: 0.82rem; color: var(--color-gray-600);
    text-decoration: none; border-radius: 8px; transition: all .2s;
}
.sb-list a:hover { background: var(--color-gray-50); color: var(--color-primary); }
.sb-list a.active {
    background: rgba(197,33,132,.08); color: var(--color-accent);
    font-weight: 600; border: 1px solid rgba(197,33,132,.15);
}

/* ============ RIGHT — MAIN CONTENT ============ */
.shop-main { min-width: 0; }

/* Toolbar */
.shop-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; margin-bottom: 20px;
    background: #fff; border: 1px solid var(--color-gray-100);
    border-radius: 12px; box-shadow: 0 1px 8px rgba(0,0,0,.03);
}
.shop-filter-btn {
    display: none; /* hidden on desktop */
    align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer;
    font-size: 0.84rem; font-weight: 600; white-space: nowrap;
    background: linear-gradient(135deg, var(--color-primary), #1a3025);
    color: var(--color-accent); transition: box-shadow .2s;
}
.shop-filter-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.shop-toolbar-count {
    font-size: 0.82rem; color: var(--color-gray-500); font-weight: 500; white-space: nowrap;
}
.shop-toolbar-sort {
    display: flex; align-items: center; gap: 8px; margin-left: auto;
}
.shop-toolbar-sort label {
    font-size: 0.82rem; color: var(--color-gray-600); font-weight: 600; white-space: nowrap;
}
.shop-toolbar-sort select {
    padding: 8px 12px; border: 1.5px solid var(--color-gray-200); border-radius: 8px;
    font-size: 0.82rem; outline: none; cursor: pointer; background: #fff; transition: all .2s;
}
.shop-toolbar-sort select:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(197,33,132,.08); }

/* ============ PRODUCT GRID ============ */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* ============ PAGINATION ============ */
.shop-pagination {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-top: 32px; padding: 20px 0 8px;
    border-top: 1px solid var(--color-gray-100);
}
.pg-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 22px; font-size: 0.84rem; font-weight: 600;
    border-radius: 10px; text-decoration: none; white-space: nowrap;
    transition: all .25s;
}
.pg-prev {
    background: #fff; color: var(--color-primary);
    border: 1.5px solid var(--color-gray-200);
}
.pg-prev:not(.disabled):hover {
    border-color: var(--color-accent); color: var(--color-accent);
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.pg-next {
    background: linear-gradient(135deg, var(--color-accent), #a01a6c);
    color: #fff; border: none;
}
.pg-next:not(.disabled):hover {
    transform: translateY(-2px); box-shadow: 0 6px 16px rgba(197,33,132,.25);
}
.pg-btn.disabled { opacity: .35; pointer-events: none; cursor: default; }

.pg-numbers { display: flex; align-items: center; gap: 6px; }
.pg-num {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 0.84rem; font-weight: 600;
    color: var(--color-gray-600); border: 1px solid var(--color-gray-200);
    background: #fff; text-decoration: none; transition: all .25s;
}
a.pg-num:hover {
    background: linear-gradient(135deg, var(--color-accent), #a01a6c);
    color: #fff; border-color: transparent;
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(197,33,132,.25);
}
.pg-num.current {
    background: linear-gradient(135deg, var(--color-accent), #a01a6c);
    color: #fff; border: none; box-shadow: 0 4px 12px rgba(197,33,132,.25);
}
.pg-dots { padding: 0 4px; font-size: 0.84rem; color: var(--color-gray-400); }

/* ============ EMPTY STATE ============ */
.shop-empty {
    text-align: center; padding: 60px 24px;
    background: #fff; border: 1px solid var(--color-gray-100);
    border-radius: 16px; box-shadow: 0 2px 16px rgba(0,0,0,.03);
}
.shop-empty i { font-size: 3rem; margin-bottom: 16px; color: var(--color-accent); opacity: .5; }
.shop-empty h3 { color: var(--color-primary); font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.shop-empty p { margin-bottom: 20px; color: var(--color-gray-500); font-size: 0.88rem; }

/* ============ OVERLAY (mobile/tablet) ============ */
.shop-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
    z-index: 9998; opacity: 0; transition: opacity .3s;
}
.shop-overlay.active { display: block; opacity: 1; }

/* ==============================================================
   RESPONSIVE
   ============================================================== */

/* 4-col grid on very wide screens */
@media (min-width: 1440px) {
    .shop-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Tablet landscape / small desktop ---- */
@media (max-width: 1200px) {
    .shop-container { grid-template-columns: 260px 1fr; gap: 24px; }
}

/* ---- Tablet ≤1024px — sidebar becomes drawer ---- */
@media (max-width: 1024px) {
    .shop-container {
        display: block;
        padding: 16px 16px 48px;
    }
    .shop-sidebar {
        position: fixed; top: 0; left: 0;
        width: 320px; height: 100vh; max-height: 100vh;
        border-radius: 0; border: none; z-index: 9999;
        transform: translateX(-100%);
        transition: transform .3s cubic-bezier(.4,0,.2,1);
        box-shadow: 8px 0 30px rgba(0,0,0,.12);
    }
    .shop-sidebar.open { transform: translateX(0); }
    .sidebar-drawer-header { display: flex; }
    .shop-filter-btn { display: inline-flex; }
    .shop-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

    .sb-section-sort-mobile { display: block; }
    .shop-toolbar-sort label { display: none; }
}

/* ---- Mobile ≤768px ---- */
@media (max-width: 768px) {
    body.page-collection #main-content { padding-bottom: 70px; }

    .shop-header { padding: 32px 0 24px; }
    .shop-header-inner { padding: 0 16px; }
    .shop-header h1 { font-size: 1.3rem; margin-bottom: 4px; }
    .shop-header-desc { font-size: 0.8rem; }
    .shop-breadcrumb { font-size: 0.72rem; margin-bottom: 8px; }

    .shop-container { padding: 12px 12px 80px; }

    .shop-sidebar { width: 300px; }

    /* Touch-friendly: larger tap targets */
    .sb-cat-list > li > a,
    .sb-cat-row > a,
    .sb-cat-children a,
    .sb-list a,
    .sb-price-link {
        padding: 10px 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .sb-cat-toggle { width: 44px; height: 44px; }
    .sb-price-inputs input { padding: 10px 12px; min-height: 44px; }
    .sb-price-btn { padding: 12px 16px; min-height: 44px; }

    .shop-toolbar { padding: 8px 12px; margin-bottom: 14px; }
    .shop-toolbar-sort select { font-size: 0.78rem; padding: 7px 8px; }

    .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Pagination compact */
    .shop-pagination { gap: 8px; margin-top: 20px; padding: 14px 0; flex-wrap: wrap; }
    .pg-btn { padding: 9px 14px; font-size: 0.78rem; gap: 5px; }
    .pg-num { width: 34px; height: 34px; font-size: 0.78rem; }
}

/* ---- Small mobile ≤480px ---- */
@media (max-width: 480px) {
    .shop-sidebar { width: 85vw; max-width: 320px; }

    .shop-grid { gap: 8px; }

    .shop-toolbar { flex-wrap: wrap; }
    .shop-toolbar-sort { margin-left: 0; flex: 1; }
    .shop-toolbar-sort select { width: 100%; }

    .shop-pagination { flex-wrap: wrap; justify-content: center; }
    .pg-numbers { order: -1; width: 100%; justify-content: center; margin-bottom: 6px; }
    .pg-btn { padding: 8px 12px; font-size: 0.75rem; }

    .shop-header { padding: 24px 0 18px; }
    .shop-header h1 { font-size: 1.1rem; }
    .shop-header-desc { font-size: 0.75rem; }
}
