/* Header Variables */
:root {
    --header-height: 80px;
    --primary-burgundy: #7A0026;
    --header-bg: #FFFFFF;
    --text-black: #000000;
    --text-grey: #666666;
    --border-light: #E5E5E5;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Reset for Header Components */
.main-header * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main Header */
.main-header {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--header-bg);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    font-family: 'Lato', sans-serif;
}

.header-container {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Left, Center, Right */
    align-items: center;
}

/* Left: Logo */
.header-logo {
    justify-self: start;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-burgundy);
    white-space: nowrap;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-grey);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Center: Desktop Nav */
.desktop-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 30px;
    /* Space between items */
}

.nav-item {
    text-decoration: none;
    color: var(--text-black);
    font-size: 1rem;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-burgundy);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-burgundy);
    transition: width 0.3s ease;
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* Right: Actions */
.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-switch {
    text-decoration: none;
    color: var(--text-black);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    transition: all 0.3s;
}

.lang-switch:hover {
    border-color: var(--primary-burgundy);
    color: var(--primary-burgundy);
}

.btn-login {
    text-decoration: none;
    background-color: var(--primary-burgundy);
    color: #FFFFFF;
    padding: 8px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: #5a001c;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    cursor: pointer;
    justify-self: end;
    /* Align right on mobile */
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-black);
    border-radius: 2px;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: #FFFFFF;
    z-index: 2000;
    padding: 80px 20px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;

    /* CHANGED: Use display: none to prevent ghosting */
    display: none;
    flex-direction: column;
    gap: 20px;
}

.mobile-menu.active {
    right: 0;
    /* CHANGED: Show when active */
    display: flex;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    display: none;
    /* Also hide overlay by default */
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
    display: block;
}

.mobile-nav-item {
    text-decoration: none;
    color: var(--text-black);
    font-size: 1.1rem;
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav-item.active {
    color: var(--primary-burgundy);
    border-bottom-color: var(--primary-burgundy);
}

/* Responsive */
@media (max-width: 992px) {
    .header-container {
        grid-template-columns: 1fr auto;
        /* Logo, Toggle */
        display: flex;
        /* Switch back to flex for mobile simplicity */
        justify-content: space-between;
    }

    .desktop-nav,
    .header-actions {
        display: none !important;
        /* Force hide */
    }

    .mobile-toggle {
        display: flex;
    }
}

/* RTL Support */
html[dir="rtl"] .nav-item::after {
    left: auto;
    right: 0;
}

html[dir="rtl"] .mobile-menu {
    right: auto;
    left: -300px;
    transition: left 0.3s ease;
}

html[dir="rtl"] .mobile-menu.active {
    left: 0;
}