header {
    font-family: var(--font-khmer);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    background-color: var(--white);
    box-shadow: none; /* No shadow when sitting at the top */
    transition: box-shadow 0.3s ease; /* Smooth shadow animation when moving */
}

/* Casts shadow onto the body when scrolling */
header.scrolled {
    box-shadow: 20px 8px 20px rgba(0, 0, 0, 0.15);
}

/* Thin Green Bottom Line */
.top-bar-green {
    background-color: var(--brand-green-dark);
    height: 3px;
    width: 100%;
    padding: 0;
    margin: 0;
}

.contact-wrap {
    display: none; /* Hidden since the bar is now just a line */
}

.phone-text {
    color: var(--white);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.phone-text i {
    color: #8CC63F;
    transform: scaleX(-1);
}

.btn-call {
    background-color: var(--brand-yellow);
    color: #000;
    padding: 4px 15px;
    text-decoration: none;
    font-size: 13px;
    border-radius: 3px;
    font-weight: normal;
}

.main-nav-white {
    background-color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
}

.custom-logo {
    max-height: 70px;
    width: auto;
}

.mobile-menu-toggle {
    display: none;
}

.nav-menu-wrapper {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 25px;
}

.nav-links-khmer {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links-khmer li {
    position: relative;
}

.nav-links-khmer li a {
    text-decoration: none;
    color: #000;
    font-weight: bold;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 5px;
}

/* Mobile Dropdown Menu Fixes */
.dropdown-menu {
    position: static;
    box-shadow: none;
    border-top: none;
    background-color: #fcfcfc;
    padding-left: 20px;
    display: none; /* Hide it by default */
}

/* 1. Disable the sticky "hover" glitch on mobile */
.nav-links-khmer li:hover .dropdown-menu {
    display: none; 
}

/* 2. Only show the menu when JavaScript adds the 'active' class */
.nav-links-khmer li.active .dropdown-menu {
    display: block;
}

/* =========================================
   Remove Default Bullets from Dropdowns
   ========================================= */
.dropdown-menu,
.dropdown-menu li {
    list-style: none !important;
    list-style-type: none !important;
}

/* =========================================
   Desktop Dropdown Floating Fix
   ========================================= */
@media (min-width: 1101px) {
    /* 1. Anchors the dropdown exactly to the parent word */
    .nav-links-khmer li {
        position: relative !important; 
    }
    
    /* 2. Forces the menu to detach and float in the air */
    .dropdown-menu {
        position: absolute !important; 
        top: 100%;
        left: 0;
        background-color: var(--white);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        padding-left: 0;
        z-index: 999999 !important; /* Floats over the green bar and hero image */
    }

    /* 3. Forces the menu to open on hover */
    .nav-links-khmer li:hover .dropdown-menu {
        display: block !important;
    }
}

/* =========================================
   Force Dropdown Text to 1 Line
   ========================================= */
.dropdown-menu li a {
    white-space: nowrap !important; /* Forbids the text from breaking to a second line */
    min-width: 220px; /* Gives the box a nice comfortable width */
    padding: 12px 20px;
    font-size: 15px;
    font-weight: normal;
}

.dropdown-menu li a:hover {
    background-color: var(--light);
    color: var(--brand-green-dark);
}

.nav-right-khmer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-right-khmer .search-icon {
    color: #000;
    font-size: 20px;
    text-decoration: none;
}

.nav-right-khmer .divider {
    font-size: 20px;
    color: #000;
    margin: 0 5px;
}

.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-selector {
    text-decoration: none;
    color: #000;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    min-width: 100px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 5px 0;
    margin: 0;
    z-index: 1000;
    border-top: 3px solid var(--brand-green-dark);
}

.lang-dropdown:hover .lang-menu {
    display: block;
}

.lang-menu li a {
    padding: 10px 15px;
    text-align: center;
    font-size: 16px;
}

.search-overlay {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    background-color: rgba(15, 122, 65, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease-in-out;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-content {
    width: 80%;
    max-width: 700px;
}

.search-form {
    display: flex;
    width: 100%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.search-field {
    width: 80%;
    padding: 20px;
    font-size: 22px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.search-submit {
    width: 20%;
    padding: 20px;
    font-size: 24px;
    background-color: var(--brand-yellow);
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.close-search {
    position: absolute;
    top: 40px;
    right: 50px;
    font-size: 50px;
    color: var(--white);
    cursor: pointer;
}

@media (max-width: 1100px) {
    .top-bar-green {
        padding: 0; /* Keeps the green bar a thin 3px line on mobile too */
        height: 3px;
    }

    .main-nav-white {
        flex-wrap: wrap;
        padding: 10px 5%;
        position: relative;
    }

    .nav-menu-wrapper {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        padding-top: 0;
        z-index: 1000;
        margin: 0;
    }

    .nav-menu-wrapper.active {
        display: flex;
    }

    .nav-links-khmer {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .nav-links-khmer li {
        width: 100%;
    }

    .nav-links-khmer li a {
        padding: 18px 20px;
        font-weight: normal;
        color: #333;
        font-size: 16px;
        justify-content: space-between;
        border-bottom: 1px solid #f0f0f0;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        background-color: #fcfcfc;
        padding-left: 20px;
    }

    .nav-right-khmer {
        margin-left: auto;
    }

    .nav-right-khmer .search-icon,
    .nav-right-khmer .divider,
    .lang-selector {
        font-size: 16px;
    }

    .mobile-menu-toggle {
        display: block;
        font-size: 24px;
        color: #333;
        cursor: pointer;
        margin-left: 10px;
    }
}
/* =========================================
   CLOSE WHITE GAP BELOW FIXED HEADER
   ========================================= */

/* If logged into WordPress, keep header flush with the Admin Bar */
body.admin-bar header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar header {
        top: 46px;
    }
}

/* Remove extra top margins from the main content containers */
body,
.site-main,
.home-hero {
    margin-top: 0 !important;
}

/* Fallback padding (JavaScript below will auto-adjust this to the exact pixel!) */
#page {
    padding-top: 80px;
}

@media (max-width: 1100px) {
    #page {
        padding-top: 68px;
    }
}
/* =========================================
   HIDE WP ADMIN BAR & CLOSE WHITE GAP
   ========================================= */

/* 1. Hides the black WordPress bar and removes its 32px/46px top space */
#wpadminbar {
    display: none !important;
}

html {
    margin-top: 0 !important;
}

/* 2. Keeps your header locked at the very top (0px) */
body.admin-bar header,
header {
    top: 0 !important;
}

/* 3. Removes extra top margins from the main content containers */
body,
.site-main,
.home-hero {
    margin-top: 0 !important;
}

/* 4. Fallback padding (auto-adjusted by the script in header.php) */
#page {
    padding-top: 80px;
}

@media (max-width: 1100px) {
    #page {
        padding-top: 68px;
    }
}