/**
 * Header Styles
 *
 * Mobile-first styles for the top utility bar, sticky main header,
 * logo, primary navigation, header actions, and mobile menu.
 */

/* ==========================================================================
   TOP UTILITY BAR
   ========================================================================== */

.top-bar {
    background: linear-gradient(90deg, var(--ocean-deep) 0%, #1A5F82 100%);
    color: var(--white);
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile: hide left links, center shipping message */
.top-bar__left {
    display: none;
    gap: 28px;
}

.top-bar__right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-bar__link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

.top-bar__link:hover {
    color: var(--white);
}

.top-bar__shipping {
    color: var(--ocean-pale);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.top-bar__shipping::before {
    content: "\2726";
    font-size: 8px;
}

/* Mobile: hide Sign In link in top bar */
.top-bar__right .top-bar__link {
    display: none;
}

@media (min-width: 768px) {
    .top-bar {
        padding: 10px 40px;
        justify-content: space-between;
    }

    .top-bar__left {
        display: flex;
    }

    .top-bar__right .top-bar__link {
        display: inline;
    }
}

@media (min-width: 1280px) {
    .top-bar {
        padding: 10px 60px;
    }
}

/* ==========================================================================
   MAIN HEADER
   ========================================================================== */

.site-header {
    background: linear-gradient(180deg, var(--white) 0%, var(--sky-pale) 100%);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-header);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

/* ==========================================================================
   LOGO
   ========================================================================== */

.site-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-decoration: none;
    position: relative;
    padding-left: 40px;
}

.site-logo::before {
    content: "\1F41F";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.site-logo__name {
    font-size: 32px;
    font-weight: 800;
    color: var(--ocean-deep);
    letter-spacing: -1px;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(27, 107, 147, 0.15);
}

.site-logo__tagline {
    font-size: 9px;
    font-weight: 700;
    color: var(--ocean-mid);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 2px;
}

@media (min-width: 768px) {
    .site-logo {
        padding-left: 48px;
    }

    .site-logo::before {
        font-size: 34px;
    }

    .site-logo__name {
        font-size: 44px;
    }

    .site-logo__tagline {
        font-size: 10px;
        letter-spacing: 4px;
        margin-top: 3px;
    }
}

/* ==========================================================================
   PRIMARY NAVIGATION
   ========================================================================== */

/* Mobile: hidden by default, shown as overlay */
.site-header__nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    padding: var(--space-lg) 20px;
    z-index: 99;
}

.site-header__nav.is-open {
    display: block;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
}

.nav-menu li a {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 14px 16px;
    border-radius: 8px;
    transition: all var(--transition-base);
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a {
    color: var(--ocean-deep);
    background: rgba(27, 107, 147, 0.06);
}

/* Desktop: inline nav */
@media (min-width: 1024px) {
    .site-header__nav {
        display: block;
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
    }

    .nav-menu {
        flex-direction: row;
        gap: 4px;
    }

    .nav-menu li a {
        font-size: 13px;
        padding: 12px 20px;
    }
}

/* ==========================================================================
   HEADER ACTIONS (search, cart, hamburger)
   ========================================================================== */

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--sky-light);
    color: var(--ocean-deep);
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    text-decoration: none;
}

.header-icon:hover {
    background: var(--ocean-pale);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 107, 147, 0.2);
    color: var(--ocean-deep);
}

/* Hide search on small mobile */
.header-search-toggle {
    display: none;
}

@media (min-width: 640px) {
    .header-search-toggle {
        display: flex;
    }
}

/* Cart count badge */
.cart-wrapper {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--coral-accent);
    color: var(--white);
    font-size: 10px;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(232, 115, 74, 0.4);
    pointer-events: none;
}

@media (min-width: 768px) {
    .site-header__actions {
        gap: 16px;
    }

    .header-icon {
        width: 44px;
        height: 44px;
    }
}

/* ==========================================================================
   MOBILE MENU TOGGLE
   ========================================================================== */

.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background: var(--sky-light);
}

.hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-dark);
    position: relative;
    transition: background-color var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 2px;
    background-color: var(--text-dark);
    left: 0;
    transition: all var(--transition-smooth);
}

.hamburger::before { top: -7px; }
.hamburger::after  { top: 7px; }

/* Animate to X when open */
.mobile-menu-toggle[aria-expanded="true"] .hamburger {
    background-color: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Desktop: hide hamburger */
@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   SCROLLED STATE
   ========================================================================== */

.site-header.is-scrolled {
    box-shadow: 0 4px 30px rgba(27, 107, 147, 0.12);
}
