/*
 * All Categories Page - Modern Redesign
 * Mobile-first, dark theme, ADA compliant
 */

@layer pages {

    /* ============================================================
       CSS VARIABLES - Using site tokens
       ============================================================ */
    .ac-page {
        /* RGB versions for use with rgba() */
        --header-green-rgb: 140, 149, 0;
        --btn-yellow-rgb: 237, 173, 1;
        --ac-blue-rgb: 49, 134, 255;
    }

    /* ============================================================
       PAGE LAYOUT
       ============================================================ */
    .ac-page {
        min-height: calc(100vh - 200px);
        background: linear-gradient(180deg, #0a0a0a 0%, #111 100%);
    }

    /* ============================================================
       HERO SECTION
       ============================================================ */
    .ac-hero {
        padding: 40px 16px 16px;
        background:
            radial-gradient(ellipse 60% 50% at 20% 80%, rgba(var(--header-green-rgb), 0.08) 0%, transparent 50%),
            radial-gradient(ellipse 50% 40% at 85% 20%, rgba(var(--ac-blue-rgb), 0.06) 0%, transparent 50%),
            transparent;
    }

    .ac-hero-inner {
        max-width: min(1080px, 100%);
        margin: 0 auto;
        text-align: center;
    }

    .ac-hero h1 {
        font: 700 clamp(28px, 5vw, 42px)/1.2 "Jost", sans-serif;
        color: var(--white);
        margin: 0 0 12px;
    }

    .ac-intro {
        font: 400 16px/1.6 "Jost", sans-serif;
        color: rgba(255, 255, 255, 0.7);
        margin: 0 auto 24px;
        max-width: 600px;
    }

    /* Search Filter */
    .ac-search-wrap {
        position: relative;
        max-width: 400px;
        margin: 0 auto;
    }

    .ac-search-icon {
        position: absolute;
        left: 16px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 16px;
        color: rgba(255, 255, 255, 0.4);
        pointer-events: none;
        z-index: 1;
    }

    .ac-search-input {
        width: 100%;
        height: 50px;
        padding: 0 48px 0 46px;
        font: 400 16px/1 "Jost", sans-serif;
        color: var(--white);
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        outline: none;
        transition: all 0.2s ease;
    }

    .ac-search-input::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }

    .ac-search-input:focus {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(var(--header-green-rgb), 0.5);
    }

    .ac-search-clear {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 8px;
        color: rgba(255, 255, 255, 0.6);
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .ac-search-clear:hover {
        background: rgba(255, 255, 255, 0.15);
        color: var(--white);
    }

    /* ============================================================
       A-Z NAVIGATION
       ============================================================ */
    .ac-az-nav {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 12px 16px;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .ac-az-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        max-width: 580px; /* Narrower to force 2-row wrapping */
        margin: 0 auto;
    }

    .ac-az-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font: 600 14px/1 "Jost", sans-serif;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        background: rgba(255, 255, 255, 0.16);
        border-radius: 6px;
        transition: all 0.15s ease;
    }

    .ac-az-link:hover,
    .ac-az-link:focus-visible {
        color: var(--white);
        background: rgba(var(--header-green-rgb), 0.25);
        text-decoration: none;
    }

    .ac-az-link:focus-visible {
        outline: 2px solid var(--header-green);
        outline-offset: 2px;
    }

    .ac-az-disabled {
        color: rgba(255, 255, 255, 0.2);
        background: #FFFFFF10;
        cursor: default;
    }

    .ac-az-disabled:hover {
        color: rgba(255, 255, 255, 0.2);
        background: transparent;
    }

    /* ============================================================
       CATEGORIES GRID
       ============================================================ */
    .ac-categories {
        padding: 30px 16px 40px;
    }

    .ac-categories-inner {
        max-width: min(1080px, 100%);
        margin: 0 auto;
    }

    .ac-letter-group {
        margin-bottom: 30px;
        scroll-margin-top: 70px; /* Account for sticky nav */
    }

    .ac-letter-heading {
        font: 700 32px/1 "Jost", sans-serif;
        color: var(--header-green);
        margin: 0 0 16px;
        padding-bottom: 10px;
        border-bottom: 2px solid rgba(var(--header-green-rgb), 0.3);
    }

    .ac-category-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .ac-category-item {
        margin: 0;
    }

    .ac-category-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        font: 400 15px/1.3 "Jost", sans-serif;
        color: rgba(255, 255, 255, 0.85);
        text-decoration: none;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 8px;
        transition: all 0.15s ease;
    }

    .ac-category-link:hover,
    .ac-category-link:focus-visible {
        color: var(--white);
        background: rgba(var(--header-green-rgb), 0.12);
        border-color: rgba(var(--header-green-rgb), 0.3);
        text-decoration: none;
    }

    .ac-category-link:focus-visible {
        outline: 2px solid var(--header-green);
        outline-offset: 2px;
    }

    .ac-category-arrow {
        font-size: 12px;
        color: rgba(255, 255, 255, 0.3);
        transition: all 0.15s ease;
    }

    .ac-category-link:hover .ac-category-arrow {
        color: var(--header-green);
        transform: translateX(3px);
    }

    /* No Results */
    .ac-no-results {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 60px 20px;
        text-align: center;
    }

    .ac-no-results i {
        font-size: 48px;
        color: rgba(255, 255, 255, 0.2);
        margin-bottom: 16px;
    }

    .ac-no-results p {
        font: 400 18px/1.5 "Jost", sans-serif;
        color: rgba(255, 255, 255, 0.5);
        margin: 0 0 20px;
    }

    /* ============================================================
       BESTSELLERS SECTION
       ============================================================ */
    .ac-bestsellers {
        padding: 50px 16px 60px;
        background:
            radial-gradient(ellipse 70% 50% at 80% 30%, rgba(var(--btn-yellow-rgb), 0.06) 0%, transparent 50%),
            radial-gradient(ellipse 50% 40% at 15% 70%, rgba(var(--ac-blue-rgb), 0.05) 0%, transparent 50%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .ac-bestsellers-inner {
        max-width: min(1080px, 100%);
        margin: 0 auto;
    }

    .ac-bestsellers-heading {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        font: 700 clamp(24px, 4vw, 32px)/1.2 "Jost", sans-serif;
        color: var(--white);
        margin: 0 0 10px;
        text-align: center;
    }

    .ac-bestsellers-heading i {
        color: var(--btn-yellow-bg);
    }

    .ac-bestsellers-intro {
        font: 400 16px/1.6 "Jost", sans-serif;
        color: rgba(255, 255, 255, 0.6);
        margin: 0 0 30px;
        text-align: center;
    }

    /* Style the dynamically generated bestsellers HTML */
    .ac-bestsellers-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ac-bestsellers-grid .allcategories {
        display: block;
        width: 100%;
        float: none;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        padding: 20px;
        transition: all 0.2s ease;
    }

    .ac-bestsellers-grid .allcategories:hover {
        background: rgba(255, 255, 255, 0.10);
        border-color: rgba(255, 255, 255, 0.18);
    }

    .ac-bestsellers-grid .allcategories-list {
        display: block;
        max-width: 100%;
    }

    .ac-bestsellers-grid .allcategories-header {
        margin-bottom: 12px;
    }

    .ac-bestsellers-grid .allcategories-header a {
        text-decoration: none;
    }

    .ac-bestsellers-grid .allcategories-header a:hover {
        text-decoration: none;
    }

    .ac-bestsellers-grid .allcategories-header h3 {
        font: 600 18px/1.3 "Jost", sans-serif;
        color: var(--btn-yellow-bg);
        margin: 0;
        transition: color 0.15s ease;
    }

    .ac-bestsellers-grid .allcategories-header a:hover h3 {
        color: var(--white);
    }

    .ac-bestsellers-grid .allcategories-box {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .ac-bestsellers-grid .allcategories-link {
        display: block;
        font: 400 14px/1.5 "Jost", sans-serif;
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        list-style: none;
        transition: all 0.15s ease;
    }

    .ac-bestsellers-grid .allcategories-link:last-child {
        border-bottom: none;
    }

    .ac-bestsellers-grid .allcategories-link:hover {
        color: var(--white);
        padding-left: 8px;
    }

    /* ============================================================
       RESPONSIVE - TABLET (min-width: 600px)
       ============================================================ */
    @media (min-width: 600px) {
        .ac-categories {
            padding: 40px 24px 50px;
        }

        .ac-category-list {
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }

        .ac-bestsellers-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .ac-az-link {
            min-width: 36px;
            height: 36px;
        }
    }

    /* ============================================================
       RESPONSIVE - DESKTOP (min-width: 900px)
       ============================================================ */
    @media (min-width: 900px) {
        .ac-hero {
            padding: 60px 24px 20px;
        }

        .ac-intro {
            font-size: 17px;
        }

        .ac-az-nav {
            padding: 10px 24px 30px 24px;
        }

        .ac-az-inner {
            gap: 6px;
        }

        .ac-az-link {
            min-width: 38px;
            height: 38px;
            font-size: 15px;
        }

        .ac-categories {
            padding: 20px 24px 60px;
        }

        .ac-letter-group {
            margin-bottom: 40px;
        }

        .ac-letter-heading {
            font-size: 36px;
        }

        .ac-category-list {
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
        }

        .ac-bestsellers {
            padding: 60px 24px 80px;
        }

        .ac-bestsellers-grid {
            grid-template-columns: repeat(3, 1fr);
            gap: 24px;
        }

        .ac-bestsellers-grid .allcategories {
            padding: 24px;
        }
    }

    /* ============================================================
       RESPONSIVE - LARGE DESKTOP (min-width: 1100px)
       ============================================================ */
    @media (min-width: 1100px) {
        .ac-category-list {
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }
    }

} /* end @layer pages */
