/* ================================================================
   navbar.css — Interventional Pain Consultants
   FIXES:
   1. Mega menu hover gap — bridge pseudo-element + JS delay
   2. Bootstrap .nav-link color clash — explicit overrides
   3. Bootstrap .navbar padding clash — !important overrides
   4. style.css old mega classes — scoped resets
   5. Mobile fully responsive
   ================================================================ */

/* ---------- HARD RESET — scoped to our navbar only ---------- */
.ipc-nav-wrapper *,
.ipc-drawer *,
.ipc-overlay {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Kill Bootstrap .nav-link color leak into our links */
.ipc-nav-wrapper .nav-link,
.ipc-nav-wrapper a {
    color: inherit !important;
    text-decoration: none !important;
}

/* Kill Bootstrap .navbar padding that shrinks our pill */
.ipc-navbar.ipc-navbar {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

/* ================================================================
   WRAPPER — fixed pill at top
   ================================================================ */
.ipc-nav-wrapper {
    position: fixed !important;
    top: 14px;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex !important;
    justify-content: center;
    padding: 0 40px;
    pointer-events: none;
}

/* ================================================================
   NAVBAR PILL
   ================================================================ */
.ipc-navbar {
    pointer-events: auto;
    margin-top: 14px;   /* same spacing but correct way */
    width: 100%;
    max-width: 1460px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
   background: rgb(255 255 255 / 43%) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-radius: 70px !important;
    padding: 8px 24px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12) !important;
    transition: background 0.35s, box-shadow 0.35s;
    border: none !important;
}

.ipc-navbar.ipc-scrolled {
    background: rgb(255 255 255 / 43%) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10) !important;
}

/* ================================================================
   LOGO
   ================================================================ */
.ipc-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none !important;
}

.ipc-logo img {
    height: 68px;
    width: auto;
    display: block;
}

/* ================================================================
   DESKTOP NAV LINKS LIST
   ================================================================ */
.ipc-links {
    list-style: none !important;
    display: flex !important;
    align-items: center;
    gap: 2px;
    margin: 0 auto !important;
    padding: 0 !important;
    flex-wrap: nowrap;
}

.ipc-li {
    list-style: none;
    position: relative;
}

/* ---- Each nav link ---- */
.ipc-link,
.ipc-link:link,
.ipc-link:visited {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 7px 10px !important;
    color: #222 !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none !important;
    border-radius: 40px;
    white-space: nowrap;
    transition: color 0.25s, background 0.25s;
    cursor: pointer;
    background: transparent !important;
    border: none;
    line-height: 1.4;
}

.ipc-link:hover,
.ipc-link:focus {
    color: #50BB03 !important;
    background: transparent !important;
    text-decoration: none !important;
}

/* Scrolled state — same (already white bg) */
.ipc-scrolled .ipc-link,
.ipc-scrolled .ipc-link:link,
.ipc-scrolled .ipc-link:visited {
    color: #222 !important;
}

.ipc-scrolled .ipc-link:hover {
    color: #50BB03 !important;
}

/* Chevron */
.ipc-chev {
    width: 10px;
    height: 6px;
    flex-shrink: 0;
    transition: transform 0.25s;
    stroke: currentColor;
}

.ipc-li:hover .ipc-chev {
    transform: rotate(180deg);
}

.ipc-li.ipc-mega-open .ipc-chev {
    transform: rotate(180deg);
}

/* ================================================================
   CTA BUTTONS
   ================================================================ */
.ipc-cta-group {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 10px;
}

.ipc-btn-primary,
.ipc-btn-primary:link,
.ipc-btn-primary:visited {
    background: #50BB03 !important;
    color: #fff !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 800;
    text-decoration: none !important;
    border: 2px solid #50BB03 !important;
    border-radius: 40px !important;
    padding: 8px 16px !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
    display: inline-block !important;
    line-height: 1.4;
}

.ipc-btn-primary:hover {
    background: transparent !important;
    color: #50BB03 !important;
}

.ipc-btn-outline,
.ipc-btn-outline:link,
.ipc-btn-outline:visited {
    background: transparent !important;
    color: #222 !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 800;
    text-decoration: none !important;
    border: 2px solid #aaa !important;
    border-radius: 40px !important;
    padding: 8px 16px !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
    display: inline-block !important;
    line-height: 1.4;
}

.ipc-btn-outline:hover {
    background: #50BB03 !important;
    border-color: #50BB03 !important;
    color: #fff !important;
}

.ipc-scrolled .ipc-btn-outline,
.ipc-scrolled .ipc-btn-outline:link {
    color: #222 !important;
    border-color: #aaa !important;
}

.ipc-scrolled .ipc-btn-outline:hover {
    background: #50BB03 !important;
    border-color: #50BB03 !important;
    color: #fff !important;
}

/* ================================================================
   HAMBURGER (hidden on desktop)
   ================================================================ */
.ipc-hamburger {
    display: none !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent !important;
    border: 2px solid #333 !important;
    border-radius: 50% !important;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 12px;
    transition: border-color 0.25s;
    padding: 0 !important;
}

.ipc-hamburger span {
    display: block;
    width: 16px;
    height: 2px;
    background: #333;
    border-radius: 2px;
    transition: background 0.25s;
}

/* scrolled state same — already white nav */
.ipc-scrolled .ipc-hamburger {
    border-color: #333 !important;
}

.ipc-scrolled .ipc-hamburger span {
    background: #333;
}

/* ================================================================
   STANDARD DROPDOWN — Conditions We Treat, Patient Resources
   ================================================================ */
.ipc-has-drop {
    position: relative;
}

.ipc-drop {
    list-style: none !important;
    position: absolute;
    /*top: calc(100% + 8px);*/
    left: 0;
    min-width: 230px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
    padding: 10px 0 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 10000;
    pointer-events: none;
    max-height: 300px;
    overflow-y: auto;
}

.ipc-drop::-webkit-scrollbar {
    width: 4px;
}

.ipc-drop::-webkit-scrollbar-thumb {
    background: #50BB03;
    border-radius: 4px;
}

/* JS controls open state */
.ipc-has-drop.ipc-drop-open .ipc-drop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.ipc-drop li {
    list-style: none !important;
}

.ipc-drop li a,
.ipc-drop li a:link,
.ipc-drop li a:visited {
    display: block !important;
    padding: 9px 20px !important;
    color: #333 !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background 0.2s, color 0.2s;
    background: transparent !important;
    border: none;
}

.ipc-drop li a:hover {
    background: #50BB03 !important;
    color: #fff !important;
}

/* ================================================================
   MEGA MENU — Conditions
   THE GAP FIX: 
   1. li has padding-bottom = panel top offset (16px)
   2. invisible bridge pseudo-element covers the gap
   3. JS also handles with a close-delay timeout
   ================================================================ */
.ipc-has-mega {
    position: relative !important;   /* 🔥 THIS IS THE REAL FIX */
}

.ipc-mega-panel {
    position: absolute !important;
    /*top: 100% !important;*/
    left: 0 !important;
    transform: translateY(10px) !important;
}

/* Extra padding so mouse travels to panel without gap */
.ipc-has-mega>.ipc-link {
    padding-bottom: 10px !important;
}

/* Bridge: invisible rectangle fills the gap between trigger and panel */
.ipc-has-mega::after {
    content: "";
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 20px;
    /* covers the gap */
    background: transparent;
    pointer-events: auto;
    display: none;
}

.ipc-has-mega.ipc-mega-open::after {
    display: block;
}

/*.ipc-mega-panel {*/
/*    position: fixed;*/
/*    top: 70px !important;*/
    /* JS repositions this dynamically */
/*    left: 40%;*/
/*    transform: translateX(-50%) translateY(8px);*/
/*    width: 540px;*/
/*    background: #fff;*/
/*    border-radius: 16px;*/
/*    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.15);*/
/*    padding: 24px !important;*/
/*    opacity: 0;*/
/*    visibility: hidden;*/
/*    pointer-events: none;*/
/*    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;*/
/*    z-index: 9998;*/
/*}*/

.ipc-mega-panel {
    position: absolute;
    /*top: 0%;*/
    left: 0;
     
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.15);
    padding: 24px !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity 0.22s, transform 0.22s, visibility 0.22s;
    z-index: 9998;
}
.ipc-mega-panel {
    left: 47%;
    transform: translateX(-50%) translateY(8px);
}

/* JS controls mega open state */
.ipc-has-mega.ipc-mega-open .ipc-mega-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.ipc-mega-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Conditions list */
.ipc-mega-list {
    list-style: none !important;
    flex: 1;
    padding: 0 !important;
    margin: 0 !important;
}

.ipc-mi {
    border-bottom: 1px solid #f0f0f0;
    list-style: none !important;
}

.ipc-mi:last-child {
    border-bottom: none;
}

.ipc-mi a,
.ipc-mi a:link,
.ipc-mi a:visited {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 8px !important;
    color: #333 !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
    background: transparent !important;
}

.ipc-mi a:hover {
    color: #50BB03 !important;
    background: rgba(80, 187, 3, 0.06) !important;
}

.ipc-mi.ipc-mi-active a {
    color: #50BB03 !important;
    font-weight: 600;
}

/* Bullet dot */
.ipc-mi-bullet {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.ipc-mi a:hover .ipc-mi-bullet,
.ipc-mi.ipc-mi-active a .ipc-mi-bullet {
    background: #50BB03;
    transform: scale(1.4);
}

/* Body SVG figure */
.ipc-body-wrap {
    width: 150px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ipc-body-svg {
    width: 140px;
    height: auto;
    display: block;
}

/* Dot states */
.ipc-body-svg [id^="dot-"] .ipc-dot-ring,
.ipc-body-svg [id^="dot-"] .ipc-dot-core {
    transition: opacity 0.3s;
}

.ipc-body-svg [id^="dot-"].ipc-dot-active .ipc-dot-ring {
    opacity: 1 !important;
}

.ipc-body-svg [id^="dot-"].ipc-dot-active .ipc-dot-core {
    opacity: 1 !important;
}

/* ================================================================
   MOBILE SPACER
   ================================================================ */
.ipc-spacer {
    height: 0;
    display: block;
}

/* ================================================================
   MOBILE OVERLAY
   ================================================================ */
.ipc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.ipc-overlay.ipc-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ================================================================
   MOBILE DRAWER
   ================================================================ */
.ipc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 92vw;
    height: 100%;
    background: #060A6E;
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ipc-drawer.ipc-open {
    transform: translateX(0);
}

.ipc-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.ipc-drawer-close {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ipc-mob-nav {
    padding: 12px 0 30px;
    flex: 1;
}

.ipc-mob-link,
.ipc-mob-link:link,
.ipc-mob-link:visited {
    display: block !important;
    padding: 13px 24px !important;
    color: #fff !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.2s;
}

.ipc-mob-link:hover {
    color: #50BB03 !important;
}

/* Mobile accordion */
.ipc-acc {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ipc-acc-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 24px !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    outline: none;
}

.ipc-acc-btn:hover {
    color: #50BB03 !important;
}

.ipc-acc-chev {
    transition: transform 0.25s;
    flex-shrink: 0;
    stroke: currentColor;
}

.ipc-acc.ipc-acc-open .ipc-acc-chev {
    transform: rotate(180deg);
}

.ipc-acc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: rgba(255, 255, 255, 0.04);
}

.ipc-acc-body a,
.ipc-acc-body a:link,
.ipc-acc-body a:visited {
    display: block !important;
    padding: 10px 36px !important;
    color: rgba(255, 255, 255, 0.75) !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    text-decoration: none !important;
    transition: color 0.2s;
}

.ipc-acc-body a:hover {
    color: #50BB03 !important;
}

.ipc-mob-cta {
    padding: 22px 20px 10px;
}

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */

/* 1280px — shrink font/padding slightly */
@media (max-width: 1280px) {
    .ipc-link {
        font-size: 12px !important;
        padding: 7px 9px !important;
    }

    .ipc-btn-primary,
    .ipc-btn-outline {
        font-size: 11.5px !important;
        padding: 7px 13px !important;
    }

    .ipc-logo img {
        height: 54px;
    }

    .ipc-navbar {
        padding: 8px 20px !important;
    }
}

/* 991px — switch to mobile layout */
@media (max-width: 991px) {

    /* Wrapper full-width, no pill */
    .ipc-nav-wrapper {
        top: 0 !important;
        padding: 0 !important;
        align-items: stretch;
    }

    .ipc-btn-outline,
    .ipc-btn-outline:link,
    .ipc-btn-outline:visited {
        color: #fff !important;
    }

    /* WHITE mobile bar */
    .ipc-navbar {
        border-radius: 0 !important;
        padding: 10px 18px !important;
        max-width: 100% !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 1) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10) !important;
        justify-content: space-between;
    }

    /* Force hide desktop links and CTAs */
    .ipc-links {
        display: none !important;
    }

    .ipc-cta-group {
        display: none !important;
    }

    /* Show hamburger — dark on white bg */
    .ipc-hamburger {
        display: flex !important;
    }

    /* Spacer for fixed nav */
    .ipc-spacer {
        height: 72px;
    }

    .ipc-logo img {
        height: 50px;
    }

    /* Never show mega panel on mobile */
    .ipc-mega-panel {
        display: none !important;
    }
}

/* 480px — narrow drawer */
@media (max-width: 480px) {
    .ipc-drawer {
        width: 290px;
    }

    .ipc-spacer {
        height: 64px;
    }

    .ipc-btn-outline,
    .ipc-btn-outline:link,
    .ipc-btn-outline:visited {
        color: #fff !important;
    }

}

/* ================================================================
   CONFLICT NEUTRALIZERS
   Bootstrap and style.css clash overrides — scoped safely
   ================================================================ */

/* Bootstrap .navbar adds padding that breaks pill shape */
nav.ipc-navbar {
    padding: 10px 28px !important;
}

/* Bootstrap .nav-link sets color:rgba(0,0,0,.55) — kill it */
.ipc-nav-wrapper .ipc-link {
    color: #222 !important;
}

.ipc-navbar.ipc-scrolled .ipc-link {
    color: #222 !important;
}

/* Bootstrap dropdown-menu bleeds into our .ipc-drop — reset */
.ipc-drop.ipc-drop {
    border: none !important;
    margin: 0 !important;
    font-size: 14px !important;
}

.ipc-mob-cta .ipc-btn-outline,
.ipc-mob-cta .ipc-btn-outline:link,
.ipc-mob-cta .ipc-btn-outline:visited {
    color: #fff !important;
    border-color: rgba(255,255,255,0.6) !important;
}

/* ================= GAP FINAL FIX ================= */

/* Ensure parent anchor */
.ipc-has-mega {
    position: relative !important;
}

/* 🔥 FORCE ATTACH DROPDOWN */
.ipc-mega-panel {
    position: absolute !important;
    top: 100% !important;   /* main fix */
    left: 50% !important;
    transform: translateX(-50%) !important; /* remove Y gap */
    margin-top: 0 !important;
}

/* 🔥 REMOVE GAP FROM OLD TRANSFORM */
.ipc-has-mega.ipc-mega-open .ipc-mega-panel {
    transform: translateX(-50%) !important;
}

/* 🔥 HOVER BRIDGE FIX (already hai but strong kar dete hain) */
.ipc-has-mega::after {
    content: "";
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 20px;
    pointer-events: auto;
}

/* OPTIONAL: smooth feel without gap */
.ipc-mega-panel {
    transition: opacity 0.2s ease, visibility 0.2s ease;
}


/******************************************/

/* ================= FINAL HARD FIX (NO GAP) ================= */

/* 1. Wrapper fix */
.ipc-nav-wrapper {
    top: 0 !important;
}

/* 2. Navbar spacing maintain */
.ipc-navbar {
    margin-top: 14px !important;
}

/* 3. MEGA MENU — FORCE PERFECT ALIGN */
.ipc-mega-panel {
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;

    /* 🔥 MOST IMPORTANT: REMOVE ALL Y SHIFT */
    transform: translateX(-50%) !important;

    margin-top: 0 !important;
}

/* 4. OPEN STATE — NO MOVEMENT */
.ipc-has-mega.ipc-mega-open .ipc-mega-panel {
    transform: translateX(-50%) !important;
}

/* 5. REMOVE GAP FROM LINK */
.ipc-has-mega > .ipc-link {
    padding-bottom: 2px !important;
}

/* 6. STRONG HOVER BRIDGE */
.ipc-has-mega::after {
    content: "";
    position: absolute;
    top: 100%;
    left: -30px;
    right: -30px;
    height: 25px;
    pointer-events: auto;
}