/* =================================================================
   Brand CSS Variables
================================================================ */
:root {
    --pure-white: #ffffff;
    --brand-primary: #0B4F9C;         /* Deep Royal Blue */
    --brand-primary-hover: #083b77;   
    --brand-primary-glow: 0 0 0 0.25rem rgba(11, 79, 156, 0.15);
    --brand-light: #F4F7FC;           
    --brand-warm: #FEF9EB;            
    --brand-dark: #0A192F;            /* Dark Navy */
    --brand-accent: #E5A912;          /* Gold / Amber Yellow */
    --secondary-color: #D61A26;       /* Vibrant Red */
    --primary-color: #0B4F9C;
    --primary-hover: #083b77;
    --accent-color: #D61A26;
    --hover-bg: #f1f5f9;
}

/* Global viewport boundary protection */
html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

html, body {
    width: 100%;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    /* NOTE: Remove overflow-x: hidden here if it breaks sticky behavior, 
       or ensure wrapper containers handle it instead */
}

/* =================================================================
   Header Base Styling & Sticky Scroll Animation
================================================================ */
/* Updated Sticky Header Styling */
.site-header {
    background-color: var(--pure-white);
    z-index: 1040;
    width: 100%;
    max-width: 100vw;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled state */
.site-header.scrolled {
    
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--pure-white);
    z-index: 1040;
    width: 100%;
    max-width: 100vw;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    /* Force GPU acceleration layer to prevent mobile rendering glitches */
    will-change: transform;
    transform: translateZ(0);


    box-shadow: 0 6px 20px rgba(11, 79, 156, 0.12);
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes slideDownHeader {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =================================================================
   Mega Navigation Bar (Desktop)
================================================================ */
.mega-navigation {
    position: relative;
    background-color: var(--brand-primary) !important;
    width: 100%;
    transition: background-color 0.3s ease;
}

.dropdown-parent {
    position: static;
}

.mega-dropdown-menu,
.simple-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--pure-white);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease-in-out;
    z-index: 1050;
    border-top: 3px solid var(--brand-primary) !important;
}

.mega-dropdown-menu { width: 100%; }
.simple-dropdown-menu { min-width: 240px; }
.simple-dropdown-menu li{
    list-style: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.simple-dropdown-menu li:last-child{
    border-bottom: 0;
}

@media (min-width: 992px) {
    .dropdown-parent:hover .mega-dropdown-menu,
    .dropdown-parent:hover .simple-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .simple-dropdown-menu{
        min-width: 480px;
    }

    .simple-dropdown-menu .dropdown-item{
        
    }
}

.mega-navigation .nav-link:not(.btn):hover {
    color: var(--brand-accent) !important;
}

.mega-navigation .nav-link:not(.btn):hover .small-chevron {
    color: var(--brand-accent) !important;
}

.dropdown-item {
    color: var(--brand-dark);
    white-space: wrap;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--brand-primary);
}

.small-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.dropdown-parent:hover .small-chevron {
    transform: rotate(180deg);
}

/* =================================================================
   Independent Mobile Drawer Modal & Overlay (Isolated & Full Screen)
================================================================ */
.mobile-drawer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: rgba(10, 25, 47, 0.65) !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 99998 !important;
    touch-action: none;
}

.mobile-drawer-modal {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 420px !important;
    height: 100vh !important;
    height: 100dvh !important;
    background-color: var(--pure-white) !important;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

/* Body lock states when drawer is open */
body.drawer-open {
    overflow: hidden !important;
    height: 100vh !important;
    position: fixed !important;
    left: 0;
    right: 0;
    width: 100% !important;
}

body.drawer-open .mobile-drawer-overlay {
    opacity: 1;
    visibility: visible;
}

body.drawer-open .mobile-drawer-modal {
    transform: translateX(0);
}

/* Fixed Header Inside Modal */
.drawer-header {
    flex-shrink: 0;
    background-color: var(--pure-white);
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

/* Independent Scrollable Body Container */
.drawer-body {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.mobile-nav-item {
    border-bottom: 1px solid #edf2f7;
    width: 100%;
    box-sizing: border-box;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.5rem;
    color: var(--brand-dark);
    text-decoration: none;
    font-weight: 600;
    word-break: break-word;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    color: var(--brand-primary);
}

/* Sliding Submenu view inside drawer body */
.mobile-submenu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--pure-white);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 5;
    box-sizing: border-box;
}

.mobile-submenu.active {
    transform: translateX(0);
}

/* Prevent Bootstrap container/row horizontal overflow inside mobile drawer */
.mobile-submenu .container,
.mobile-submenu .row,
.mobile-submenu [class*="col-"] {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
}