/* =====================================================================
   ZEHRA HOSPITAL – NAVBAR + HEADER + TOPBAR (FINAL FIXED)
   File: css/navbar.css
   ===================================================================== */

:root {
    --nav: #a92a2a;
    --r:   #e63946;
    --r2:  #8b1e1e;
    --rd:  #6e1414;
    --txt: #333;
    --muted: #555;
    --line: #eee;
    --bg-soft: #f5f7fa;
}

/* ---------- SCOPED RESET ---------- */
nav *, nav *::before, nav *::after,
.hdr *, .hdr *::before, .hdr *::after,
.top *, .top *::before, .top *::after {
    box-sizing: border-box;
}

nav ul, .top ul, .menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ==================== TOP BAR ==================== */
.top {
    background: #f3f4f6;
    padding: 6px 0;
    border-bottom: 1px solid #e5e7eb;
}
.top .c {
    display: flex;
    justify-content: center;
    padding: 0 16px;
    max-width: 1300px;
    margin: 0 auto;
}
.top ul {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding: 5px 10px;
}
.top a {
    display: inline-block;
    color: var(--muted);
    font-size: 14px;
    text-decoration: none;
    transition: color .2s;
}
.top a:hover { color: var(--r); }

/* ==================== HEADER ==================== */
.hdr { background: #fff; border-bottom: 1px solid #eee; }
.hdr .c {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 20px;
    max-width: 1300px;
    margin: 0 auto;
}
.hdr .logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.hdr .logo img {
    height: 64px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
    display: block;
}
.hdr .hi {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    justify-content: center;
}
.hdr .hi > div { display: flex; align-items: center; gap: 10px; }
.hdr .hi i { font-style: normal; font-size: 22px; color: var(--r); line-height: 1; }
.hdr .hi span { display: flex; flex-direction: column; line-height: 1.25; }
.hdr .hi small { color: #888; font-size: 12px; }
.hdr .hi b { color: #222; font-size: 15px; font-weight: 700; }
.hdr .sr {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 280px;
    width: 100%;
    flex-shrink: 0;
}
.hdr .sr input {
    width: 100%;
    height: 42px;
    border: 1px solid #e3e8ef;
    border-radius: 22px;
    background: var(--bg-soft);
    padding: 0 42px 0 16px;
    font-size: 14px;
    color: var(--txt);
    outline: none;
    transition: all .25s ease;
}
.hdr .sr input:focus {
    background: #fff;
    border-color: #e95f5f;
    box-shadow: 0 0 0 3px rgba(233,95,95,.10);
}
.hdr .sr input::placeholder { color: #9299a3; }
.hdr .sr span {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    pointer-events: none;
    color: #9299a3;
}

/* ==================== NAVIGATION BASE ==================== */
nav[aria-label="Main"] {
    background: var(--nav);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}
nav[aria-label="Main"] .c {
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
}

.nav-logo {
    display: none;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.nav-logo img {
    display: block;
    width: auto;
    height: 42px;
    max-width: 150px;
    object-fit: contain;
}

/* ==================== DESKTOP MENU ==================== */
.menu {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-start; /* Items ko left se start karega */
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
}
.menu > li { 
    position: relative; 
}
.menu > li > a,
.menu > li > button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    background: none;
    border: 0;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    padding: 0 17px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s;
    font-family: inherit;
    letter-spacing: .3px;
}
.menu > li > a:hover,
.menu > li > button:hover,
.menu > li.op > button { background: var(--r2); }
.menu > li.home > a { background: var(--r2); }
.menu > li.home > a:hover { background: var(--rd); }
.menu .right { margin-left: auto; } /* I Want To ko right corner pe bhejega */
.menu .right > button {
    background: var(--r2);
    padding-left: 22px;
    padding-right: 22px;
}
.menu .right > button:hover { background: var(--rd); }

/* ==================== PREMIUM DROPDOWN ==================== */
.dd {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1100;
    background: #fff;
    min-width: 240px;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    padding: 8px 0;
}
.right .dd { 
    left: auto; 
    right: 0; 
}
.dd a {
    display: block;
    padding: 10px 20px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    white-space: normal;
    line-height: 1.5;
    border-bottom: none;
    transition: all .2s;
    font-weight: 500;
}
.dd a:hover { 
    background: #f5f7fa; 
    color: var(--nav); 
    padding-left: 24px; /* Hover par thoda slide hoga */
}
.menu > li:hover > .dd,
.menu > li.op    > .dd { display: block; }

/* ==================== BURGER ==================== */
.burger {
    display: none;
    background: none;
    border: 0;
    color: #fff;
    font-size: 26px;
    padding: 8px 12px;
    cursor: pointer;
    line-height: 1;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.burger .burger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 1;
}

/* =====================================================================
   🔒 DESKTOP LOCK (>=1024px)
   ===================================================================== */
@media screen and (min-width: 1024px) {
    nav[aria-label="Main"] .menu {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        flex: 1 !important;
        align-items: center !important;
        width: auto !important;
        position: static !important;
        background: transparent !important;
        max-height: none !important;
        overflow: visible !important;
    }
    nav[aria-label="Main"] .menu > li { 
        display: block !important; 
        width: auto !important;
    }
    nav[aria-label="Main"] .burger   { display: none !important; }
    nav[aria-label="Main"] .nav-logo { display: none !important; }
}

/* =====================================================================
   🔒 TABLET + MOBILE (<=1023px) — BURGER ACTIVE
   ===================================================================== */
@media screen and (max-width: 1023px) {

    nav[aria-label="Main"] .c {
        display: flex;
        flex-wrap: wrap;
        padding: 0 14px;
        gap: 0;
        align-items: center;
    }
    nav[aria-label="Main"] .burger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        min-height: 48px;
        min-width: 46px;
        flex-shrink: 0;
        font-size: 26px;
        z-index: 10002;
    }

    nav[aria-label="Main"] .menu {
        display: none !important;
        width: 100%;
        flex: 0 0 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        background: var(--nav);
        max-height: calc(100vh - 60px);
        max-height: calc(100dvh - 60px);
        overflow-y: auto;
        overscroll-behavior: contain;
        border-top: 1px solid rgba(255,255,255,.10);
    }
    nav[aria-label="Main"] .menu.open { display: flex !important; }

    nav[aria-label="Main"] .menu > li {
        width: 100% !important;
        position: relative;
        display: block;
        flex: none;
    }
    nav[aria-label="Main"] .menu > li > a,
    nav[aria-label="Main"] .menu > li > button {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        padding: 13px 16px;
        min-height: 46px;
        border-bottom: 1px solid rgba(255,255,255,.10);
        font-size: 14px;
    }
    nav[aria-label="Main"] .menu .right { margin-left: 0; }
    nav[aria-label="Main"] .menu .right > button { padding: 13px 16px; }

    nav[aria-label="Main"] .dd,
    nav[aria-label="Main"] .right .dd {
        display: none;
        position: static;
        width: 100%;
        max-width: none;
        min-width: 0;
        box-shadow: none;
        border-radius: 0;
        background: #fff;
        padding: 0;
    }
    nav[aria-label="Main"] .menu > li:hover > .dd { display: none; }
    nav[aria-label="Main"] .menu > li.op    > .dd { display: block !important; }

    nav[aria-label="Main"] .dd a {
        padding: 12px 16px 12px 32px;
        font-size: 14px;
        border-bottom: 1px solid var(--line);
        background: #fff;
        color: #444;
    }
    nav[aria-label="Main"] .dd a:hover { background: #f5f7fa; color: var(--r); }
}

/* ==================== TABLET ONLY ==================== */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    nav[aria-label="Main"] .c      { padding: 0 20px; }
    nav[aria-label="Main"] .burger { font-size: 28px; }
    nav[aria-label="Main"] .menu > li > a,
    nav[aria-label="Main"] .menu > li > button {
        font-size: 15px;
        padding: 14px 18px;
    }
    nav[aria-label="Main"] .dd a { padding: 12px 20px 12px 36px; }
}

/* ==================== MOBILE ONLY ==================== */
@media screen and (max-width: 767px) {

    nav[aria-label="Main"] {
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 10000;
    }
    nav[aria-label="Main"] .c {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        min-height: 50px;
        gap: 8px;
        position: relative;
    }

    nav[aria-label="Main"] .nav-logo {
        display: none;
        align-items: center;
        flex-shrink: 0;
    }
    body.header-scrolled nav[aria-label="Main"] .nav-logo { display: flex; }
    body.header-scrolled nav[aria-label="Main"] .nav-logo img {
        display: block;
        height: 36px;
        width: auto;
        max-width: 125px;
        object-fit: contain;
    }

    nav[aria-label="Main"] .burger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        flex-shrink: 0;
        font-size: 25px;
        padding: 8px 10px;
        min-height: 46px;
        width: 46px;
        color: #fff;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 10002;
    }

    nav[aria-label="Main"] .menu {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        flex: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        background: var(--nav);
        max-height: calc(100vh - 55px);
        max-height: calc(100dvh - 55px);
        overflow-y: auto;
        overscroll-behavior: contain;
        z-index: 10001;
        margin: 0;
        padding: 0;
        border-top: 1px solid rgba(255,255,255,.10);
    }
    nav[aria-label="Main"] .menu.open { display: flex !important; }

    nav[aria-label="Main"] .menu > li {
        display: block;
        position: relative;
        width: 100%;
        flex: none;
    }
    nav[aria-label="Main"] .menu > li > a,
    nav[aria-label="Main"] .menu > li > button {
        display: flex;
        width: 100%;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        font-size: 14px;
        padding: 13px 14px;
        min-height: 46px;
        box-sizing: border-box;
        color: #fff;
    }
    nav[aria-label="Main"] .menu .right { margin-left: 0; }
    nav[aria-label="Main"] .menu .right > button { padding: 13px 14px; }

    nav[aria-label="Main"] .menu .dd,
    nav[aria-label="Main"] .menu .right .dd {
        display: none;
        position: static;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-shadow: none;
        border-radius: 0;
        background: #fff;
        padding: 0;
    }
    nav[aria-label="Main"] .menu > li:hover > .dd { display: none; }
    nav[aria-label="Main"] .menu > li.op    > .dd { display: block !important; }
    nav[aria-label="Main"] .menu .dd a {
        display: block;
        padding: 12px 14px 12px 30px;
        font-size: 14px;
        color: #444;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }
    nav[aria-label="Main"] .menu .dd a:hover {
        background: #f5f7fa;
        color: var(--nav);
    }

    /* HEADER MOBILE GRID */
    .hdr .c {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 10px 12px !important;
    }
    .hdr .logo {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }
    .hdr .logo img {
        height: 55px !important;
        width: auto !important;
        max-width: 100px !important;
        object-fit: contain !important;
    }
    .hdr .hi { display: none !important; }

    .hdr .sr {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        flex: none !important;
        margin: 0 !important;
    }
    .hdr .sr input {
        width: 100% !important;
        height: 43px !important;
        box-sizing: border-box !important;
        border: 1px solid #e3e8ef !important;
        border-radius: 25px !important;
        background: var(--bg-soft) !important;
        padding: 0 42px 0 15px !important;
        font-size: 14px !important;
        color: var(--txt) !important;
        outline: none !important;
        box-shadow: 0 2px 7px rgba(0,0,0,.04) !important;
    }
    .hdr .sr input:focus {
        background: #fff !important;
        border-color: #e95f5f !important;
        box-shadow: 0 0 0 3px rgba(233,95,95,.10) !important;
    }
    .hdr .sr input::placeholder { color: #9299a3 !important; }
    .hdr .sr span {
        position: absolute !important;
        top: 50% !important;
        right: 14px !important;
        transform: translateY(-50%) !important;
        font-size: 16px !important;
        pointer-events: none !important;
    }
}

@media screen and (max-width: 380px) {
    .hdr .c { gap: 8px !important; }
    .hdr .logo img { height: 48px !important; max-width: 85px !important; }
    .hdr .sr input { height: 40px !important; font-size: 13px !important; }
}

@media screen and (max-width: 360px) {
    body.header-scrolled nav[aria-label="Main"] .nav-logo img {
        height: 32px;
        max-width: 110px;
    }
    nav[aria-label="Main"] .menu > li > a,
    nav[aria-label="Main"] .menu > li > button {
        font-size: 13px;
        padding: 12px;
    }
    nav[aria-label="Main"] .menu .dd a {
        font-size: 13px;
        padding-left: 25px;
    }
}

/* ==================== TOP RESPONSIVE ==================== */
@media (max-width: 1023px) {
    .top ul { gap: 8px 16px; }
}
@media (max-width: 767px) {
    .top { padding: 5px 0; }
    .top ul { gap: 6px 12px; padding: 3px 8px; }
    .top a { font-size: 12px; }
}

/* ==================== BODY SCROLL LOCK ==================== */
body.nav-open {
    overflow: hidden !important;
}