/* ===== MST Header ===== */
:root { --mst-header-h: 64px; }

/* html body की specificity ज़्यादा है, इसलिए index.php का 'html, body {padding:0}' इसे नहीं तोड़ेगा */
html body { margin: 0; padding-top: calc(var(--mst-header-h) + 1px); }

.mst-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background-color: #faf9eb;
    border-bottom: 1px solid #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-family: 'Poppins', Arial, sans-serif;
}

.mst-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--mst-header-h);
    padding: 0 15px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.mst-navbar a.mst-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    min-width: 0;
}

/* Round logo */
.mst-brand img {
    height: 46px;
    width: 46px;
    object-fit: contain;
    border-radius: 50%;
    border: 1px solid #eaeaea;
    flex-shrink: 0;
}

.mst-logo-text {
    font-size: 19px;
    font-weight: 700;
    color: #222222;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile toggle */
.mst-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #d35400;
    transition: transform 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}
.mst-menu-toggle:active { transform: scale(0.92); }

/* Mobile dropdown (fixed header के नीचे खुलता है) */
.mst-nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: calc(100vh - var(--mst-header-h));
    overflow-y: auto;
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.mst-nav-links.mst-active {
    display: block;
    animation: mstSlideInDown 0.3s ease forwards;
}

.mst-nav-links ul { list-style: none; margin: 0; padding: 0; }
.mst-nav-links li { border-bottom: 1px solid #f5f5f5; }

.mst-nav-links a {
    display: block;
    padding: 14px 20px;
    text-decoration: none;
    color: #333333;
    font-weight: 500;
    font-size: 15px;
    transition: background 0.3s ease, padding-left 0.3s ease, color 0.3s ease;
}
.mst-nav-links a:hover,
.mst-nav-links a:focus-visible,
.mst-nav-links a[aria-current="page"] {
    background: #fafafa;
    color: #d35400;
}
.mst-nav-links a:hover,
.mst-nav-links a:focus-visible { padding-left: 24px; }

.mst-menu-toggle:focus-visible,
.mst-brand:focus-visible,
.mst-nav-links a:focus-visible {
    outline: 2px solid #d35400;
    outline-offset: 2px;
}

@keyframes mstSlideInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Small mobile */
@media (max-width: 480px) {
    :root { --mst-header-h: 60px; }
    .mst-brand img { height: 40px; width: 40px; }
    .mst-logo-text { font-size: 16px; }
}
@media (max-width: 360px) {
    .mst-logo-text { font-size: 14px; letter-spacing: 0.2px; }
    .mst-brand { gap: 8px; }
}

/* Desktop */
@media (min-width: 992px) {
    .mst-header {
        background-color: #ffffff;
        border-bottom: 1px solid #e0e0e0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    }

    .mst-menu-toggle { display: none; }

    .mst-nav-links,
    .mst-nav-links.mst-active {
        display: block;
        position: static;
        width: auto;
        max-height: none;
        overflow: visible;
        border: none;
        background: transparent;
        box-shadow: none;
        animation: none;
    }

    .mst-nav-links ul { display: flex; gap: 20px; }
    .mst-nav-links li { border: none; }

    .mst-nav-links a {
        padding: 8px 5px;
        position: relative;
        background: transparent;
    }
    .mst-nav-links a:hover,
    .mst-nav-links a:focus-visible { padding-left: 5px; background: transparent; }

    /* Underline hover effect */
    .mst-nav-links a::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 2px;
        left: 50%;
        transform: translateX(-50%);
        background-color: #d35400;
        transition: width 0.3s ease;
    }
    .mst-nav-links a:hover::after,
    .mst-nav-links a:focus-visible::after,
    .mst-nav-links a[aria-current="page"]::after { width: 100%; }
}
