/* ============================= */
/* DESKTOP (>=1024px) */
/* ============================= */
@media (min-width: 1024px) {

    /* Keep sticky header full-width like the main header */
    .sticky-header .auto-container {
        max-width: 100%;
        padding: 0 50px;
    }

    /* Show desktop menu */
    .sticky-header .navigation {
        display: flex !important;
        justify-content: center;
    }

    .sticky-header .main-menu {
        display: block !important;
    }

    /* Hide hamburger */
    .sticky-header .mobile-nav-toggler {
        display: none !important;
    }

    /* Layout centering */
    .sticky-header .inner-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .sticky-header .logo {
        flex: 0 0 auto;
        margin-right: auto;
    }

    .sticky-header .nav-outer {
        flex: 1 1 auto;
        display: flex;
        justify-content: center;
        transform: translateX(-150px);
    }

    /* Spacing between menu items */
    .sticky-header .navigation>li {
        margin: 0 15px;
        position: relative;
    }

    /* Extra safety: prevent cutoff */
    .sticky-header .navigation>li>ul {
        min-width: 200px;
    }

    /* Main Header Spacing Fix (Exclusive to non-sticky header) */
    .main-header .header-lower .navigation {
        display: flex !important;
        align-items: center;
        gap: 40px !important;
    }

    .main-header .header-lower .navigation>li {
        margin-right: 0 !important;
        float: none !important;
    }

    /* Main Header Solid White Styling - Overriding transparent/absolute behavior */
    .main-header.header-style-one .header-lower {
        background: #ffffff !important;
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }

    /* Change link color to match sticky header text color (#707070) */
    .main-header.header-style-one .navigation>li>a {
        color: #707070 !important;
    }

    /* Hover and current state for main header links */
    .main-header.header-style-one .navigation>li:hover>a,
    .main-header.header-style-one .navigation>li.current>a {
        color: var(--theme-color2) !important;
        /* var(--theme-color2) matches sticky hover */
    }

    /* Adjust Mega Triggers to match dropdown spacing behavior */
    .main-header .header-lower .navigation>li.hh-mega-trigger>a {
        padding-right: 14px !important;
        position: relative;
    }

    .main-header .header-lower .navigation>li.hh-mega-trigger .hh-chevron {
        position: absolute !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin-left: 0 !important;
    }

    /* Fix rotation for absolute chevron */
    .main-header .header-lower .navigation>li.hh-mega-trigger a.hh-mega-active .hh-chevron {
        transform: translateY(-50%) rotate(180deg) !important;
    }
}


/* ============================= */
/* TABLET + MOBILE (<=1023px) */
/* ============================= */
@media (max-width: 1023px) {

    /* Hide desktop auth buttons when mobile menu is active */
    .header-style-one .btn-box {
        display: none !important;
    }

    /* Hide desktop nav at the same breakpoint as the main header */
    .sticky-header .navigation,
    .sticky-header .main-menu {
        display: none !important;
    }

    /* Show hamburger */
    .sticky-header .mobile-nav-toggler {
        display: block !important;
    }

    .sticky-header .auto-container {
        max-width: 100%;
        padding: 0 20px;
    }

    .sticky-header .inner-container {
        justify-content: space-between;
    }

    .sticky-header .nav-outer {
        flex: 0 0 auto;
        justify-content: flex-end;
        transform: none !important;
    }
}


/* ============================================================ */
/* HH MEGA PANEL — Home Visit                                   */
/* Uses !important heavily to prevent template CSS from         */
/* squeezing the items into a congested line                    */
/* ============================================================ */

.hh-mega-panel {
    position: absolute;
    left: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
    border-top: 3px solid var(--theme-color1) !important;
    z-index: 99999 !important;
    /* JS sets top dynamically to match header height */
}

/* Ensure functionality in sticky header */
.sticky-header .hh-mega-trigger {
    display: block !important;
}

/* Flex row explicitly enforced */
.hh-mega-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 15px !important;
    padding: 20px !important;
    width: 100% !important;
}

/* Individual tile enforced as column */
.hh-mega-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 30px 40px !important;
    color: var(--bg-theme-color2) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: var(--title-font) !important;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
    min-width: 160px !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
}

.hh-mega-item:hover,
.hh-mega-item:focus {
    background: #fafafa !important;
    color: var(--theme-color1) !important;
    text-decoration: none !important;
}

/* Icon specifically sized */
.hh-mega-icon {
    font-size: 32px !important;
    line-height: 1 !important;
    color: var(--theme-color1) !important;
    display: block !important;
    margin-bottom: 5px !important;
    transition: transform 0.2s ease !important;
}

.hh-mega-item:hover .hh-mega-icon {
    transform: translateY(-4px) !important;
}

/* Chevron */
.hh-chevron {
    font-size: 10px !important;
    margin-left: 4px !important;
    transition: transform 0.25s ease !important;
}

.hh-mega-trigger a.hh-mega-active .hh-chevron {
    transform: rotate(180deg) !important;
}



/* ============================================================ */
/* PREMIUM MOBILE MENU STYLES                                  */
/* Colour driven by --theme-color1 via brand-colors.css        */
/* ============================================================ */

/* Sidebar background — brand colour with light-to-dark gradient */
.mobile-menu .menu-box {
    background: var(--theme-color1) !important;
    background: linear-gradient(180deg, var(--theme-color1) 0%, color-mix(in srgb, var(--theme-color1) 60%, black) 100%) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glassy backdrop */
.mobile-menu .menu-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.5) !important;
}

/* Upper box / header area - keeping it semi-transparent to show gradient */
.mobile-menu .upper-box {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 25px 20px !important;
}

/* Close button - white for contrast */
.mobile-menu .close-btn {
    color: #ffffff !important;
}

/* Navigation items - white text for red background */
.mobile-menu .navigation li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.mobile-menu .navigation li>a {
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 15px 25px !important;
    letter-spacing: 0.5px;
    font-family: var(--title-font) !important;
}

.mobile-menu .navigation li:hover>a,
.mobile-menu .navigation li.current>a {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* Auth Buttons Styling - White background with red text */
.mobile-menu .mobile-auth-buttons {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu .mobile-auth-buttons .theme-btn {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    color: var(--theme-color1) !important;
    border: 1px solid #ffffff !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu .mobile-auth-buttons .theme-btn:hover {
    background: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Icons and Contact Info - White text */
.mobile-menu .contact-list-one li .contact-info-box {
    color: #ffffff !important;
}

.mobile-menu .contact-list-one li .contact-info-box .title {
    color: rgba(255, 255, 255, 0.7) !important;
}

.mobile-menu .contact-list-one li .contact-info-box .icon {
    color: #ffffff !important;
}

/* Social links box */
.mobile-menu .social-links {
    background: rgba(0, 0, 0, 0.1) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.mobile-menu .mobile-dropdown-btn {
    color: #ffffff !important;
}



/* Hide floating "Nearby" buttons when mobile menu is active to prevent overlap/clicking issues */
body.mobile-menu-visible .nearby-fab,
body.mobile-menu-visible .nearby-nurses-fab {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Ensure the mobile-only dropdown inside Home Visit is strictly hidden on desktop */
@media (min-width: 1024px) {

    .main-header .navigation>li.hh-mega-trigger>ul,
    .sticky-header .navigation>li.hh-mega-trigger>ul,
    .mobile-dropdown-btn {
        display: none !important;
    }
}

/* Mobile dropdown button styling */
@media (max-width: 1023px) {
    .mobile-dropdown-btn {
        position: absolute;
        right: 0px;
        top: 0px;
        width: 44px;
        height: 44px;
        text-align: center;
        font-size: 16px;
        line-height: 44px;
        color: #ffffff;
        cursor: pointer;
        z-index: 5;
    }

    .mobile-dropdown-btn:after {
        content: "";
        position: absolute;
        left: 0px;
        top: 10px;
        width: 1px;
        height: 24px;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mobile-dropdown-btn.active i:before {
        content: "\f106";
        /* angle-up */
    }
}

/* Hide the inline chevron in mobile view to avoid double arrows */
@media (max-width: 1023px) {
    .hh-chevron {
        display: none !important;
    }
}