/* ============================================
   Header & Navigation Styles
   Mobile: 3 stacked rows (unified look)
   Desktop: 2 rows (search in header)
   ============================================ */

/* === Row 1: Site Header Bar === */
.site-header {
    position: relative;
    height: var(--header-height-mobile);
    background: #fff;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
}

.site-header__hamburger {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.site-header__hamburger:hover {
    color: #1a202c;
}

.site-header__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 1;
}

.site-header__logo img {
    height: 32px;
    width: auto;
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.site-header__sign-in {
    display: none;
}

.site-header__cart {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.site-header__cart:hover {
    color: #1a202c;
}

.site-header__cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--brand-orange);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === Desktop Search in Header (hidden on mobile) === */
.site-header__search {
    display: none;
    flex: 1;
    max-width: 600px;
    min-width: 0;
}

.site-header__search-form {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 44px;
    position: relative;
}

.site-header__search-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    flex: 1;
    height: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    background: #fff;
    font-size: 16px;
    font-family: var(--font-family-brand);
    color: var(--brand-text);
    outline: none;
    padding: 0 54px 0 16px;
    min-width: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header__search-input::placeholder {
    color: #a0aec0;
}

.site-header__search-input:focus {
    border-color: var(--brand-green-light);
    box-shadow: inset 0 0 0 1px var(--brand-green-light);
    background-color: #fff;
}

.site-header__search-submit {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-orange, #e07a5f);
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.site-header__search-submit:hover {
    background: #c05621;
}

.site-header__search-submit svg {
    width: 18px;
    height: 18px;
}

/* === Row 2: Mobile Search Bar (hidden on desktop) === */
.header-search-row {
    position: relative;
    background: #fff;
    padding: 4px 12px 8px;
}

.header-search-row__form {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 40px;
    position: relative;
}

.header-search-row__input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    flex: 1;
    height: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    background: #fff;
    font-size: 16px;
    font-family: var(--font-family-brand);
    color: var(--brand-text);
    outline: none;
    padding: 0 50px 0 16px;
    min-width: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search-row__input::placeholder {
    color: #a0aec0;
}

.header-search-row__input:focus {
    border-color: var(--brand-green-light);
    box-shadow: inset 0 0 0 1px var(--brand-green-light);
    background-color: #fff;
}

.header-search-row__submit {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-orange, #e07a5f);
    border: none;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.header-search-row__submit:hover {
    background: #c05621;
}

.header-search-row__submit svg {
    width: 16px;
    height: 16px;
}

/* === Row 3: Category Links === */
.category-pills {
    position: relative;
    background: #fff;
    z-index: 998;
    display: flex;
    align-items: center;
    padding: 6px 12px 10px;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 1px solid #e2e8f0;
}

.category-pills::-webkit-scrollbar {
    display: none;
}

.category-pills__item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 4px 0;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-family-brand);
    color: #4a5568;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}

.category-pills__item:hover {
    color: #1a202c;
}

.category-pills__item--active {
    color: var(--edu-blue-accent);
    font-weight: 600;
}

/* Hide hamburger menu button in category pills (moved to header) */
.category-pills__menu {
    display: none;
}

/* === Navigation Drawer === */
.nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 1100;
    pointer-events: none;
}

.nav-drawer--open {
    pointer-events: auto;
}

.nav-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-drawer--open .nav-drawer__backdrop {
    opacity: 1;
}

.nav-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--drawer-width);
    max-width: 85vw;
    background: #fff;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-drawer--open .nav-drawer__panel {
    transform: translateX(0);
}

.nav-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #5b7d5a;
    color: #fff;
}

.nav-drawer__user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-drawer__user-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-drawer__user-text {
    font-size: 15px;
    font-weight: 600;
}

.nav-drawer__close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.nav-drawer__close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-drawer__content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

/* === Drawer Sections === */
.drawer-section {
    padding: 16px 0 8px;
    border-bottom: 1px solid #e2e8f0;
}

.drawer-section:last-child {
    border-bottom: none;
}

.drawer-section__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    padding: 0 16px 8px;
    margin: 0;
}

.drawer-section__divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0 16px 8px;
}

/* === Drawer Links === */
.drawer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--brand-text);
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.drawer-link:hover {
    background-color: #f7fafc;
}

.drawer-link__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.drawer-link__icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.drawer-link__label {
    font-size: 14px;
}

.drawer-link__arrow {
    color: #a0aec0;
    font-size: 18px;
}

/* === Drawer Submenu === */
.drawer-submenu {
    display: none;
    padding-left: 52px;
}

.drawer-submenu--open {
    display: block;
}

.drawer-submenu__item {
    display: block;
    padding: 10px 16px 10px 0;
    text-decoration: none;
    color: var(--brand-text);
    font-size: 13px;
    transition: color 0.15s ease;
}

.drawer-submenu__item:hover {
    color: var(--edu-blue-accent);
}

/* === See All Toggle === */
.drawer-see-all {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--edu-blue-accent);
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.drawer-see-all:hover {
    opacity: 0.8;
}

/* === Body styles === */
body.has-header {
    /* Header is not fixed, so no padding needed */
}

/* Prevent scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* === Desktop Responsive === */
@media (min-width: 861px) {
    /* Desktop: Full-width header with spaced layout */
    .site-header {
        width: 100%;
        padding: 0 40px;
        box-sizing: border-box;
        gap: 24px;
    }

    /* Logo stays fixed size on left */
    .site-header__logo {
        flex: 0 0 auto;
    }

    /* Search expands to fill middle space */
    .site-header__search {
        display: flex;
        flex: 1;
        max-width: 800px;
        margin: 0 auto;
    }

    /* Actions stay fixed on right */
    .site-header__actions {
        flex: 0 0 auto;
    }

    /* Hide mobile search row on desktop */
    .header-search-row {
        display: none;
    }

    /* Category pills styling for desktop */
    .category-pills {
        width: 100%;
        padding: 8px 40px;
        justify-content: center;
        gap: 20px;
        overflow-x: auto;
        flex-wrap: nowrap;
        box-sizing: border-box;
    }

    /* Drawer panel wider on desktop */
    .nav-drawer__panel {
        width: 380px;
        max-width: 380px;
    }

    .drawer-link {
        padding: 14px 20px;
    }

    .drawer-link__label {
        font-size: 15px;
    }

    .drawer-section__title {
        font-size: 12px;
        padding: 0 20px 10px;
    }

    .drawer-section__divider {
        margin: 0 20px 10px;
    }

    .nav-drawer__header {
        padding: 20px;
    }

    .nav-drawer__user-text {
        font-size: 16px;
    }
}
