/* ==========================================================================
   Header and Navigation Styles - Non-Sticky with Solid Background
   ========================================================================== */

/* Header Container */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    padding: 1rem 0;
    z-index: 9999;
    background: transparent;
    transition: all 0.3s ease;
    box-shadow: none;
}

/* Remove gradient overlay since we have solid background */
.site-header::before {
    display: none;
}

/* Header Inner Container */
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

/* When logo is hidden, center the navigation */
.header-container.no-logo {
    justify-content: center;
}

/* ==========================================================================
   Logo / Branding
   ========================================================================== */
.site-branding {
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--blaze-secondary, #0A0F1C);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.site-logo:hover {
    color: var(--blaze-primary);
}

.custom-logo-link img {
    height: 80px;
    width: auto;
}

/* ==========================================================================
   Main Navigation - Clean Style
   ========================================================================== */
.main-navigation {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* When logo is hidden, keep navigation in its original position */
.main-navigation.no-logo {
    justify-content: flex-end;
    flex-grow: 1;
}

/* Navigation Container */
.glassy-nav {
    display: flex;
    align-items: center;
}

.glassy-nav > ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.main-navigation li {
    position: relative;
}

/* Navigation Links */
.main-navigation a {
    color: var(--blaze-secondary, #0A0F1C);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: all 0.3s ease;
    display: inline-block;
    text-transform: capitalize;
}

/* Remove underline hover effect */
.glassy-nav > ul > li:not(:last-child) a::after {
    content: none;
}

.glassy-nav > ul > li:not(:last-child) a:hover {
    color: var(--blaze-primary);
}

/* Contact Button (Last Menu Item) */
.glassy-nav > ul > li:last-child {
    margin-left: 1rem;
}

.glassy-nav > ul > li:last-child a {
    background: #52DDC4;
    color: white !important;
    padding: 0.75rem 2rem;
    border-radius: 1rem;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.glassy-nav > ul > li:last-child a:hover {
    background: #3bc4a8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(82, 221, 196, 0.3);
}

.glassy-nav > ul > li:last-child a::after {
    display: none;
}

/* ==========================================================================
   Mobile Menu Toggle - Enhanced
   ========================================================================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px; /* Increased for better touch target */
    height: 44px; /* Increased for better touch target */
    position: relative;
    padding: 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 10000;
    flex-shrink: 0; /* Prevent shrinking */
}

.menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.05);
}

.menu-toggle:active {
    transform: scale(0.95);
}

.menu-toggle span {
    display: block;
    width: 24px; /* Fixed width for consistency */
    height: 3px;
    background: var(--blaze-secondary);
    margin: 5px auto;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 2px;
    position: relative;
}

/* Enhanced Hamburger Animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    width: 24px;
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    width: 24px;
}

/* ==========================================================================
   Mobile Menu Toggle
   ========================================================================== */
.main-navigation ul ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(10, 15, 28, 0.08);
    padding: 0.75rem 0;
    margin: 12px 0 0 0; /* move dropdown further down */
    list-style: none;
    display: block;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 10000;
}

/* Remove down arrow indicator */
.main-navigation ul li.menu-item-has-children > a::after {
    content: none;
}

.main-navigation ul li:hover > ul.sub-menu,
.main-navigation ul li:focus-within > ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-navigation ul ul.sub-menu li {
    position: relative;
}

.main-navigation ul ul.sub-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: #0A0F1C;
    white-space: nowrap;
}

.main-navigation ul ul.sub-menu .menu-item-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.main-navigation ul ul.sub-menu .menu-item-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.main-navigation ul ul.sub-menu .menu-item-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    border-radius: 12px;
}

.main-navigation ul ul.sub-menu .menu-item-label {
    display: inline-flex;
    align-items: center;
}

.main-navigation ul ul.sub-menu li + li {
    border-top: 1px solid rgba(10, 15, 28, 0.06);
}

.main-navigation ul ul.sub-menu a:hover {
    background: rgba(0,0,0,0.04);
    color: var(--blaze-primary);
}

.main-navigation ul ul.sub-menu a:focus-visible {
    outline: none;
    background: rgba(0,0,0,0.06);
}

/* Nested submenu (third level) */
.main-navigation ul ul ul.sub-menu {
    left: 100%;
    top: 0;
    margin-left: 6px;
}

/* Indicate nested submenu */
.main-navigation ul ul li.menu-item-has-children > a::after {
    content: '\25B8'; /* right-pointing small triangle */
    margin-left: 8px;
    font-size: 0.8em;
}

/* Prevent top-level styles affecting dropdown items */
.main-navigation ul ul.sub-menu li a::after { display: none; }
.main-navigation ul ul.sub-menu li:last-child a {
    background: transparent;
    color: #0A0F1C;
    padding: 0.6rem 1rem;
    border-radius: 0;
    text-transform: none;
    font-size: 0.95rem;
    letter-spacing: normal;
}

/* Ensure dropdown shows over glassy nav */
.glassy-nav { overflow: visible; }

/* Transparent header contrast for dropdowns */
.site-header.transparent-header .main-navigation ul ul.sub-menu {
    background: rgba(255,255,255,0.98);
}

/* Ensure dropdown link color is readable over glassy nav color overrides */
.glassy-nav ul ul.sub-menu a { color: #0A0F1C !important; }

/* Ensure Contact button keeps the same background across header states */
.site-header.transparent-header .glassy-nav > ul > li:last-child a,
.site-header.scrolled .glassy-nav > ul > li:last-child a,
.site-header.dark-header .glassy-nav > ul > li:last-child a {
    background: #52DDC4;
    color: black !important;
}

/* ==========================================================================
   Mobile Navigation - Enhanced
   ========================================================================== */
@media (max-width: 900px) {
    .site-header {
        padding: 1rem 0;
        background: rgba(255, 255, 255, 1);
    }
    
    .header-container {
        padding: 0 1.5rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 60px;
    }
    
    /* Menu toggle button styles moved to mobile-menu.css */
    
    /* ========================================
       OLD MOBILE MENU STYLES - DEPRECATED
       These styles are kept for reference only.
       The new mobile menu is in mobile-menu.css
       ======================================== */
    
    /* Hide glassy-nav on mobile by default */
    .glassy-nav {
        display: none;
    }
    
    /* Main navigation overlay - DISABLED, new menu uses its own overlay */
    .main-navigation {
        display: none !important; /* Completely hide old mobile navigation */
    }
    
    .main-navigation.active {
        background: rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }
    
    /* Mobile menu slide panel */
    .main-navigation .glassy-nav {
        display: block;
        position: relative;
        width: 85%;
        max-width: 380px;
        height: 100vh;
        background: #ffffff;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-navigation.active .glassy-nav {
        transform: translateX(0);
    }
    
    /* Mobile menu wrapper - contains sliding panels */
    .main-navigation .mobile-menu-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: transparent;
    }
    
    /* Main menu panel */
    .main-navigation .mobile-menu-main {
        position: relative;
        width: 100%;
        height: 100%;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 2rem 1.5rem;
        overflow-y: auto;
        background: transparent;
    }
    
    /* Menu list styling */
    .main-navigation .mobile-menu-wrapper ul {
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0;
    }
    
    /* Menu items */
    .main-navigation li {
        width: 100%;
        text-align: left;
        margin: 0.5rem 0;
    }
    
    /* Menu links */
    .main-navigation a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        color: #0A0F1C;
        font-size: 1.1rem;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
        position: relative;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 12px;
        backdrop-filter: blur(10px);
    }
    
    .main-navigation a:hover {
        background: rgba(255, 255, 255, 1);
        transform: translateX(4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Style the contact button with teal on mobile */
    .main-navigation li:last-child {
        margin-top: 1.5rem;
    }
    
    .main-navigation li:last-child a {
        background: #52DDC4;
        color: white !important;
        padding: 1.25rem 1.5rem;
        border-radius: 16px;
        text-align: center;
        font-weight: 600;
        letter-spacing: 0.03em;
        font-size: 1.1rem;
        box-shadow: 0 4px 12px rgba(82, 221, 196, 0.3);
    }
    
    .main-navigation li:last-child a:hover {
        background: #3bc4a8;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(82, 221, 196, 0.4);
    }
    
    /* When showing submenu, slide main menu left */
    .main-navigation.show-submenu .mobile-menu-main {
        transform: translateX(-100%);
    }
    
    /* Sub menu panel - positioned to the right of main menu */
    .mobile-submenu-panel {
        position: absolute;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        background: transparent;
        padding: 2rem 1.5rem;
        display: flex;
        flex-direction: column;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    
    /* Slide in submenu panel when active */
    .main-navigation.show-submenu .mobile-submenu-panel {
        transform: translateX(-100%);
    }
    
    /* Back button for sub menu */
    .mobile-menu-back {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
        margin-bottom: 1.5rem;
        color: #0A0F1C;
        font-size: 0.95rem;
        font-weight: 500;
        background: rgba(255, 255, 255, 0.9);
        border: none;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.2s ease;
        backdrop-filter: blur(10px);
    }
    
    .mobile-menu-back:hover {
        background: rgba(255, 255, 255, 1);
        transform: translateX(-3px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-menu-back svg {
        width: 20px;
        height: 20px;
    }
    
    /* Sub menu title */
    .mobile-submenu-title {
        font-size: 1.4rem;
        font-weight: 600;
        color: white;
        margin-bottom: 1.5rem;
        padding: 1rem 1.25rem;
        background: linear-gradient(135deg, #FF006E, #FF4081);
        border-radius: 12px;
        text-align: center;
    }
    
    /* Sub menu items */
    .mobile-submenu-panel ul {
        list-style: none;
        padding: 0;
        margin: 0;
        flex: 1;
        overflow-y: auto;
    }
    
    .mobile-submenu-panel li {
        margin: 0.5rem 0;
    }
    
    .mobile-submenu-panel a {
        display: block;
        padding: 1rem 1.25rem;
        color: #0A0F1C;
        font-size: 1rem;
        font-weight: 400;
        text-decoration: none;
        transition: all 0.2s ease;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 10px;
        backdrop-filter: blur(10px);
    }
    
    .mobile-submenu-panel a:hover {
        background: rgba(255, 255, 255, 1);
        transform: translateX(4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    /* Hide default sub-menu on mobile */
    @media (max-width: 900px) {
        .main-navigation .sub-menu {
            display: none !important;
        }
    }
    
    /* Add arrow indicator for items with children on mobile */
    @media (max-width: 900px) {
        .main-navigation .menu-item-has-children > a::after {
            content: '';
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            height: 24px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0F1C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
            background-size: 16px 16px;
            background-repeat: no-repeat;
            background-position: center;
            opacity: 0.4;
            transition: all 0.2s ease;
        }
        
        .main-navigation .menu-item-has-children:hover > a::after {
            opacity: 0.7;
            transform: translateY(-50%) translateX(2px);
        }
    }
    

    
    /* Contact button styling - keep it simple like other links */
    
    /* Clean override to ensure proper styling */
    .main-navigation.active a {
        color: #5A3B5D !important;
        font-size: 1.4em !important;
        font-weight: 500 !important;
        font-style: normal !important;
        padding: 12px 0 !important;
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
    }
    
    /* Mobile logo optimization */
    .site-branding {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        height: 60px;
    }
    
    .site-logo {
        font-size: 1.25rem;
        line-height: 1;
        display: flex;
        align-items: center;
    }
    
    .custom-logo-link {
        display: flex;
        align-items: center;
        height: 100%;
    }
    
    .custom-logo-link img {
        height: 80px;
        width: auto;
        max-height: 80px;
        object-fit: contain;
    }
    
    /* Mobile transparent header adjustments */
    .site-header.transparent-header {
        background: rgba(255, 255, 255, 1);
    }
    
    .site-header.transparent-header .site-logo,
    .site-header.transparent-header .menu-toggle span {
        color: var(--blaze-secondary);
        background: var(--blaze-secondary);
    }
    
    /* Ensure mobile menu toggle is always black */
    .menu-toggle span {
        background: var(--blaze-secondary) !important;
    }
    
    /* Don't override mobile menu navigation styles */
    .site-header.transparent-header .main-navigation:not(.active) a {
        color: var(--blaze-secondary);
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* ==========================================================================
   Small Mobile Devices (480px and down)
   ========================================================================== */
@media (max-width: 480px) {
    .site-header {
        padding: 0;
    }
    
    .header-container {
        padding: 0 1rem;
    }
    
    .site-logo {
        font-size: 1.1rem;
    }
    
    .custom-logo-link img {
        height: 60px;
        width: auto;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
    }
    
    .menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 4px auto;
    }
    
    .main-navigation > ul {
        padding: 1.5rem;
    }
    
    .main-navigation a {
        font-size: 1.1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .main-navigation li:last-child a {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* ==========================================================================
   Extra Small Mobile Devices (360px and down)
   ========================================================================== */
@media (max-width: 360px) {
    .header-container {
        padding: 0 0.75rem;
    }
    
    .site-logo {
        font-size: 1rem;
    }
    
    .custom-logo-link img {
        height: 50px;
        width: auto;
    }
    
    .main-navigation > ul {
        padding: 1rem;
    }
    
    .main-navigation a {
        font-size: 1rem;
        padding: 0.75rem 1.25rem;
    }
    
    .main-navigation li:last-child a {
        padding: 0.875rem 1.75rem;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Admin Bar Fix
   ========================================================================== */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}



/* ==========================================================================
   Header Variations
   ========================================================================== */

/* Scrolled Header State */
.site-header.scrolled {
    background: rgba(255, 255, 255, 1);
    padding: 1rem 0;
}

.site-header.scrolled .glassy-nav {
    background: none;
    border: none;
}

.site-header.scrolled .glassy-nav a,
.site-header.scrolled .glassy-nav li {
    color: var(--blaze-secondary) !important;
}

/* Make hamburger black when scrolled */
.site-header.scrolled .menu-toggle span {
    background: var(--blaze-secondary);
}

/* Transparent Header for Hero Sections */
.site-header.transparent-header {
    background: transparent;
    position: fixed;
    width: 100%;
    box-shadow: none;
}

.site-header.transparent-header .site-logo,
.site-header.transparent-header .main-navigation a {
    color: white;
}

/* Force black navigation links on 404 page */
body.error404 .site-header .main-navigation a,
body.error404 .site-header .glassy-nav a,
body.error404 .site-header.transparent-header .main-navigation a,
body.error404 .site-header.transparent-header .site-logo {
    color: #0A0F1C !important;
}

.site-header.transparent-header .main-navigation li:not(:last-child) a:hover {
    color: var(--blaze-primary);
}

.site-header.transparent-header .menu-toggle span {
    background: white;
}



/* Dark Header Option */
.site-header.dark-header {
    background: var(--blaze-secondary);
}

.site-header.dark-header .site-logo,
.site-header.dark-header .main-navigation a {
    color: white;
}

.site-header.dark-header .main-navigation li:not(:last-child) a:hover {
    color: var(--blaze-primary);
}

.site-header.dark-header .menu-toggle span {
    background: white;
}
