/* header.css - Header and Navigation Styles */

header.main-header {
    min-height: 6.5rem;
    height: auto;
    background: var(--bg-light);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 3.5rem 0 1rem 0;
}

@media (max-width: 768px) {
    header.main-header {
        padding: 1.5rem 0 1rem 0;
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Never line break as per user request */
    padding: 0 clamp(10px, 3vw, 40px);
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.logo img {
    height: clamp(4rem, 8vw, 7rem);
    width: auto;
}

@media (max-width: 768px) {
    .logo img {
        height: 3.5rem;
    }
}

.logo span {
    display: none;
}

/* ----- Priority Navigation ----- */
/*
 * The nav-links flex container holds the primary nav items.
 * JavaScript (nav.js) detects overflow and moves items that don't fit
 * into a burger dropdown one by one. The burger icon always stays visible
 * once the first item is moved.
 */

nav.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden; /* Elements hidden by nav.js won't show */
    /* Move to the right */
    margin-left: auto;
    /* Transition so overflow items shift smoothly */
    transition: gap 0.2s;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.15rem;
    transition: color 0.3s ease;
    display: inline-block;
    flex-shrink: 0; /* Don't let individual items compress */
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* SALE% */
.nav-links a.sale-link {
    color: #8B0000 !important;
}

.nav-links a.sale-link:hover {
    color: #a50000 !important;
}

/* YouTube Icon */
.youtube-icon-img {
    height: 3.5rem;
    width: auto;
    vertical-align: middle;
}

/* Language Switcher & Burger Container */
.header-right-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 4px;
    transition: color 0.2s;
}

.lang-btn:hover, .lang-btn.active {
    color: var(--primary-color);
}

.lang-sep {
    color: #e5e7eb;
    font-size: 0.8rem;
}

/* ----- Burger Button ----- */
.burger {
    display: flex; /* Controlled by wrapper visibility in JS */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    flex-shrink: 0;
    position: relative;
    background: none;
    border: none;
    padding: 4px;
}

.burger span {
    width: 2rem;
    height: 0.25rem;
    background: var(--text-dark);
    border-radius: 4px;
    transition: all 0.3s ease;
    display: block;
}

.nav-links:empty {
    display: none !important;
}

.burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* ----- Overflow Dropdown (populated by JS) ----- */
.nav-overflow-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 10px 0;
    min-width: 200px;
    z-index: 2000;
    flex-direction: column;
}

.nav-overflow-menu.open {
    display: flex;
}

.nav-overflow-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.15rem;
    transition: background 0.15s;
}

.nav-overflow-menu a:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.nav-overflow-menu a.sale-link {
    color: #8B0000 !important;
}

/* YouTube icon inside overflow menu */
.nav-overflow-menu .youtube-nav-link img {
    height: 2.2rem;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* Burger wrapper for positioning */
.burger-wrapper {
    position: relative;
    flex-shrink: 0;
    display: none; /* JS shows this when needed */
}

.burger-wrapper.visible {
    display: block;
}