/* WW Dealer Catalog — Archive / Catalog Page */

/* ── Header ─────────────────────────────────────────────────── */
.ww-archive-header {
    padding: 36px 0 20px;
}
.ww-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.ww-archive-title {
    font-size: clamp(22px, 3.5vw, 32px);
    margin: 0 0 10px;
    color: var(--ww-color-a);
}
.ww-archive-subtitle {
    font-size: 13px;
    color: var(--ww-color-c);
    margin: 6px 0 0;
    font-weight: 600;
}

/* ── Active filter pills (below title) ──────────────────────── */
.ww-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.ww-active-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--ww-color-a);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s;
}
.ww-active-pill:hover {
    background: var(--ww-color-c);
    color: #fff;
    text-decoration: none;
}
.ww-pill-x {
    font-size: 11px;
    opacity: 0.8;
    line-height: 1;
}

/* ── Body layout ────────────────────────────────────────────── */
.ww-archive-body {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 32px;
    padding-top: 12px;
    padding-bottom: 60px;
    align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.ww-archive-sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Filter section: span title outside card, card below ───── */
.ww-filter-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 8px;
}

/* Title outside the card — styled like a label, not a heading tag */
.ww-filter-section-title {
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ww-color-c);
    padding: 0 4px 6px;
}

/* Card wrap — white background, curved corners */
.ww-filter-card-wrap {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    padding: 6px 0;
}

/* ── Filter list inside card ────────────────────────────────── */
.ww-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.ww-filter-list li {
    margin: 0;
}
.ww-filter-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 14px;
    font-size: 13px;
    color: #444;
    text-decoration: none;
    transition: background 0.1s, color 0.1s;
}
.ww-filter-link:hover {
    background: rgba(0,0,0,0.04);
    color: #111;
    text-decoration: none;
}
.ww-filter-link.active,
.ww-filter-link.active:hover {
    background: var(--ww-color-a);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
}
.ww-filter-link.active .ww-filter-count {
    color: rgba(255,255,255,0.7);
}
.ww-filter-count {
    font-size: 11px;
    color: #bbb;
}

/* ── Clear button ───────────────────────────────────────────── */
.ww-filter-clear-btn {
    display: block;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ww-color-a);
    border: 2px solid var(--ww-color-a);
    padding: 7px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.12s;
    margin-top: 4px;
}
.ww-filter-clear-btn:hover {
    background: var(--ww-color-a);
    color: #fff !important;
    text-decoration: none;
}

/* ── Main + toolbar ─────────────────────────────────────────── */
.ww-archive-toolbar {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}
.ww-archive-count {
    font-size: 13px;
    color: var(--ww-color-c);
    font-weight: 600;
}
.ww-filter-toggle {
    padding: 8px 16px;
    background: var(--ww-color-a);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Empty state ────────────────────────────────────────────── */
.ww-archive-empty { padding: 60px 0; text-align: center; color: #888; }
.ww-archive-empty p { font-size: 16px; margin-bottom: 20px; }
.ww-archive-empty-clear {
    display: inline-block; padding: 10px 24px;
    background: var(--ww-color-a); color: #fff !important; border-radius: 4px;
    font-size: 14px; font-weight: 700; text-decoration: none;
}
.ww-archive-empty-clear:hover { background: var(--ww-color-c); color: #fff !important; text-decoration: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 860px) {
    .ww-archive-body { grid-template-columns: 1fr; }
    .ww-archive-sidebar {
        position: fixed; top: 0; left: 0;
        width: 280px; height: 100vh;
        background: #f4f4f4; z-index: 999;
        padding: 24px; overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .ww-archive-sidebar.open { transform: translateX(0); }
    .ww-archive-toolbar { display: flex; }
    .ww-dc-grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .ww-dc-grid-cols-3 { grid-template-columns: 1fr; }
}

/* ── Pagination ─────────────────────────────────────────────── */
.ww-archive-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 32px 0 16px;
}
.ww-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: var(--ww-color-a);
    background: #fff;
    border: 1.5px solid var(--ww-color-a);
    transition: background 0.12s, color 0.12s;
}
.ww-page-btn:hover {
    background: var(--ww-color-a);
    color: #fff;
    text-decoration: none;
}
.ww-page-btn.active {
    background: var(--ww-color-a);
    color: #fff;
    cursor: default;
    pointer-events: none;
}
.ww-page-ellipsis {
    display: inline-flex;
    align-items: center;
    color: #aaa;
    padding: 0 4px;
    font-size: 16px;
    user-select: none;
}

/* ── Collapsible category list ───────────────────────────────── */
.ww-cat-secondary-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
}
.ww-cat-more-wrap.ww-cat-expanded .ww-cat-secondary-list {
    display: block;
}
.ww-cat-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--ww-color-a);
    padding: 8px 12px;
    text-align: left;
    transition: color 0.12s;
}
.ww-cat-toggle:hover { color: var(--ww-color-c); }
.ww-cat-toggle-less { display: none; }
.ww-cat-more-wrap.ww-cat-expanded .ww-cat-toggle-more { display: none; }
.ww-cat-more-wrap.ww-cat-expanded .ww-cat-toggle-less { display: inline; }

/* ── Accordion filter sections ───────────────────────────────── */
.ww-filter-section-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ww-filter-section-title::after {
    content: '\25BE';
    font-size: 11px;
    margin-left: 6px;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.ww-filter-section.ww-collapsed .ww-filter-section-title::after {
    transform: rotate(-90deg);
}
.ww-filter-section.ww-collapsed .ww-filter-card-wrap {
    display: none;
}

/* ── Collapsed filter summary pill ──────────────────────────── */
.ww-filter-collapsed-summary {
    display: none;
    padding: 4px 8px 6px;
}
.ww-filter-section.ww-collapsed .ww-filter-collapsed-summary {
    display: block;
}
.ww-filter-active-pill {
    display: inline-flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: var(--ww-color-a);
    color: #fff !important;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
}
.ww-filter-active-pill:hover {
    background: var(--ww-color-c);
    color: #fff;
    text-decoration: none;
}

/* ── Mobile: disable accordion, show all filters expanded ────── */
@media (max-width: 860px) {
    /* Force all sections open regardless of ww-collapsed class */
    .ww-filter-section.ww-collapsed .ww-filter-card-wrap {
        display: block !important;
    }
    /* Hide pills — not needed when everything is expanded */
    .ww-filter-collapsed-summary {
        display: none !important;
    }
    /* Hide chevron — sections aren't collapsible on mobile */
    .ww-filter-section-title::after {
        display: none;
    }
    /* Remove pointer cursor — title click does nothing useful on mobile */
    .ww-filter-section-title {
        cursor: default;
        pointer-events: none;
    }
    /* Expand secondary category list on mobile too */
    .ww-cat-secondary-list {
        display: block !important;
    }
    .ww-cat-toggle {
        display: none;
    }
}

/* ── Mobile sidebar close button ────────────────────────────── */
.ww-sidebar-close {
    display: none; /* hidden on desktop */
}
@media (max-width: 860px) {
    .ww-sidebar-close {
        display: flex;
        align-items: center;
        gap: 6px;
        width: 100%;
        background: none;
        border: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        padding: 14px 0 14px;
        margin-bottom: 16px;
        font-size: 14px;
        font-weight: 700;
        color: var(--ww-color-a);
        cursor: pointer;
        text-align: left;
    }
    .ww-sidebar-close:hover { color: var(--ww-color-c); }

    /* Drawer covers everything including the fixed header */
    .ww-archive-sidebar {
        top: 0 !important;
        height: 100vh !important;
        z-index: 2147483647 !important;
    }
}
