/* =========================================================================
   ACME Catalog — filterable product grid
   Loaded only on pages using page-catalog.php (see functions.php).
   Design follows the existing .product-card style; layout introduces a
   sticky left sidebar + main grid.
   ========================================================================= */

/* ---------- Hero ---------- */
.catalog-hero {
    padding: 80px 0 40px;
}

/* ---------- Layout shell ---------- */
.catalog-section {
    padding: 32px 0 80px;
    background: #fff;
}
.catalog-shell {
    max-width: 1344px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* ---------- Sidebar ---------- */
.catalog-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e6e8ef;
    border-radius: 12px;
    padding: 0;
    scrollbar-width: thin;
}
.catalog-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid #f0f1f5;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.catalog-sidebar__heading {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-navy);
    margin: 0;
}
.catalog-sidebar__close {
    display: none;
    background: none;
    border: 0;
    font-size: 28px;
    line-height: 1;
    color: var(--color-navy);
    cursor: pointer;
    padding: 0 4px;
}
.catalog-sidebar__body {
    padding: 8px 20px 20px;
}
.catalog-sidebar__footer {
    display: none;
    padding: 16px 20px;
    border-top: 1px solid #f0f1f5;
    position: sticky;
    bottom: 0;
    background: #fff;
}

/* ---------- Search input ---------- */
.catalog-sidebar__search {
    margin: 12px 0 16px;
}
.catalog-sidebar__search input {
    width: 100%;
    border: 1px solid #d8dae3;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}
.catalog-sidebar__search input:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 3px rgba(6, 1, 67, 0.08);
}

/* ---------- Filter group (accordion) ---------- */
.catalog-filter {
    border-top: 1px solid #f0f1f5;
    padding: 14px 0 10px;
}
.catalog-filter:first-of-type { border-top: 0; }
.catalog-filter__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    user-select: none;
}
.catalog-filter__summary::-webkit-details-marker { display: none; }
.catalog-filter__label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-navy);
}
.catalog-filter__chev {
    width: 10px; height: 10px;
    border-right: 2px solid var(--color-navy);
    border-bottom: 2px solid var(--color-navy);
    transform: rotate(45deg);
    transition: transform .15s;
    margin-right: 4px;
}
.catalog-filter[open] .catalog-filter__chev {
    transform: rotate(-135deg);
    margin-top: 4px;
}
.catalog-filter__body {
    padding: 10px 0 4px;
}
.catalog-filter__search {
    width: 100%;
    border: 1px solid #d8dae3;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: var(--font-body);
    margin-bottom: 8px;
}
.catalog-filter__search:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 2px rgba(6, 1, 67, 0.08);
}
.catalog-filter__options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}
.catalog-filter__option--collapsed { display: none; }
.catalog-filter--expanded .catalog-filter__option--collapsed { display: list-item; }
.catalog-filter__option--hidden { display: none !important; }

.catalog-filter__check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px;
    border-radius: 4px;
    font-size: 14px;
    color: #2c2e3d;
    cursor: pointer;
    transition: background .12s;
}
.catalog-filter__check:hover { background: #f5f6f8; }
.catalog-filter__check.is-disabled {
    color: #a8aab6;
    cursor: not-allowed;
}
.catalog-filter__check.is-disabled:hover { background: transparent; }
.catalog-filter__check input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--color-navy);
    cursor: pointer;
    margin: 0;
}
.catalog-filter__check input[type="checkbox"]:disabled { cursor: not-allowed; }
.catalog-filter__check-name { flex: 1; }
.catalog-filter__check-count {
    color: #8c8fa1;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.catalog-filter__more {
    margin-top: 8px;
    background: none;
    border: 0;
    padding: 4px 0;
    color: var(--color-navy);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.catalog-filter__empty {
    margin: 0;
    color: #8c8fa1;
    font-size: 13px;
    font-style: italic;
}

/* ---------- Range slider ---------- */
.catalog-range { padding: 12px 4px 4px; }
.catalog-range__track {
    position: relative;
    height: 28px;
    margin-bottom: 12px;
}
.catalog-range__track::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 4px;
    background: #e6e8ef;
    border-radius: 2px;
    transform: translateY(-50%);
}
.catalog-range__fill {
    position: absolute;
    top: 50%;
    height: 4px;
    background: var(--color-navy);
    border-radius: 2px;
    transform: translateY(-50%);
    pointer-events: none;
}
.catalog-range__input {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 28px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
}
.catalog-range__input::-webkit-slider-runnable-track { background: none; height: 28px; }
.catalog-range__input::-moz-range-track { background: none; height: 28px; }
.catalog-range__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--color-navy);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(6, 1, 67, 0.25);
    cursor: pointer;
    margin-top: 0;
    position: relative;
    z-index: 2;
}
.catalog-range__input::-moz-range-thumb {
    pointer-events: auto;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--color-navy);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(6, 1, 67, 0.25);
    cursor: pointer;
}
.catalog-range__input--max { z-index: 3; }
.catalog-range__nums {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #2c2e3d;
}
.catalog-range__num {
    width: 70px;
    border: 1px solid #d8dae3;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 13px;
    font-family: var(--font-body);
    text-align: center;
    -moz-appearance: textfield;
}
.catalog-range__num::-webkit-outer-spin-button,
.catalog-range__num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.catalog-range__num:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 2px rgba(6, 1, 67, 0.08);
}
.catalog-range__sep { color: #8c8fa1; }
.catalog-range__unit { color: #8c8fa1; font-size: 12px; }

/* ---------- Topbar ---------- */
.catalog-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 14px;
    border-bottom: 1px solid #f0f1f5;
    margin-bottom: 18px;
    gap: 16px;
    flex-wrap: wrap;
}
.catalog-topbar__count {
    font-size: 14px;
    color: #2c2e3d;
}
.catalog-topbar__count strong { color: var(--color-navy); font-weight: 600; }
.catalog-topbar__sort {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2c2e3d;
}
.catalog-topbar__sort select {
    border: 1px solid #d8dae3;
    border-radius: 4px;
    padding: 6px 10px;
    background: #fff;
    font-size: 13px;
    font-family: var(--font-body);
    color: var(--color-navy);
    cursor: pointer;
}
.catalog-topbar__sort select:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 2px rgba(6, 1, 67, 0.08);
}

/* ---------- Active filter chips ---------- */
.catalog-chips {
    margin-bottom: 18px;
    min-height: 1px;
}
.catalog-chips__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.catalog-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 12px;
    background: var(--color-navy);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    border: 0;
    cursor: pointer;
    transition: background .12s;
    font-family: var(--font-body);
}
.catalog-chip:hover { background: #1a155b; }
.catalog-chip__x {
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    font-weight: 700;
}
.catalog-chips__clear {
    background: none;
    border: 0;
    color: var(--color-navy);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 4px 8px;
}
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Results grid ---------- */
.catalog-results { position: relative; min-height: 200px; }
.catalog-results[aria-busy="true"] {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity .15s;
}
.catalog-results[aria-busy="true"]::after {
    content: '';
    position: absolute;
    top: 60px; left: 50%;
    width: 32px; height: 32px;
    margin-left: -16px;
    border: 3px solid #e6e8ef;
    border-top-color: var(--color-navy);
    border-radius: 50%;
    animation: catalog-spin .9s linear infinite;
}
@keyframes catalog-spin { to { transform: rotate(360deg); } }

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ---------- Empty state ---------- */
.catalog-empty {
    padding: 60px 20px;
    text-align: center;
    background: #f8f9fb;
    border-radius: 12px;
}
.catalog-empty__title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy);
    margin: 0 0 8px;
}
.catalog-empty__hint { color: #2c2e3d; margin: 0; font-size: 14px; }
.catalog-clear-link {
    background: none;
    border: 0;
    color: var(--color-navy);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* ---------- Pagination ---------- */
.catalog-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}
.catalog-pagination__item a,
.catalog-pagination__item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d8dae3;
    border-radius: 4px;
    background: #fff;
    color: var(--color-navy);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .12s, border-color .12s;
    font-family: var(--font-body);
}
.catalog-pagination__item a:hover {
    background: #f5f6f8;
    border-color: var(--color-navy);
}
.catalog-pagination__item .current,
.catalog-pagination__item span.current {
    background: var(--color-navy);
    color: #fff;
    border-color: var(--color-navy);
}
.catalog-pagination__item .dots {
    background: none;
    border: 0;
    cursor: default;
}

/* ---------- Mobile toggle button ---------- */
.catalog-mobile-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--color-navy);
    color: #fff;
    border: 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 0 16px;
    font-family: var(--font-body);
}
.catalog-mobile-toggle__count:not(:empty) {
    background: #fff;
    color: var(--color-navy);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .catalog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
    .catalog-shell {
        grid-template-columns: 1fr;
        padding: 0 20px;
        gap: 0;
    }
    .catalog-mobile-toggle { display: inline-flex; }

    /* Sidebar becomes a left-side drawer */
    .catalog-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 90vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform .25s;
        display: flex;
        flex-direction: column;
        box-shadow: 4px 0 20px rgba(0,0,0,0.12);
    }
    /* The open drawer and its overlay sit above the fixed site header (z-index 1000). */
    .catalog-sidebar.is-open { transform: translateX(0); z-index: 1002; }
    .catalog-sidebar__close { display: block; }
    .catalog-sidebar__footer { display: block; }
    .catalog-sidebar__body { flex: 1; overflow-y: auto; }

    body.catalog-drawer-open { overflow: hidden; }
    body.catalog-drawer-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(6, 1, 67, 0.4);
        z-index: 1001;
    }
}
@media (max-width: 540px) {
    .catalog-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   BUTTON STATE LOCKS — prevent Elementor's pink/red :focus/:active defaults
   from leaking through every <button> in the catalog UI. Every button class
   below explicitly sets all 5 states (rest, hover, focus, focus-visible, active).
   See session_summary_2026_04_20.md "Button state lock — GLOBAL".
   ========================================================================= */

/* Mobile drawer toggle */
.catalog-mobile-toggle:hover,
.catalog-mobile-toggle:focus,
.catalog-mobile-toggle:focus-visible,
.catalog-mobile-toggle:active {
    background: var(--color-navy) !important;
    color: #fff !important;
    border-color: var(--color-navy) !important;
    outline: none !important;
    box-shadow: none !important;
}
.catalog-mobile-toggle:hover { background: #1a155b !important; }

/* Sidebar drawer close (×) */
.catalog-sidebar__close,
.catalog-sidebar__close:hover,
.catalog-sidebar__close:focus,
.catalog-sidebar__close:focus-visible,
.catalog-sidebar__close:active {
    color: var(--color-navy) !important;
    background: none !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* "Show more" + empty-state "clear all" links */
.catalog-filter__more,
.catalog-filter__more:hover,
.catalog-filter__more:focus,
.catalog-filter__more:focus-visible,
.catalog-filter__more:active,
.catalog-clear-link,
.catalog-clear-link:hover,
.catalog-clear-link:focus,
.catalog-clear-link:focus-visible,
.catalog-clear-link:active {
    color: var(--color-navy) !important;
    background: none !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Active-filter chips */
.catalog-chip,
.catalog-chip:focus,
.catalog-chip:focus-visible,
.catalog-chip:active {
    background: var(--color-navy) !important;
    color: #fff !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}
.catalog-chip:hover { background: #1a155b !important; }

.catalog-chips__clear,
.catalog-chips__clear:hover,
.catalog-chips__clear:focus,
.catalog-chips__clear:focus-visible,
.catalog-chips__clear:active {
    color: var(--color-navy) !important;
    background: none !important;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Sidebar footer "Show results" button (uses .hp-btn--primary which isn't
   in the global lock list — Matt's existing lock only covers --light variants). */
.catalog-sidebar__footer .hp-btn,
.catalog-sidebar__footer .hp-btn:hover,
.catalog-sidebar__footer .hp-btn:focus,
.catalog-sidebar__footer .hp-btn:focus-visible,
.catalog-sidebar__footer .hp-btn:active {
    background: var(--color-navy) !important;
    color: #fff !important;
    border: 1px solid var(--color-navy) !important;
    outline: none !important;
    box-shadow: none !important;
}
.catalog-sidebar__footer .hp-btn:hover { background: #1a155b !important; }

/* Match the /products/ archive bg for visual consistency (override the
   earlier .catalog-section { background: #fff } declaration above). */
.catalog-section { background: #f7f8fa !important; }
