/* =========================================================
   V-Heal Services mega menu — design + responsive
========================================================= */

.main-menu ul li.vh-services-mega {
    position: static;
}

.main-menu ul li.vh-services-mega > a.nav-link {
    position: relative;
    z-index: 1210;
}

/* ---------- Desktop / laptop ---------- */
@media (min-width: 992px) {
    header.main-header.ownly-header,
    header.main-header.ownly-header .header-sticky,
    header.main-header.ownly-header .navbar,
    header.main-header.ownly-header .header-container,
    header.main-header.ownly-header .main-menu,
    header.main-header.ownly-header .nav-menu-wrapper,
    header.main-header.ownly-header .navbar-nav {
        overflow: visible !important;
    }

    header.main-header.ownly-header .header-sticky {
        position: relative;
    }

    .main-menu ul li.vh-services-mega > ul.vh-mega-fallback {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: none !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
    }

    .vh-mega-menu {
        position: absolute;
        left: 16px;
        right: 16px;
        top: calc(75% - 2px);
        transform: translateY(10px);
        width: auto;
        max-width: 1140px;
        margin: 0 auto;
        padding: 14px 0 0;
        z-index: 1200;
        visibility: hidden;
        opacity: 0;
        pointer-events: none !important;
        overflow-x: hidden;
        box-sizing: border-box;
        transition:
            opacity 0.28s ease,
            transform 0.28s ease,
            visibility 0s linear 0.28s;
    }

    /* Narrow bridge only under the Services link — not over the whole banner */
    .vh-mega-menu::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        height: 14px;
        pointer-events: none;
    }

    /*
     * Closed state: mega menu must NEVER capture pointer over the banner.
     * (Child buttons previously kept pointer-events:auto and re-opened on banner hover.)
     */
    .main-menu ul li.vh-services-mega > .vh-mega-menu,
    .main-menu ul li.vh-services-mega > .vh-mega-menu * {
        pointer-events: none !important;
    }

    /* Open only while hovering Services (link or the open panel under it) */
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu {
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateY(0);
        pointer-events: auto !important;
        transition:
            opacity 0.28s ease,
            transform 0.28s ease,
            visibility 0s linear 0s;
    }

    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu *,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-item-btn,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-doctors-link,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-panel-cta,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-footer-link {
        pointer-events: auto !important;
    }

    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-item-btn,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-doctors-link,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-panel-cta,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-footer-link {
        cursor: pointer;
    }

    /* Keep inactive doctor panels non-interactive even while open */
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-doctors-panel:not(.is-active),
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-doctors-panel[hidden],
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu .vh-mega-doctors-panel:not(.is-active) * {
        pointer-events: none !important;
    }

    header.main-header.ownly-header .main-menu ul li.vh-services-mega .vh-mega-menu ul,
    .main-menu ul li.vh-services-mega .vh-mega-menu ul {
        position: static !important;
        left: auto !important;
        top: auto !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        transform: none !important;
        list-style: none !important;
    }

    /* Theme hides nested uls — reveal them only while Services mega is open */
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu ul,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu ul li,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu ul li a,
    .main-menu ul li.vh-services-mega:hover > .vh-mega-menu ul li button {
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }

    header.main-header.ownly-header .main-menu ul li.vh-services-mega .vh-mega-menu ul::before {
        display: none !important;
        content: none !important;
    }

    .main-menu ul li.vh-services-mega .vh-mega-menu ul li button.vh-mega-item-btn {
        display: flex !important;
    }

    .main-menu ul li.vh-services-mega .vh-mega-menu a::after,
    .main-menu ul li.vh-services-mega .vh-mega-menu button::after {
        content: none !important;
        display: none !important;
        background: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .vh-mega-panel {
        display: grid;
        grid-template-columns: minmax(0, 220px) minmax(0, 1.2fr) minmax(0, 0.95fr);
        gap: 0;
        width: 100%;
        max-width: 100%;
        background:
            linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
        border: 1px solid rgba(18, 58, 92, 0.1);
        border-radius: 24px;
        box-shadow:
            0 24px 60px rgba(18, 58, 92, 0.16),
            0 2px 0 rgba(255, 255, 255, 0.8) inset;
        overflow: hidden;
        overflow-x: hidden;
        min-height: 380px;
    }

    .vh-mega-col {
        min-width: 0;
        max-width: 100%;
        overflow-x: hidden;
    }

    .vh-mega-primary {
        background:
            linear-gradient(180deg, #eef4fa 0%, #f5f8fb 100%);
        border-right: 1px solid rgba(18, 58, 92, 0.08);
        padding: 18px 14px;
    }

    .vh-mega-more {
        padding: 20px 16px 18px;
        border-right: 1px solid rgba(18, 58, 92, 0.08);
        max-height: min(460px, 72vh);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .vh-mega-doctors {
        position: relative;
        padding: 20px 16px 18px;
        background:
            radial-gradient(circle at top right, rgba(254, 109, 2, 0.08), transparent 42%),
            linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
        max-height: min(460px, 72vh);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        display: flex;
        flex-direction: column;
    }

    .vh-mega-label {
        display: block;
        margin: 0 0 12px;
        padding: 0 10px;
        color: var(--heading-color);
        font-family: var(--accent-font);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
    }

    .vh-mega-list,
    .vh-mega-grid {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .vh-mega-item {
        margin: 0 0 4px;
    }

    .vh-mega-item-btn {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        min-height: 46px;
        padding: 11px 12px !important;
        margin: 0;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: var(--heading-color) !important;
        font-family: var(--accent-font);
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
        text-align: left;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        overflow: hidden;
        transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
    }

    .vh-mega-item-btn > span {
        min-width: 0;
        flex: 1 1 auto;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .vh-mega-item-btn i {
        flex: 0 0 auto;
        font-size: 11px;
        color: rgba(18, 58, 92, 0.3);
        transition: color 0.22s ease, transform 0.22s ease;
    }

    /* Light hover only — doctors change on click, not hover */
    .vh-mega-item-btn:hover {
        background: rgba(255, 255, 255, 0.72);
        color: var(--heading-color) !important;
    }

    .vh-mega-item-btn:focus-visible {
        outline: 2px solid rgba(2, 95, 190, 0.35);
        outline-offset: 2px;
    }

    .vh-mega-item.is-active .vh-mega-item-btn,
    .vh-mega-item-btn.is-active {
        background: #fff;
        color: var(--primary-color) !important;
        outline: none;
        box-shadow:
            0 8px 20px rgba(18, 58, 92, 0.08),
            inset 0 0 0 1px rgba(2, 95, 190, 0.12);
    }

    .vh-mega-item.is-active .vh-mega-item-btn i,
    .vh-mega-item-btn.is-active i {
        color: var(--brand-secondary);
        transform: translateX(2px);
    }

    .vh-mega-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 8px;
        width: 100%;
        max-width: 100%;
    }

    .vh-mega-grid .vh-mega-item-btn {
        min-height: 44px;
        padding: 10px 10px !important;
        font-size: 13.5px;
        font-weight: 500;
        border-radius: 12px;
    }

    .vh-mega-doctors-head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px 12px;
        margin: 0 0 18px;
        width: 100%;
        max-width: 100%;
    }

    .vh-mega-doctors-title {
        margin: 0;
        padding: 2px 0 0;
        min-width: 0;
        flex: 1 1 auto;
        color: var(--heading-color);
        font-family: var(--accent-font);
        font-size: clamp(18px, 1.8vw, 22px);
        font-weight: 700;
        letter-spacing: -0.03em;
        line-height: 1.25;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctors-link {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-height: 34px;
        padding: 7px 14px !important;
        border-radius: 999px;
        background: rgba(254, 109, 2, 0.12) !important;
        color: var(--brand-secondary) !important;
        font-family: var(--accent-font);
        font-size: 12px;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctors-link:hover {
        background: var(--brand-secondary) !important;
        color: #fff !important;
        transform: translateY(-1px);
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctors-panel,
    .main-menu ul li.vh-services-mega .vh-mega-doctors-panel[hidden] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctors-panel.is-active {
        display: flex !important;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 100%;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        animation: vh-mega-fade 0.2s ease;
    }

    @keyframes vh-mega-fade {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .vh-mega-doctor-list {
        list-style: none;
        margin: 0 !important;
        padding: 0 !important;
        display: flex;
        flex-direction: column;
        gap: 12px;
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-card,
    .main-menu ul ul li.vh-mega-doctor-card {
        display: flex !important;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
        max-width: 100%;
        margin: 0 0 2px !important;
        padding: 18px 20px !important;
        border-radius: 16px;
        background: #fff;
        border: 1px solid rgba(18, 58, 92, 0.08);
        box-shadow: 0 10px 24px rgba(18, 58, 92, 0.05);
        overflow: hidden;
        box-sizing: border-box;
        transition: box-shadow 0.2s ease, border-color 0.2s ease;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-card:hover,
    .main-menu ul ul li.vh-mega-doctor-card:hover {
        border-color: rgba(254, 109, 2, 0.28);
        box-shadow: 0 14px 28px rgba(18, 58, 92, 0.1);
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-avatar {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        margin: 2px 0 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: linear-gradient(145deg, rgba(2, 95, 190, 0.12), rgba(254, 109, 2, 0.16));
        color: var(--heading-color);
        font-family: var(--accent-font);
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.02em;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-meta {
        min-width: 0;
        flex: 1 1 auto;
        margin: 0 !important;
        padding: 6px 6px 4px 4px !important;
        overflow: hidden;
        box-sizing: border-box;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-meta strong {
        display: block;
        margin: 0 0 8px !important;
        padding: 0 4px 0 0 !important;
        color: var(--heading-color);
        font-family: var(--accent-font);
        font-size: 15px;
        font-weight: 700;
        line-height: 1.4;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-meta span {
        display: block;
        margin: 0 !important;
        padding: 0 4px 0 0 !important;
        color: var(--text-color);
        font-size: 12.5px;
        line-height: 1.55;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .vh-mega-empty {
        margin: 0 0 16px;
        padding: 16px;
        border-radius: 16px;
        background: rgba(2, 95, 190, 0.05);
        border: 1px dashed rgba(2, 95, 190, 0.18);
        color: var(--text-color);
        font-size: 13.5px;
        line-height: 1.55;
    }

    .main-menu ul li.vh-services-mega .vh-mega-panel-cta {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        max-width: 100%;
        min-height: 46px;
        margin: 18px 0 0;
        padding: 10px 16px !important;
        border-radius: 14px;
        background: var(--brand-secondary) !important;
        color: #fff !important;
        font-family: var(--accent-font);
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 12px 24px rgba(254, 109, 2, 0.24);
        transition: background 0.2s ease, box-shadow 0.2s ease;
        box-sizing: border-box;
    }

    .main-menu ul li.vh-services-mega .vh-mega-panel-cta:hover {
        background: #e05f00 !important;
        color: #fff !important;
        box-shadow: 0 16px 28px rgba(254, 109, 2, 0.3);
    }

    .vh-mega-footer {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px 16px;
        padding: 14px 16px;
        background: #f3f7fb;
        border-top: 1px solid rgba(18, 58, 92, 0.08);
        overflow: hidden;
    }

    .vh-mega-footer p {
        margin: 0;
        color: var(--text-color);
        font-size: 13px;
    }

    .main-menu ul li.vh-services-mega .vh-mega-footer-link {
        color: var(--primary-color) !important;
        font-family: var(--accent-font);
        font-size: 13px;
        font-weight: 700;
        text-decoration: none;
    }

    .main-menu ul li.vh-services-mega .vh-mega-footer-link:hover {
        color: var(--brand-secondary) !important;
    }
}

/* Laptop */
@media (min-width: 992px) and (max-width: 1199px) {
    .vh-mega-menu {
        left: 12px;
        right: 12px;
        max-width: 960px;
    }

    .vh-mega-panel {
        grid-template-columns: minmax(0, 190px) minmax(0, 1.1fr) minmax(0, 0.95fr);
        min-height: 340px;
        border-radius: 20px;
    }

    .vh-mega-primary,
    .vh-mega-more,
    .vh-mega-doctors {
        padding: 14px 12px;
    }

    .vh-mega-doctors-title {
        font-size: 18px;
    }

    .vh-mega-item-btn,
    .vh-mega-grid .vh-mega-item-btn {
        font-size: 13px;
        min-height: 42px;
        padding: 9px 10px !important;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-card,
    .main-menu ul ul li.vh-mega-doctor-card {
        gap: 14px;
        padding: 16px 18px !important;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-avatar {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-meta {
        padding: 4px 4px 2px 2px !important;
    }

    .main-menu ul li.vh-services-mega .vh-mega-doctor-meta strong {
        font-size: 14px;
        margin: 0 0 7px !important;
    }
}

/* Compact desktop / large tablet landscape */
@media (min-width: 992px) and (max-width: 1100px) {
    .vh-mega-panel {
        grid-template-columns: minmax(0, 180px) minmax(0, 1fr) minmax(0, 0.95fr);
    }

    .vh-mega-grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .vh-mega-doctors-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ---------- Tablet / mobile: drawer handled in vh-mobile-fix.css ---------- */
@media (max-width: 991px) {
    .vh-mega-menu {
        display: none !important;
    }

    /* Nested service lists inside the mobile drawer */
    .responsive-menu .slicknav_nav ul {
        margin: 4px 0 10px;
        padding: 6px;
        border-radius: 14px;
        background: #f8fafc;
        border: 1px solid rgba(18, 58, 92, 0.06);
        max-width: 100%;
        overflow-x: hidden;
    }

    .responsive-menu .slicknav_nav ul ul {
        margin: 6px 0 4px 8px;
        padding: 6px;
        border-left: 3px solid rgba(254, 109, 2, 0.35);
        background: #fff;
    }

    .responsive-menu .slicknav_nav ul a {
        font-size: 14px;
        font-weight: 500;
        min-height: 42px;
        padding: 10px 12px !important;
        color: var(--text-color) !important;
    }

    .responsive-menu .slicknav_nav ul ul a {
        font-size: 13.5px;
        font-weight: 600;
        color: var(--heading-color) !important;
        background: transparent;
    }

    .responsive-menu .slicknav_arrow {
        color: var(--brand-secondary);
    }
}

@media (max-width: 575px) {
    .responsive-menu .slicknav_nav ul,
    .responsive-menu .slicknav_nav ul ul {
        padding: 6px;
        border-radius: 12px;
    }
}
