/*
===============================================================================
BIG TEXAN D2C - HEADER STYLES
===============================================================================
Styles for the shared site header component.
Loaded on all pages. Component HTML: /components/header.html
===============================================================================
*/

/* --- HEADER CONTAINER --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-header);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base);
}

.site-header.nav-hidden {
    transform: translateY(-100%);
}

/* --- ANNOUNCEMENT BAR --- */
.announcement-bar {
    background: var(--brand-maroon);
    color: white;
    text-align: center;
    padding: 0.35rem 1rem;
    font-size: var(--text-sm);
    letter-spacing: 0.02em;
    font-weight: 600;
}

.announcement-bar a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--texan-yellow);
    text-decoration: underline;
}

/* --- TOP BAR (Logo + Search + Icons) --- */
.top-bar {
    background: #e7d2a7;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.7rem var(--content-padding);
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Logo */
.brand {
    flex-shrink: 0;
}

.brand-logo {
    height: 60px;
    width: auto;
}

/* Search */
.search-wrap {
    flex: 1;
    max-width: 400px;
    position: relative;
    background: #fffaf0;
    border: var(--border-light);
    border-radius: var(--radius-full);
    color: #2a0008;
}

.search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: inherit;
    font-size: var(--text-sm);
}

.search-wrap input:focus {
    outline: 3px solid var(--texan-yellow);
    outline-offset: 3px;
    box-shadow:
        0 0 0 4px rgba(26, 0, 5, 0.65),
        0 0 0 7px rgba(255, 210, 0, 0.35);
}

.search-wrap input::placeholder {
    color: var(--text-muted);
}

/* Header Icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    width: 24px;
    height: 24px;
    color: var(--brand-maroon);
    transition: color var(--transition-fast);
}

.header-icon:hover {
    color: var(--brand-maroon-soft);
}

/* Cart Icon */
.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--brand-maroon);
    cursor: pointer;
}

.cart-icon:hover .header-icon {
    color: var(--brand-maroon-soft);
}

.cart-icon:focus-visible,
.mobile-menu-btn:focus-visible {
    outline: 3px solid var(--texan-yellow);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(81, 0, 11, 0.45);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--brand-maroon);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--brand-cream);
    background: var(--brand-maroon);
    border: 1px solid rgba(81, 0, 11, 0.25);
    border-radius: var(--radius-sm);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 0.35rem 0.65rem;
    line-height: 1;
}

/* --- NAVIGATION BAR --- */
.nav-bar {
    background: var(--brand-maroon);
    color: #fffaf0;
}

.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0 var(--content-padding);
    max-width: var(--max-width);
    margin: 0 auto;
    flex-wrap: nowrap;
    color: #fffaf0;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    color: #fffaf0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.9rem 1rem;
    color: #fffaf0;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--texan-yellow);
}

/* Dropdown Toggle */
.dropdown-toggle {
    background: none;
    border: none;
    color: #fffaf0;
    font-size: 0.8rem;
    min-width: 36px;
    min-height: 44px;
    padding: 0 0.35rem;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.nav-item:hover .dropdown-toggle {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
}

.nav-item:hover .dropdown {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--brand-tan);
    transition: background var(--transition-fast);
}

.dropdown a:last-child {
    border-bottom: none;
}

.dropdown a:hover {
    background: var(--brand-cream);
    color: var(--brand-maroon);
}

/* --- MOBILE RESPONSIVE --- */
@media (max-width: 1024px) {
    .search-wrap {
        display: none;
    }
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .brand-logo {
        height: 45px;
    }

    .nav-bar {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        overflow: visible;
    }

    .nav-bar.open {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .nav-link {
        padding: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .dropdown-toggle {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        display: none;
        background: rgba(0, 0, 0, 0.1);
    }

    .nav-item.open .dropdown {
        display: block;
    }

    .dropdown a {
        padding-left: 2rem;
        color: var(--brand-cream);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .dropdown a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--texan-yellow);
    }
}
