/* =============================================
   Public Header – Clean Flex Layout
   Overrides theme float-based layout so logo and
   nav sit side-by-side on the same line.
   ============================================= */

/* Force the inner container to flex so logo + nav align */
.site-header .main-bar .container-fluid {
    display: flex !important;
    align-items: center;
    flex-wrap: nowrap;
}

/* Logo – don't let it float or grow */
.site-header .logo-header {
    flex-shrink: 0;
    float: none !important;
}

/* Nav fills the remaining space, content aligned right */
.site-header .header-nav {
    flex: 1;
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
}

.site-header .header-nav .nav.navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    float: none !important;
    gap: 2px;
}

.site-header .header-nav .nav.navbar-nav > li {
    margin: 0;
    border-bottom: none;
}

.site-header .header-nav .nav.navbar-nav > li > a {
    color: var(--title, #000);
    font-size: 15px;
    font-weight: 500;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    line-height: 1.4;
}

.site-header .header-nav .nav.navbar-nav > li > a:hover {
    background: rgba(0,0,0,0.05);
    color: var(--secondary);
}

/* Chevron icon in dropdown triggers */
.site-header .header-nav .nav.navbar-nav > li.has-mega-menu > a i,
.site-header .header-nav .nav.navbar-nav > li.sub-menu-down > a i {
    font-size: 10px;
    margin: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
    background: none;
    width: auto;
    height: auto;
    color: inherit;
    float: none;
}
.site-header .header-nav .nav.navbar-nav > li:hover > a i {
    opacity: 1;
}

/* ---- Dropdown / Mega menu ---- */
.site-header .header-nav .nav.navbar-nav > li.has-mega-menu {
    position: relative;
}

.site-header .header-nav .nav.navbar-nav > li .mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    padding: 16px 24px;
    display: none;
    opacity: 1;
    visibility: visible;
    margin-top: 0;
    z-index: 10000;
    min-width: 220px;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.site-header .header-nav .nav.navbar-nav > li:hover .mega-menu {
    display: block;
}
.site-header .mega-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.site-header .mega-menu ul li a {
    color: #333;
    padding: 8px 0;
    display: block;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.site-header .mega-menu ul li a:hover {
    color: var(--secondary);
}

/* ---- Hamburger button (mobile only) ---- */
.menu-toggle {
    display: none;
    border: none;
    background: transparent;
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
    flex-shrink: 0;
    margin-left: auto;
    position: static;
    transform: none;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #000;
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* ---- Mobile (≤991px) ---- */
@media (max-width: 991px) {
    .menu-toggle {
        display: block;
    }

    .site-header .header-nav {
        position: fixed;
        top: 0;
        left: -300px;
        width: 280px;
        height: 100vh !important;
        background: #fff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        z-index: 99999;
        overflow-y: auto;
        padding: 80px 0 30px;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transition: left 0.35s ease;
    }
    .site-header .header-nav.open,
    .site-header .header-nav.show {
        left: 0;
    }

    .site-header .header-nav .nav.navbar-nav {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .site-header .header-nav .nav.navbar-nav > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .site-header .header-nav .nav.navbar-nav > li > a {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 0;
    }
    .site-header .header-nav .nav.navbar-nav > li > a:hover {
        background: #f8f8f8;
    }

    /* Mobile dropdown */
    .site-header .header-nav .nav.navbar-nav > li .mega-menu {
        position: static;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: #f9f9f9;
        padding: 8px 20px 8px 30px;
        display: none !important;
    }
    .site-header .header-nav .nav.navbar-nav > li.custom-open .mega-menu {
        display: block !important;
    }

    /* Override theme hover on mobile */
    .site-header .header-nav .nav.navbar-nav > li:hover .mega-menu {
        display: none !important;
    }
    .site-header .header-nav .nav.navbar-nav > li.custom-open:hover .mega-menu {
        display: block !important;
    }

    /* Mobile chevron */
    .site-header .header-nav .nav.navbar-nav > li.has-mega-menu > a i,
    .site-header .header-nav .nav.navbar-nav > li.sub-menu-down > a i {
        margin-left: auto;
        font-size: 11px;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--secondary);
        color: #fff;
        border-radius: 4px;
        opacity: 1;
    }
}

/* ---- Smaller desktops ---- */
@media (max-width: 1280px) and (min-width: 992px) {
    .site-header .header-nav .nav.navbar-nav > li > a {
        font-size: 13px;
        padding: 10px 10px;
    }
}

@media (max-width: 1100px) and (min-width: 992px) {
    .site-header .header-nav .nav.navbar-nav > li > a {
        font-size: 12px;
        padding: 10px 7px;
    }
}