/* ============================= */
/* 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 > li {
        margin-right: 45px !important;
    }

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

    /* Adjust Mega Triggers to match dropdown spacing behavior */
    .main-header .header-lower .navigation > li.hh-mega-trigger > a {
        padding-right: 14px !important;
        margin-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 !important;
    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 */
}

/* Hide complete functionality on mobile and in sticky header */
.sticky-header .hh-mega-trigger,
.sticky-header .hh-mega-panel {
    display: none !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;
}

/* Hide complete functionality on mobile for now (just safety) */
@media (max-width: 1023px) {
    .hh-mega-panel { display: none !important; }
    .hh-mega-trigger { display: none !important; }
}