/* ==========================================================================
   HEADER, NAVBAR & NESTED FLYOUT MENU STYLING (NAVY & ORANGE BRANDING)
   ========================================================================== */

/* 1. Top Utility Bar */
.top-header {
    background-color: #000B33 !important;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-header a { 
    color: #FFFFFF !important; 
    text-decoration: none; 
    transition: color 0.3s ease;
}

.top-header a:hover { 
    color: #F27915 !important; 
}

.top-header-info, .top-header-social { 
    display: flex; 
    gap: 20px; 
    align-items: center; 
}

/* 2. Main Sticky Navbar */
.header-nav {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 9999 !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #E2E8F0;
    box-shadow: 0 4px 20px rgba(0, 11, 51, 0.05);
    transition: all 0.3s ease;
}

.header-nav .navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-nav .brand-logo-img {
    height: 92px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.header-nav .brand-logo-img:hover {
    transform: scale(1.02);
}

/* Nav Link Styling */
.nav-link {
    font-weight: 600;
    color: #000B33 !important;
    padding: 18px 14px !important;
    transition: color 0.25s ease;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover, .nav-link.active { 
    color: #F27915 !important; 
}

.nav-link i.main-arrow {
    font-size: 0.72rem;
    transition: transform 0.25s ease;
}

/* Header Proposal CTA */
.btn-luxury-primary.header-proposal-btn {
    padding: 11px 26px !important;
    font-size: 0.92rem !important;
    white-space: nowrap;
    background: linear-gradient(135deg, #F27915 0%, #E06300 100%) !important;
    color: #FFFFFF !important;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(242, 121, 21, 0.32);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.25s ease;
}

.btn-luxury-primary.header-proposal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(242, 121, 21, 0.48);
}

/* ==========================================================================
   DESKTOP FLYOUT SUB-MENU (Screen >= 992px)
   ========================================================================== */
@media (min-width: 992px) {
    .custom-nav-dropdown {
        position: relative;
    }

    /* Primary Level 1 Dropdown Menu */
    .custom-dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        margin: 0 !important;
        padding: 8px 0 !important;
        min-width: 275px;
        background: #FFFFFF !important;
        border: 1px solid #E2E8F0 !important;
        border-radius: 12px !important;
        box-shadow: 0 16px 38px rgba(0, 11, 51, 0.12) !important;
        z-index: 1050;
    }

    /* Invisible hover bridge to prevent menu from closing when moving mouse */
    .custom-dropdown-menu::before {
        content: "";
        position: absolute;
        top: -12px;
        left: 0;
        width: 100%;
        height: 12px;
        background: transparent;
    }

    /* Open Level 1 on hover */
    .custom-nav-dropdown:hover > .custom-dropdown-menu {
        display: block !important;
        animation: navFadeSlide 0.22s ease-out forwards;
    }

    .custom-nav-dropdown:hover > .nav-link i.main-arrow {
        transform: rotate(180deg);
        color: #F27915;
    }

    /* Dropdown Items (Level 1) */
    .custom-dropdown-menu > li {
        position: relative;
        list-style: none;
    }

    .custom-dropdown-menu .dropdown-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 18px;
        color: #000B33;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .custom-dropdown-menu .dropdown-item:hover,
    .custom-dropdown-menu .dropdown-item:focus {
        background-color: #FFF7ED;
        color: #F27915;
        padding-left: 22px;
    }

    .custom-dropdown-menu .dropdown-item i.sub-arrow {
        font-size: 0.72rem;
        color: #94A3B8;
        transition: transform 0.2s ease, color 0.2s ease;
    }

    .custom-dropdown-menu .dropdown-item:hover i.sub-arrow {
        color: #F27915;
        transform: translateX(4px);
    }

    /* Nested Submenu (Level 2 Flyout) */
    .dropdown-submenu {
        position: relative;
    }

    .custom-inner-submenu {
        display: none;
        position: absolute;
        top: -6px;
        left: 100%;
        margin: 0 !important;
        padding: 8px 0 !important;
        min-width: 270px;
        background: #FFFFFF !important;
        border: 1px solid #E2E8F0 !important;
        border-radius: 12px !important;
        box-shadow: 0 18px 40px rgba(0, 11, 51, 0.14) !important;
        z-index: 1060;
    }

    /* Hover bridge between level 1 and level 2 */
    .custom-inner-submenu::before {
        content: "";
        position: absolute;
        top: 0;
        left: -14px;
        width: 14px;
        height: 100%;
        background: transparent;
    }

    /* Open Level 2 on Submenu hover */
    .dropdown-submenu:hover > .custom-inner-submenu {
        display: block !important;
        animation: navFadeSlide 0.22s ease-out forwards;
    }

    .custom-inner-submenu .dropdown-item {
        font-size: 13.5px;
        font-weight: 500;
        color: #334155;
        padding: 8px 18px;
    }

    .custom-inner-submenu .dropdown-item:hover {
        font-weight: 600;
    }
}

@keyframes navFadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   MOBILE ACCORDION DROPDOWN (< 991.98px)
   ========================================================================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: 82vh !important;
        overflow-y: auto !important;
        background: #FFFFFF !important;
        padding: 20px;
        border-radius: 16px;
        margin-top: 12px;
        box-shadow: 0 15px 35px rgba(0, 11, 51, 0.12);
        border: 1px solid #E2E8F0;
    }

    .header-nav .brand-logo-img {
        height: 62px;
        max-width: 190px;
    }

    .nav-link {
        padding: 12px 0 !important;
        border-bottom: 1px solid #F1F5F9;
        justify-content: space-between;
    }

    /* Level 1 Container Mobile */
    .custom-dropdown-menu {
        display: none;
        position: static !important;
        float: none !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: #F8FAFC !important;
        border-radius: 10px !important;
        padding: 6px 0 !important;
        margin-top: 6px !important;
    }

    .custom-nav-dropdown.is-open > .custom-dropdown-menu {
        display: block !important;
    }

    .custom-nav-dropdown.is-open > .nav-link i.main-arrow {
        transform: rotate(180deg);
        color: #F27915;
    }

    .custom-dropdown-menu .dropdown-item {
        padding: 10px 14px;
        font-size: 14px;
        color: #000B33;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-decoration: none;
        white-space: normal;
    }

    /* Level 2 Submenu Container Mobile */
    .custom-inner-submenu {
        display: none;
        position: static !important;
        width: 100% !important;
        background: #FFFFFF !important;
        border: 1px solid #E2E8F0 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        padding: 6px 0 !important;
        margin: 4px 0 8px 10px !important;
    }

    .dropdown-submenu.is-open > .custom-inner-submenu {
        display: block !important;
    }

    .dropdown-submenu.is-open > .dropdown-toggle-sub i.sub-arrow {
        transform: rotate(90deg);
        color: #F27915;
    }

    .custom-inner-submenu .dropdown-item {
        font-size: 13px;
        padding: 7px 14px;
        color: #475569;
    }

    .header-btn-wrapper {
        width: 100%;
        margin-top: 15px !important;
    }

    .btn-luxury-primary.header-proposal-btn {
        width: 100%;
        justify-content: center;
    }
}