/* header-custom.css - Dark theme header + nav styles */

/* ---------- Base / layout ---------- */
#header,
.site-header {
    background: #1a1a1a; /* dark background */
    border-bottom: 2px solid #c20e1a; /* red bottom border */
    position: relative;
    z-index: 1200;
    font-family: "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

    /* Header container */
    .header-container,
    #header > div {
        max-width: 100%;
        width: 100%;
        margin: 0;
        padding: 0px 2%; /* Compact default padding */
        display: flex;
        align-items: center; /* This centers both logo and nav vertically */
        justify-content: space-between;
        gap: 15px; /* Reduced gap */
        box-sizing: border-box;
        flex-direction: row-reverse; /* This puts logo first visually since nav comes first in HTML */
        min-height: 70px; /* Consistent header height */
    }

        /* ---------- Logo Styles ---------- */
        .site-logo,
        #header > div > a[data-image-width] {
            display: flex; /* Changed to flex for better alignment */
            align-items: center; /* Center the image vertically within logo container */
            width: 160px;
            flex: 0 0 160px;
            max-height: 56px;
            overflow: hidden;
            margin: 0; /* Remove all margins */
        }

            .site-logo-img,
            #header > div > a[data-image-width] img {
                width: 100%;
                height: auto;
                display: block;
                object-fit: contain;
            }

/* ---------- Navigation (desktop) ---------- */
.site-nav,
nav[role="navigation"] {
    display: flex;
    align-items: center; /* Ensure nav is vertically centered */
    gap: 20px; /* Reduced gap */
    position: relative;
    margin: 0; /* Remove all margins */
    padding: 0; /* Remove all padding */
    flex: 1; /* Take available space */
    justify-content: flex-end; /* Push nav items to the right */
    height: 100%; /* Take full height of header container */
}

    /* The hamburger wrapper - hidden on desktop */
    .nav-hamburger,
    nav[role="navigation"] > .menu-collapse {
        display: none;
    }

    /* Desktop menu container */
    .nav-desktop,
    nav[role="navigation"] > div:nth-of-type(2) {
        display: flex;
        align-items: center; /* Vertically center nav items */
        gap: 8px;
        height: 100%; /* Take full height */
    }

        /* Navigation list */
        .nav-list,
        nav[role="navigation"] > div:nth-of-type(2) ul {
            display: flex;
            align-items: center; /* Center nav items vertically */
            margin: 0;
            padding: 0;
            list-style: none;
            gap: 15px; /* Further reduced gap between nav items */
            height: 100%; /* Take full height */
        }

/* Navigation items */
.nav-item {
    position: relative;
    display: flex; /* Make nav items flex containers */
    align-items: center; /* Center content vertically */
}

/* Top-level menu links */
.nav-link,
nav[role="navigation"] > div:nth-of-type(2) ul li a,
nav[role="navigation"] > div:nth-of-type(3) ul li a {
    display: inline-flex; /* Changed to inline-flex for better alignment */
    align-items: center; /* Center text vertically within the link */
    height: 60px; /* Match header height */
    padding: 0 16px; /* Horizontal padding only */
    color: #ffffff;
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
    /*    font-family: AvenirLTStd-Black;*/
    font-family: 'Open Sans',sans-serif;
    border-radius: 4px;
    transition: all .2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1; /* Consistent line height for better alignment */
    position: relative; /* for underline indicator */
}

    /* First nav link (Locations) highlighted in red */
    /*.nav-item:first-child .nav-link,
nav[role="navigation"] > div:nth-of-type(2) ul li:first-child a {
    color: #c20e1a;
}*/

    /* Hover states */
    .nav-link:hover,
    .nav-link:focus,
    nav[role="navigation"] > div:nth-of-type(2) ul li a:hover,
    nav[role="navigation"] > div:nth-of-type(2) ul li a:focus {
        color: #c20e1a;
        background: rgba(194, 14, 26, 0.1);
        outline: none;
    }

    /* Active/hover underline indicator */
    .nav-link::after,
    nav[role="navigation"] > div:nth-of-type(2) ul li a::after {
        content: "";
        position: absolute;
        left: 8px;
        right: 8px;
        bottom: 10px;
        height: 3px;
        background: #c20e1a;
        border-radius: 2px;
        opacity: 0;
        transform: translateY(3px);
        transition: opacity .2s ease, transform .2s ease;
    }

    .nav-link:hover::after,
    .nav-link:focus::after,
    .nav-item.active > .nav-link::after,
    .nav-link.active::after,
    nav[role="navigation"] > div:nth-of-type(2) ul li.active > a::after {
        opacity: 1;
        transform: translateY(0);
    }

/* ---------- Dropdown Styles - Horizontal Layout ---------- */
/* ---------- Dropdown Styles - Full Width Layout ---------- */
/* ---------- Dropdown Styles - Full Width Layout ---------- */
.dropdown,
.nav-item.dropdown,
nav[role="navigation"] > div:nth-of-type(2) ul li.dropdown {
    position: static; /* Changed from relative to static */
}

/*.dropdown-menu {
    position: fixed;*/ /* Changed from absolute to fixed for true full width */
/*top: 72px;*/ /* Adjust based on your header height - should match header + border */
/*left: 0;*/ /* Start from absolute left edge */
/*right: 0;*/ /* Extend to absolute right edge */
/*width: 100vw;*/ /* Full viewport width */
/*margin: 0;*/ /* Remove all margins */
/*background-color: #000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 3px solid #c20e1a;
    box-sizing: border-box;*/ /* Ensure padding doesn't affect width */
/*}*/
.menu-dropdown {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100vw;
    margin: 0;
    background-color: #000;
    height: 60px;
    border-top: 3px solid #c20e1a;
    box-sizing: border-box;
    /* start hidden */
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.dropdown:hover .menu-dropdown,
.nav-item.dropdown:hover > .menu-dropdown,
.nav-item.dropdown:focus-within > .menu-dropdown {
    display: flex; /* show only when active */
    opacity: 1;
    visibility: visible;
}



.dropdown:hover .menu-dropdown,
.nav-item.dropdown:hover > .menu-dropdown,
.nav-item.dropdown:focus-within > .menu-dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    width: 100%;
    height: 100%;
    max-width: none; /* Remove max-width constraint */
    margin: 0;
    padding: 0 20px; /* Add some padding for content spacing */
    box-sizing: border-box;
}

    .dropdown-menu a,
    .dropdown-menu-inner a {
        color: #ffffff;
        text-decoration: none;
        font-size: 13px;
        font-weight: 500;
        padding: 15px 12px;
        transition: color 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 1px;
        white-space: nowrap;
        min-width: 50px;
        text-align: center;
    }

        .dropdown-menu a:hover,
        .dropdown-menu-inner a:hover {
            color: #c20e1a;
        }

/* Ensure the parent nav item maintains hover state */
.dropdown:hover > a,
.nav-item.dropdown:hover > .nav-link {
    color: #c20e1a !important;
    background-color: rgba(0, 0, 0, 0.1);
}

/* ---------- Hamburger Menu ---------- */
.hamburger-toggle,
.menu-collapse a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    color: #ffffff;
    border-radius: 6px;
}

    .hamburger-toggle:hover,
    .hamburger-toggle:focus,
    .menu-collapse a:hover,
    .menu-collapse a:focus {
        background: rgba(255, 255, 255, 0.1);
        outline: none;
    }

    .hamburger-toggle svg,
    .menu-collapse svg {
        width: 22px;
        height: 22px;
        display: block;
        fill: #ffffff;
    }

/* ---------- Mobile Panel ---------- */
.nav-mobile-panel,
nav[role="navigation"] > div:nth-of-type(3) {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
}

    .mobile-panel-backdrop,
    nav[role="navigation"] > div:nth-of-type(3) .mobile-panel-backdrop {
        background: rgba(0, 0, 0, 0.95);
        height: 100%;
        padding: 18px;
        box-sizing: border-box;
    }

.mobile-panel-inner {
    max-width: 320px;
    width: 100%;
    background: transparent;
    position: relative;
}

.mobile-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    padding: 6px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 10px;
}

.mobile-nav-list,
nav[role="navigation"] > div:nth-of-type(3) ul {
    list-style: none;
    padding: 20px 10px;
    margin: 0;
}

    .mobile-nav-link,
    nav[role="navigation"] > div:nth-of-type(3) ul li a {
        display: block;
        padding: 15px 12px;
        color: #fff;
        text-decoration: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 16px;
    }

.mobile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    cursor: pointer;
}

/* Show/hide states */
.nav-mobile-panel.open,
nav[role="navigation"] > div:nth-of-type(3).open {
    display: block;
}

/* ---------- Accessibility ---------- */
a:focus {
    outline: 2px solid rgba(194, 14, 26, 0.6);
    outline-offset: 2px;
}

/* ---------- Responsive behavior ---------- */
@media (min-width: 992px) {
    .nav-hamburger,
    nav[role="navigation"] > .menu-collapse {
        display: none;
    }

    .nav-desktop,
    nav[role="navigation"] > div:nth-of-type(2) {
        display: flex;
    }

    .nav-mobile-panel,
    nav[role="navigation"] > div:nth-of-type(3) {
        display: none;
    }
}

@media (max-width: 767px) {
    .nav-hamburger,
    nav[role="navigation"] > .menu-collapse {
        display: block;
    }

    .nav-desktop,
    nav[role="navigation"] > div:nth-of-type(2) {
        display: none;
    }

    .site-logo,
    #header > div > a[data-image-width] {
        width: 130px;
        flex: 0 0 130px;
    }

    .header-container,
    #header > div {
        padding: 0; /* Compact mobile padding */
        gap: 0;
        justify-content: center; /* Center logo horizontally */
        position: relative; /* For absolute hamburger positioning */
        min-height: 44px; /* reduce header height to match menu-tab */
        flex-direction: row; /* normal order */
    }

    /* Place hamburger at left and vertically center */
    .nav-hamburger,
    nav[role="navigation"] > .menu-collapse {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }

    .hamburger-toggle,
    .menu-collapse a {
        width: 40px; /* match menu-tab size more closely */
        height: 40px; /* match menu-tab size more closely */
        padding: 0;
    }

        .hamburger-toggle svg,
        .menu-collapse svg {
            width: 20px;
            height: 20px;
        }

    /* Keep logo perfectly centered and sized on mobile */
    .site-logo,
    #header > div > a[data-image-width] {
        max-height: 44px;
        display: flex;
        align-items: center;
        margin: 0 auto; /* center horizontally */
        width: 110px;
        flex: 0 0 80px;
        position: relative;
        top: -2px; /* nudge slightly upward without changing header height */
    }

        .site-logo-img,
        #header > div > a[data-image-width] img {
            max-height: 45px; /* larger logo within shorter header */
            width: auto;
        }

    /* Prevent nav from stretching so the logo stays centered */
    .site-nav,
    nav[role="navigation"] {
        flex: 0 0 auto;
    }

    /* Hide dropdown on mobile */
    .dropdown-menu {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .header-container,
    #header > div {
        padding: 12px 16px; /* Tablet padding */
    }

    .dropdown-menu a {
        padding: 12px 8px; /* Further reduced */
        font-size: 12px;
    }

    .dropdown-menu-inner {
        gap: 15px; /* Much tighter spacing on mobile */
    }

    /* On tablets show desktop nav (already handled above) */
}

/* ---------- Clear helper ---------- */
#header .clear {
    display: block;
    height: 0;
    clear: both;
}
