/* ===========================================
   FIXED HEADER - Divi 5 Compatible
   =========================================== */

/* Fixed Header Base */
body:not(.et-fb) #dd-fixed-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999999;
    transition: transform 0.4s ease, background-color 0.4s ease, box-shadow 0.4s ease;
}

/* Admin Bar Offset */
body.admin-bar:not(.et-fb) #dd-fixed-header {
    top: 32px;
}

/* Hide on Scroll Down */
body:not(.et-fb) #dd-fixed-header.dd-header-hidden {
    transform: translateY(-120%);
}

/* Scrolled State Styling */
#dd-fixed-header.dd-header-scrolled {
    background-color: #f9f9f9 !important;
    box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.2);
}

/* Logo Change on Scroll (optional - update URL) */
/*
#dd-fixed-header.dd-header-scrolled .dd-logo img {
    content: url('YOUR-NEW-LOGO-URL');
}
*/

/* Menu Colors on Scroll */
#dd-fixed-header.dd-header-scrolled .et_pb_menu ul li a {
    color: #333 !important;
}

#dd-fixed-header.dd-header-scrolled .et_pb_menu ul li.current-menu-item a {
    color: #333 !important;
}

#dd-fixed-header.dd-header-scrolled .et_pb_menu .sub-menu a {
    color: #333 !important;
}

/* Hamburger Icon Color on Scroll */
#dd-fixed-header.dd-header-scrolled #dd-hamburger .et-pb-icon {
    color: #333 !important;
}


/* ===========================================
   MOBILE MENU SLIDE-IN
   =========================================== */

/* Mobile Menu Container */
body:not(.et-fb) #dd-section {
    position: fixed;
    top: 0;
    right: -110%;
    height: 100vh;
    overflow: auto;
    z-index: 999999;
    transition: right 0.4s cubic-bezier(0.75, 0, 0.25, 1);
}

/* Admin Bar Offset for Mobile Menu */
body.admin-bar:not(.et-fb) #dd-section {
    top: 32px;
    height: calc(100vh - 32px);
}

/* Mobile Menu Open State */
#dd-section.dd-menu-open {
    right: 0 !important;
}

/* Mobile Menu Inner Styles */
#dd-menu-mobile .mobile_menu_bar {
    display: none;
}

#dd-menu-mobile .et_mobile_menu {
    display: block !important;
    border-top: none;
    box-shadow: none;
    position: relative;
}

#dd-menu-mobile .et_mobile_nav_menu,
#dd-menu-mobile .mobile_nav {
    width: 100%;
}

/* Menu Item Styling */
#dd-menu-mobile ul li a {
    text-align: center;
    border-bottom: none;
    cursor: pointer;
}

#dd-menu-mobile ul li a:hover {
    opacity: 1;
    background-color: transparent;
}

#dd-menu-mobile ul li.menu-item-has-children > a {
    background-color: transparent;
}

/* Submenu Alignment (when subitems exist) */
#dd-menu-mobile.dd-has-submenu ul li a {
    text-align: left;
}

/* Submenu Toggle */
#dd-menu-mobile .mobile_nav li ul.dd-submenu-hidden {
    display: none !important;
}

#dd-menu-mobile .mobile_nav .menu-item-has-children {
    position: relative;
}

/* Submenu Toggle Icon */
#dd-menu-mobile .mobile_nav .menu-item-has-children > a + span {
    position: absolute;
    right: 0;
    top: 0;
    padding: 10px 20px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    z-index: 3;
}

#dd-menu-mobile span.dd-submenu-toggle::before {
    content: "L"; /* ETmodules arrow down */
    display: block;
    color: #333;
    font-size: 16px;
    font-family: ETmodules;
    transition: transform 0.3s ease;
}

#dd-menu-mobile span.dd-submenu-toggle.dd-submenu-open::before {
    content: "K"; /* ETmodules arrow up */
}


/* ===========================================
   SEARCH ICON (optional)
   =========================================== */

.dd-search input.et_pb_searchsubmit {
    background: transparent !important;
    border: none !important;
    padding: 0 20px;
    z-index: 99;
}

.dd-search-icon {
    position: absolute;
    height: 100%;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    padding: 0 17px;
    background-color: #263547;
    border-left: 1px solid transparent;
}

.dd-search-icon::after {
    content: "U"; /* ETmodules search icon */
    font-family: "ETmodules" !important;
    display: block;
    font-size: 17px;
    font-weight: bold;
    color: #fff;
    transform: scaleX(-1);
}
