/* Site header (site/components/header.blade.php) */
.search-close-btn:hover {
    transform: rotate(90deg) scale(1.1);
    background: #ef4444 !important;
    border-color: #ef4444 !important;
}

.search-box-premium:focus-within {
    border-color: #e6a530 !important;
    box-shadow: none;
}

.search-box-premium:hover:not(:focus-within) {
    border-color: rgba(230, 165, 48, .65) !important;
}

.search-tag-btn:hover {
    background: #e6a530 !important;
    color: #003244 !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(230, 165, 48, 0.3);
    border-color: #e6a530 !important;
}

/* One frame around the combined input/button, including keyboard focus. */
html.site-ui #overlay-search-input,
html.site-ui #overlay-search-input:focus-visible {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 85px;
    margin: 0;
    padding: 20px 32px;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.5;
    font-family: inherit;
    outline: none !important;
    box-shadow: none !important;
    transition: none;
}

#overlay-search-input::placeholder {
    color: #b5c6cc;
    opacity: 1;
    font-weight: 600;
}

@media (max-width: 768px) {
    .search-inner-content h2 {
        font-size: 28px !important;
        margin-bottom: 30px !important;
    }

    .search-box-premium {
        border-radius: 15px !important;
    }

    html.site-ui #overlay-search-input,
    html.site-ui #overlay-search-input:focus-visible {
        height: 65px;
        font-size: 16px;
        padding: 16px;
    }

    .search-box-premium button {
        width: 65px !important;
        height: 65px !important;
        font-size: 20px !important;
    }

    .search-close-btn {
        width: 45px !important;
        height: 45px !important;
        top: 20px !important;
        left: 20px !important;
        font-size: 18px !important;
    }
}

/* Original header: scrolls normally with page */
#main-header {
    position: relative !important;
    z-index: 100;
}

#header-top-row {
    background: #003244 !important;
    border-bottom: none;
}

#header-nav-row {
    background: #001f29 !important;
    border-bottom: none;
}

/* ===== QURAN & SUNNAH DROPDOWN STYLES ===== */
.quran-sunnah-dropdown-wrapper {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
}

.quran-sunnah-dropdown-wrapper::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

.quran-sunnah-dropdown-wrapper.qs-open .quran-sunnah-dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.quran-sunnah-dropdown-menu {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    min-width: 250px !important;
    background: linear-gradient(145deg, #001722 0%, #002534 100%) !important;
    border: 1px solid rgba(230, 165, 48, 0.4) !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
    padding: 10px !important;
    z-index: 1000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(10px) !important;
    transition: opacity .15s ease, visibility .15s ease !important;
    backdrop-filter: blur(12px) !important;
}

.qs-dropdown-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 800 !important;
    font-size: 13.5px !important;
    transition: all 0.25s ease !important;
    white-space: nowrap !important;
}

.qs-dropdown-item:hover {
    background: rgba(230, 165, 48, 0.15) !important;
    color: #e6a530 !important;
    transform: translateX(-4px) !important;
}

/* Desktop: center the submenu under its trigger and keep it on-screen */
@media (min-width: 992px) {
    .quran-sunnah-dropdown-menu {
        right: 50% !important;
        left: auto !important;
        transform: translate(50%, 10px) !important;
        max-width: calc(100vw - 24px) !important;
    }

    .quran-sunnah-dropdown-wrapper.qs-open .quran-sunnah-dropdown-menu {
        transform: translate(50%, 0) !important;
    }

    html[dir="ltr"] .quran-sunnah-dropdown-menu {
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, 10px) !important;
    }

    html[dir="ltr"] .quran-sunnah-dropdown-wrapper.qs-open .quran-sunnah-dropdown-menu {
        transform: translate(-50%, 0) !important;
    }

    /* Last nav item sits near the screen edge: align its menu to the edge side instead */
    .header-nav-links > .quran-sunnah-dropdown-wrapper:last-child .quran-sunnah-dropdown-menu {
        right: auto !important;
        left: 0 !important;
        transform: translateY(10px) !important;
    }

    .header-nav-links > .quran-sunnah-dropdown-wrapper:last-child.qs-open .quran-sunnah-dropdown-menu {
        transform: translateY(0) !important;
    }

    html[dir="ltr"] .header-nav-links > .quran-sunnah-dropdown-wrapper:last-child .quran-sunnah-dropdown-menu {
        left: auto !important;
        right: 0 !important;
    }
}

/* Keep the Quran/Sunnah submenu inside the viewport when the nav wraps on phones. */
@media (max-width: 991.98px) {
    .quran-sunnah-dropdown-menu {
        width: min(320px, calc(100vw - 24px)) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
        box-sizing: border-box !important;
    }

    html[dir="ltr"] .quran-sunnah-dropdown-menu {
        left: 0 !important;
        right: auto !important;
        transform: translateY(10px) !important;
    }

    html[dir="ltr"] .quran-sunnah-dropdown-wrapper.qs-open .quran-sunnah-dropdown-menu {
        transform: translateY(0) !important;
    }
}

@media (max-width: 479.98px) {
    .quran-sunnah-dropdown-menu {
        width: min(290px, calc(100vw - 20px)) !important;
        max-width: calc(100vw - 20px) !important;
        padding: 8px !important;
    }

    .qs-dropdown-item { white-space: normal !important; font-size: 12.5px !important; }
}

.qs-item-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    background: rgba(230, 165, 48, 0.15) !important;
    border: 1px solid rgba(230, 165, 48, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #e6a530 !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
}

.qs-item-icon.sunnah-icon {
    background: rgba(50, 178, 208, 0.15) !important;
    border-color: rgba(50, 178, 208, 0.3) !important;
    color: #32b2d0 !important;
}

.qs-divider {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    margin: 6px 0 !important;
}

/* Account for fixed header (none now, so padding-top on body managed in app.blade.php) */

/* ===== FLOATING GLASS PILL ===== */
#glass-header {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    width: max-content;
    max-width: 95vw;
    opacity: 0;
    pointer-events: none;
    transition: top 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.35s ease;
    white-space: nowrap;
}

#glass-header.is-visible {
    top: 14px;
    opacity: 1;
    pointer-events: all;
}

#glass-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 24px;
    border-radius: 50px;
    background: #002633;
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1.5px solid rgba(50, 178, 208, 0.35);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    overflow: visible !important;
}

#glass-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0 !important;
    margin-left: 10px !important;
    margin-right: 0 !important;
}

#glass-logo img {
    height: 32px;
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
    transition: transform 0.3s;
    flex-shrink: 0 !important;
}

#glass-logo:hover img {
    transform: scale(1.06);
}

/* Nav links */
#glass-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 700;
    font-size: 13.5px;
    padding: 4px 8px;
    border-radius: 50px;
    transition: all 0.22s;
    white-space: nowrap;
}

.glass-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.glass-link.glass-active {
    color: #fff;
    background: rgba(50, 178, 208, 0.22);
    border: 1px solid rgba(50, 178, 208, 0.35);
}

/* Action buttons */
#glass-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 14px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 12px;
    transition: all 0.22s;
    cursor: pointer;
    white-space: nowrap;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.glass-btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.22);
}

.glass-btn-gold {
    background: linear-gradient(135deg, rgba(230, 165, 48, .85), rgba(196, 138, 34, .85));
    border-color: transparent;
}

.glass-btn-gold:hover {
    background: linear-gradient(135deg, #e6a530, #c48a22);
    box-shadow: 0 4px 14px rgba(230, 165, 48, .4);
    color: #fff;
}

/* Search circle */
.glass-search {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(50, 178, 208, 0.18);
    border: 1px solid rgba(50, 178, 208, 0.32);
    color: #32b2d0;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s;
}

.glass-search:hover {
    background: rgba(50, 178, 208, 0.38);
    color: #fff;
    transform: scale(1.1);
}

/* Mobile */
@media (max-width: 768px) {

    /* Full width pill on mobile */
    #glass-header {
        width: calc(100% - 20px) !important;
        max-width: 100% !important;
    }

    #glass-inner {
        padding: 7px 14px !important;
        gap: 0 !important;
        justify-content: space-between !important;
        width: 100% !important;
        border-radius: 50px !important;
    }

    /* Hide nav on mobile */
    #glass-nav {
        display: none !important;
    }

    /* Compact logo */
    #glass-logo {
        margin: 0 !important;
    }

    #glass-logo img {
        height: 26px !important;
    }

    /* Compact actions */
    #glass-actions {
        gap: 6px !important;
    }

    /* Login button on mobile - icon + text compact */
    .glass-btn {
        padding: 6px 14px !important;
        font-size: 12px !important;
        border-radius: 50px !important;
    }

    /* Hide secondary action text labels on very small screens */
    .glass-btn-label-hide {
        display: none !important;
    }

    /* Login button: gold accent on mobile */
    .glass-btn-login {
        background: linear-gradient(135deg, rgba(230, 165, 48, 0.9), rgba(196, 138, 34, 0.9)) !important;
        border-color: rgba(230, 165, 48, 0.5) !important;
        color: #fff !important;
        font-weight: 900 !important;
    }
}

@media (max-width: 400px) {
    .glass-btn-label {
        display: none !important;
    }

    .glass-btn {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    .glass-btn-login {
        width: auto !important;
        padding: 6px 12px !important;
    }

    .glass-btn-login .glass-btn-label {
        display: inline !important;
    }
}

.header-action-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.header-action-link i {
    font-size: 18px;
    color: var(--theme-color2);
}

.header-action-link:hover {
    color: #fff;
    transform: translateY(-2px);
}

.classic-nav-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-weight: 800;
    font-size: 13.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    transition: 0.3s;
}

.classic-nav-link i {
    font-size: 14px;
    transition: 0.3s;
}

/* Keep navigation rows stable before the asynchronous icon rules and font arrive. */
.classic-nav-link > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 1em;
    block-size: 1em;
    line-height: 1;
    flex: none;
}

.classic-nav-link:hover,
.classic-nav-link.active {
    color: var(--theme-color);
}

.classic-nav-link:hover i {
    transform: translateY(-2px);
}

/* Keep desktop navigation compact and centered on wide screens. */
#header-nav-row .header-nav-links {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    max-width: 980px;
    margin-inline: auto;
    align-items: stretch;
    gap: 4px;
    padding: 4px 0;
}
#header-nav-row .header-nav-links > * { min-width: 0; }
#header-nav-row .classic-nav-link {
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 6px 4px;
    gap: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #dce8ec;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease;
}
#header-nav-row .classic-nav-link > i { color: inherit; font-size: 15px; }
#header-nav-row .classic-nav-link:hover,
#header-nav-row .classic-nav-link.active,
#header-nav-row .classic-nav-link[aria-expanded="true"] { background: #123641; color: #f1bc58; }
#header-nav-row .classic-nav-link:is(:hover, .active, [aria-expanded="true"]) > i { color: #f1bc58; transform: none; }
#header-nav-row .classic-nav-link:focus-visible,
#header-nav-row .qs-dropdown-item:focus-visible,
#header-nav-row .ms-item:focus-visible { outline: 2px solid #f1bc58; outline-offset: -3px; }
#header-nav-row:has(.qs-open, .kt-megamenu.is-open) { z-index: 11 !important; }
@media (min-width: 992px) {
    #header-nav-row .classic-nav-link > span { display: flex; align-items: center; justify-content: center; min-height: 20px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
    #header-top-row .header-brand-group { gap: 20px !important; }
    #header-top-row .header-primary-links { gap: 12px !important; }
    #header-top-row .header-action-link { white-space: nowrap; }
    #header-top-row .header-action-link span { display: none; }
    #header-top-row .header-action-link { width: 44px; height: 44px; justify-content: center; border: 1px solid #466471; border-radius: 50%; }
    #header-top-row .header-actions-group { gap: 8px !important; white-space: nowrap; }
}

.kt-pill-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.kt-pill-btn:hover {
    background: #fff;
    color: #003244;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.kt-pill-gold {
    background: linear-gradient(135deg, #e6a530 0%, #c48a22 100%);
    color: #fff;
    padding: 8px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.kt-pill-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(230, 165, 48, 0.4);
    filter: brightness(1.1);
}

@media (max-width: 991.98px) {
    /* Phone/tablet: one horizontally-scrollable row of pill links (no messy wrapping) */
    #header-nav-row .header-nav-links {
        display: flex !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding: 10px 14px !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    #header-nav-row .header-nav-links::-webkit-scrollbar {
        display: none;
    }

    #header-nav-row .container {
        padding: 0 !important;
        max-width: 100% !important;
    }

    #header-nav-row .classic-nav-link {
        flex: 0 0 auto;
        width: auto;
        min-height: 44px;
        flex-direction: row !important;
        align-items: center;
        gap: 7px !important;
        padding: 8px 14px;
        font-size: 12.5px;
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 50px;
        color: rgba(255, 255, 255, 0.75);
    }

    #header-nav-row .classic-nav-link.active {
        background: rgba(230, 165, 48, 0.15);
        border-color: rgba(230, 165, 48, 0.45);
        color: #e6a530;
    }

    #header-nav-row .classic-nav-link i {
        font-size: 13px;
    }

    #header-nav-row :is(.quran-sunnah-dropdown-wrapper, .kt-megamenu-wrapper) {
        flex: 0 0 auto;
    }
    #header-nav-row .header-nav-links { scroll-padding-inline: 14px; }
    #header-nav-row .header-nav-links > * { scroll-margin-inline: 14px; }

    #header-top-row {
        padding: 8px 0 !important;
    }

    #header-top-row .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 16px !important;
        gap: 12px !important;
        flex-wrap: nowrap !important;
    }

    .header-brand-group {
        gap: 0 !important;
        min-width: 0;
        flex: 0 1 auto;
    }

    .header-brand-group>a {
        flex-shrink: 0;
    }

    .header-brand-group>a img {
        height: 38px !important;
        width: auto !important;
    }

    .header-primary-links {
        display: flex !important;
        gap: 6px !important;
    }

    .header-primary-links .header-action-link {
        width: 36px;
        height: 36px;
        justify-content: center;
        gap: 0;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.06);
    }

    .header-primary-links .header-action-link span {
        display: none !important;
    }

    .header-primary-links .header-action-link i {
        font-size: 15px !important;
        margin: 0 !important;
    }

    .header-actions-group {
        gap: 7px !important;
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .header-language-desktop {
        display: inline-flex !important;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        justify-content: center;
        border-radius: 50% !important;
    }

    .header-language-desktop span {
        display: none !important;
    }

    .header-auth-desktop.kt-pill-btn,
    .header-logout-button {
        display: inline-flex !important;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        align-items: center;
        justify-content: center;
        border-radius: 50% !important;
    }

    .header-auth-desktop span,
    .header-logout-button span {
        display: none !important;
    }

    form.header-auth-desktop {
        display: block !important;
        margin: 0 !important;
    }

    .header-plan-link {
        display: inline-flex !important;
        width: 36px;
        height: 36px;
        padding: 0 !important;
        justify-content: center;
        border-radius: 50% !important;
    }

    .header-plan-link span {
        display: none !important;
    }

    .header-language-mobile,
    .header-mobile-login {
        display: none !important;
    }

    .header-language-mobile,
    .header-mobile-login {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }

    .kt-pill-gold {
        padding: 5px 12px !important;
        font-size: 10px !important;
        gap: 4px !important;
    }

    .kt-pill-btn {
        padding: 5px 12px !important;
        font-size: 10px !important;
    }

    .vs-menu-toggle {
        font-size: 18px !important;
        width: 38px;
        height: 38px;
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 38px;
    }
}

@media (max-width: 575px) {
    #header-nav-row .header-nav-links {
        gap: 7px !important;
        padding: 9px 12px !important;
    }

    #header-nav-row .classic-nav-link {
        gap: 6px !important;
        padding: 7px 12px;
        font-size: 11.5px;
    }

    #header-nav-row .classic-nav-link i {
        font-size: 12px;
    }

    .kt-megamenu {
        width: min(94vw, 520px) !important;
    }

    .megamenu-container {
        height: min(65vh, 440px) !important;
    }

    .megamenu-sidebar {
        width: 42% !important;
        min-width: 0 !important;
        padding: 10px !important;
    }

    .megamenu-content {
        min-width: 0 !important;
    }

    #header-top-row .container {
        padding: 0 12px !important;
        justify-content: space-between !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    #header-top-row {
        width: 100% !important;
    }

    /* On narrow phones, move the full set of actions into the mobile menu. */
    .header-primary-links,
    .header-language-desktop,
    .header-auth-desktop,
    .header-plan-link {
        display: none !important;
    }

    .header-language-mobile {
        display: flex !important;
    }

    .header-mobile-login {
        display: flex !important;
    }

    .header-actions-group {
        gap: 7px !important;
    }

    .header-brand-group>a img {
        height: 32px !important;
    }

    .header-actions-group {
        gap: 6px !important;
    }

    .header-language-mobile,
    .header-mobile-login {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .vs-menu-toggle {
        width: 34px !important;
        height: 34px !important;
    }
}

/* Global Fix for Mobile Menu Broken Squares */
.vs-mobile-menu li a::before,
.vs-mobile-menu li a::after,
.vs-menu-toggle::before,
.vs-menu-toggle::after {
    content: none !important;
    display: none !important;
}

.vs-mobile-menu ul li {
    list-style: none !important;
}

/* Custom Slim Scrollbar for Mega Menu */
.megamenu-sidebar::-webkit-scrollbar,
.megamenu-content::-webkit-scrollbar {
    width: 4px;
}

.megamenu-sidebar::-webkit-scrollbar-track,
.megamenu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.megamenu-sidebar::-webkit-scrollbar-thumb,
.megamenu-content::-webkit-scrollbar-thumb {
    background: rgba(230, 165, 48, 0.3);
    border-radius: 10px;
}

.megamenu-sidebar::-webkit-scrollbar-thumb:hover,
.megamenu-content::-webkit-scrollbar-thumb:hover {
    background: #e6a530;
}

/* Advanced Interactive Mega Menu Styles */
.kt-megamenu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.kt-megamenu-wrapper.is-active::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
    z-index: 999;
}

.kt-megamenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: min(1100px, 90vw);
    background: #001f29;
    backdrop-filter: blur(35px);
    border: 1px solid rgba(50, 178, 208, 0.25);
    border-radius: 35px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility .15s ease;
    box-shadow: 0 60px 120px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow: hidden;
    margin-top: 15px;
    contain: layout;
}

.kt-megamenu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    margin-top: 0;
}

.kt-megamenu-close { display: none; }

.megamenu-container {
    display: flex;
    height: 520px;
}

/* Sidebar (Main Categories) */
.megamenu-sidebar {
    width: 380px;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-left: 1px solid rgba(50, 178, 208, 0.1);
    overflow-y: auto;
}

.ms-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: 18px;
    cursor: pointer;
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    margin-bottom: 6px;
    color: #c5d6dc;
    position: relative;
    border: 1px solid transparent;
}

.ms-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.9);
}

.ms-item.active {
    background: rgba(50, 178, 208, 0.12);
    color: #fff;
    border-color: rgba(50, 178, 208, 0.2);
}

.ms-item.active::before {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 5px;
    background: #e6a530;
    border-radius: 0 10px 10px 0;
}

.ms-icon {
    width: 45px;
    height: 45px;
    background: rgba(230, 165, 48, 0.15);
    color: #e6a530;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: 0.3s;
}

.ms-item.active .ms-icon {
    background: #e6a530;
    color: #000;
    transform: scale(1.1) rotate(5deg);
}

.ms-title {
    font-weight: 900;
    font-size: 16px;
    margin-bottom: 2px;
}

.ms-desc {
    font-size: 12px;
    opacity: 0.5;
    font-weight: 600;
}

.ms-arrow {
    font-size: 14px;
    margin-right: auto;
    opacity: 0;
    transition: 0.3s;
}

.ms-item.active .ms-arrow {
    opacity: 1;
    transform: translateX(-8px);
}

/* Content Area (Sub Categories) */
.megamenu-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0) 0%, rgba(50, 178, 208, 0.02) 100%);
}

.subcat-panel {
    display: none;
    animation: megamenuFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.subcat-panel.active {
    display: block;
}

.subcat-grid {
    columns: 2;
    column-gap: 12px;
}

.subcat-grid a {
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: 0.3s ease;
    display: flex;
    align-items: center;
    break-inside: avoid;
    margin-bottom: 12px;
}

.subcat-grid a::before {
    content: '•';
    margin-left: 10px;
    color: #e6a530;
    font-size: 18px;
    transition: 0.3s;
}

.subcat-grid a:hover {
    background: rgba(50, 178, 208, 0.08);
    border-color: rgba(50, 178, 208, 0.2);
    color: #32b2d0;
    transform: translateX(-5px);
}

.subcat-grid a:hover::before {
    transform: scale(1.5);
    color: #32b2d0;
}

@keyframes megamenuFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ═══════════════════════════════════════════════════════
   LTR SUPPORT FOR MEGA-MENU
   ═══════════════════════════════════════════════════════ */
html[dir="ltr"] .megamenu-sidebar {
    border-right: 1px solid rgba(50, 178, 208, 0.1);
    border-left: none;
}

html[dir="ltr"] .ms-item.active::before {
    left: 0;
    right: auto;
    border-radius: 10px 0 0 10px;
}

html[dir="ltr"] .ms-arrow {
    margin-left: auto;
    margin-right: 0;
}

html[dir="ltr"] .ms-item.active .ms-arrow {
    transform: translateX(8px);
}

html[dir="ltr"] .subcat-grid a::before {
    margin-right: 10px;
    margin-left: 0;
}

html[dir="ltr"] .subcat-grid a:hover {
    transform: translateX(5px);
}

/* ═══════════════════════════════════════════════════════
   HEADER MOBILE RESPONSIVE — شامل
   ═══════════════════════════════════════════════════════ */

/* Mobile Menu Sidebar */
.vs-menu-wrapper {
    position: fixed;
    top: 0;
    left: -340px;
    right: auto;
    width: 320px;
    height: 100%;
    z-index: 9999;
    transform: none !important;
    transition: left 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.vs-menu-wrapper.open {
    left: 0;
    opacity: 1;
    visibility: visible;
}

.vs-menu-wrapper.open .vs-menu-area {
    left: 0;
    opacity: 1;
    visibility: visible;
}

html[dir="rtl"] .vs-menu-wrapper {
    left: auto;
    right: -340px;
    transition: right 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html[dir="rtl"] .vs-menu-wrapper.open {
    right: 0;
}

.vs-menu-area {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* The wrapper is the only moving layer; keep panel contents locked to it. */
    transform: none !important;
    animation: none !important;
    transition: none !important;
}

.vs-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.vs-menu-open .vs-menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

html[dir="rtl"] .mobile-logo {
    display: grid !important;
    grid-template-columns: auto 1fr;
    direction: ltr;
}

html[dir="rtl"] .mobile-logo>a {
    grid-column: 2;
    justify-self: end;
}

html[dir="rtl"] .mobile-logo>.vs-menu-toggle {
    grid-column: 1;
    justify-self: start;
}

/* Mobile: top-bar safe area for iOS notch */
@supports (padding-top: env(safe-area-inset-top)) {
    #header-top-row {
        padding-top: calc(8px + env(safe-area-inset-top)) !important;
    }
}

/* xs: < 480px */
@media (max-width: 479.98px) {
    #header-top-row .container {
        padding: 0 10px !important;
        gap: 6px !important;
    }

    #header-top-row img {
        height: 26px !important;
        width: auto !important;
    }

    .kt-pill-gold {
        display: none !important;
    }

    .vs-menu-toggle {
        font-size: 17px !important;
        width: 34px !important;
        height: 34px !important;
    }

    /* Mobile menu width on small phones */
    .vs-menu-wrapper {
        width: 290px;
    }

    .vs-menu-area {
        width: 290px !important;
    }

    .vs-mobile-menu li a {
        padding: 12px 14px !important;
        font-size: 14px !important;
    }
}

/* sm: 480 - 767 */
@media (min-width: 480px) and (max-width: 767.98px) {
    #header-top-row img {
        height: 30px !important;
    }

    .kt-pill-gold {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }
}

/* Ensure mobile menu items have adequate touch targets */
.vs-mobile-menu li a {
    min-height: 52px;
}

/* Mobile/tablet category menu: focused dialog instead of a cramped split mega-menu. */
@media (max-width: 767.98px) {
    body.kt-megamenu-open::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 99;
        background: rgba(0, 12, 20, 0.68);
        backdrop-filter: blur(3px);
    }

    .kt-megamenu-wrapper.is-active::before {
        display: none;
    }

    .kt-megamenu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        width: min(94vw, 560px) !important;
        height: min(78vh, 680px) !important;
        max-height: calc(100dvh - 24px) !important;
        margin: 0 !important;
        padding-top: 44px;
        border-radius: 22px !important;
        transform: translate(-50%, -47%) scale(0.98) !important;
        z-index: 100000 !important;
    }

    .kt-megamenu.is-open {
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .kt-megamenu-close {
        display: flex;
        position: absolute;
        inset-block-start: 9px;
        inset-inline-end: 10px;
        z-index: 5;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: 50%;
        background: rgba(255,255,255,0.08);
        color: #fff;
        cursor: pointer;
    }

    .megamenu-container {
        height: 100% !important;
        min-height: 0;
        flex-direction: column !important;
    }

    .megamenu-sidebar {
        display: flex !important;
        flex: 0 0 34%;
        width: 100% !important;
        min-width: 0 !important;
        max-height: 34%;
        gap: 8px;
        padding: 12px !important;
        border-left: 0 !important;
        border-bottom: 1px solid rgba(50, 178, 208, 0.18);
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity;
    }

    .ms-item {
        flex: 0 0 clamp(112px, 34vw, 158px);
        min-width: 0;
        min-height: 0;
        margin: 0 !important;
        padding: 7px 8px !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 6px;
        text-align: center;
        scroll-snap-align: start;
    }

    .ms-item.active::before {
        top: 0 !important;
        right: 12% !important;
        width: 76% !important;
        height: 3px !important;
        border-radius: 0 0 8px 8px !important;
    }

    .ms-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 15px;
    }

    .ms-icon img { width: 22px !important; height: 22px !important; }
    .ms-title { font-size: 11px; line-height: 1.3; }
    .ms-desc, .ms-arrow { display: none !important; }

    .megamenu-content {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        padding: 14px !important;
        overflow-y: auto !important;
    }

    .subcat-grid {
        columns: 1;
        column-gap: 0;
    }

    .subcat-grid a {
        padding: 12px 14px;
        margin-bottom: 8px;
        border-radius: 12px;
        font-size: 13px;
        line-height: 1.45;
    }
}

@media (max-width: 400px) {
    .kt-megamenu {
        width: calc(100vw - 16px) !important;
        height: min(82vh, 680px) !important;
        max-height: calc(100dvh - 16px) !important;
        border-radius: 18px !important;
    }

    .megamenu-sidebar { flex-basis: 32%; max-height: 32%; padding: 9px !important; }
    .ms-item { flex-basis: 125px; padding: 8px !important; }
    .megamenu-content { padding: 10px !important; }
}

/* A steady glow keeps the library mark legible on the navy header. */
.mobile-logo img.site-brand-glow,
.header-brand-group img.site-brand-glow,
#glass-logo img.site-brand-glow {
    filter: brightness(0) invert(1) drop-shadow(0 0 3px rgba(125, 211, 232, .55)) drop-shadow(0 0 10px rgba(50, 178, 208, .3)) !important;
}

@media (prefers-reduced-motion: reduce) {
    #header-nav-row *, #header-nav-row *::before { transition: none !important; animation: none !important; }
}

/* Shared header controls: one palette and touch size in both reading directions. */
:is(#classic-header, #glass-header, .vs-menu-wrapper) {
    --header-surface: #103746;
    --header-ink: #dce8ec;
    --header-border: #466471;
    --header-accent: #f1bc58;
}
:is(#classic-header, #glass-header) :is(.header-action-link, .header-language-desktop, .header-language-mobile, .header-plan-link, .glass-btn, .notification-bell-button, .site-account-menu > summary),
.vs-menu-toggle.header-menu-trigger,
.vs-menu-wrapper .vs-menu-toggle {
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px;
    flex-shrink: 0;
    border-radius: 12px !important;
    border: 1px solid var(--header-border) !important;
    background: var(--header-surface) !important;
    color: var(--header-ink) !important;
    box-shadow: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px !important;
    line-height: 1.3;
    text-decoration: none;
    transition: color .15s, background-color .15s, border-color .15s;
}
:is(#classic-header, #glass-header) :is(.header-action-link, .header-language-desktop, .header-plan-link, .glass-btn, .notification-bell-button, .site-account-menu > summary) i,
.vs-menu-toggle i { color: inherit !important; font-size: 16px !important; }
:is(#classic-header, #glass-header) :is(.header-action-link, .header-language-desktop, .header-language-mobile, .header-plan-link, .glass-btn, .notification-bell-button, .site-account-menu > summary):hover,
.vs-menu-toggle:hover {
    color: var(--header-accent) !important;
    border-color: var(--header-accent) !important;
    transform: none;
}
:is(#classic-header, #glass-header, .vs-menu-wrapper) :is(a, button, summary):focus-visible {
    outline: 2px solid var(--header-accent);
    outline-offset: 2px;
}
.header-menu-trigger { display: flex; width: 44px !important; padding: 0 !important; cursor: pointer; }
#header-top-row .container { gap: 12px; }
#header-top-row .header-brand-group { min-width: 0; }
#classic-header .header-menu-trigger { display: none; }
#glass-header { width: max-content; max-width: calc(100% - 24px); left: 0; right: 0; margin-inline: auto; transform: none; visibility: hidden; }
#glass-header.is-visible { visibility: visible; }
#glass-inner { gap: 12px; padding: 8px 12px; border-radius: 18px; }
#glass-logo { margin: 0 !important; }
#glass-logo img { max-width: 120px; object-fit: contain; }
#glass-nav .glass-link { display: flex; align-items: center; min-height: 44px; border-radius: 8px; }
#glass-nav .glass-link:is(:hover, .glass-active) { color: #f1bc58; background: #123641; border-color: transparent; }
#glass-actions .site-auth-buttons { display: none; }
#glass-actions .site-account-mobile { display: block; }
#glass-actions .glass-btn-label { display: none; }
#glass-actions .glass-btn { width: 44px; padding: 0 !important; }
/* The opener, drawer edge, and close button share the reading-start edge. */
.vs-menu-wrapper { width: min(360px, calc(100vw - 24px)); height: 100dvh; }
.vs-menu-wrapper:not(.open) { visibility: hidden; left: -380px; }
html[dir="rtl"] .vs-menu-wrapper:not(.open) { left: auto; right: -380px; }
.vs-menu-wrapper .vs-menu-area { width: 100% !important; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
.vs-menu-wrapper .mobile-logo {
    position: sticky !important; top: 0; background: #002633;
    padding: calc(16px + env(safe-area-inset-top)) 16px 16px !important;
    display: flex !important; flex-direction: row-reverse; direction: inherit !important; gap: 16px;
}
.vs-menu-wrapper .mobile-logo .vs-menu-toggle { display: flex; width: 44px !important; padding: 0 !important; }
.vs-menu-wrapper .vs-mobile-menu { padding: 16px !important; }
.vs-menu-wrapper .vs-mobile-menu li a { border-radius: 10px !important; color: #dce8ec !important; font-weight: 700 !important; }
.vs-menu-wrapper .vs-mobile-menu li a > span:first-child { flex-shrink: 0; color: #dce8ec !important; background: #103746 !important; }
.vs-menu-wrapper .vs-mobile-menu li a:hover { background: #123641 !important; color: #f1bc58 !important; }
@media (max-width: 1199.98px) {
    #glass-nav { display: none !important; }
    #glass-header { width: min(640px, calc(100% - 24px)) !important; }
    #glass-inner { gap: 10px !important; border-radius: 18px !important; padding: 8px !important; }
    #glass-logo { margin-inline-end: auto !important; }
    #header-top-row .header-primary-links { gap: 8px !important; }
}
@media (max-width: 991.98px) {
    #classic-header .header-menu-trigger { display: flex; }
    #header-top-row .container { gap: 8px !important; }
    #header-top-row .header-brand-group { margin-inline-end: auto; gap: 12px !important; }
    #header-top-row .header-actions-group { gap: 6px !important; }
    #header-top-row .header-primary-links { display: none !important; }
    #header-top-row .header-plan-link { display: none !important; }
    #header-top-row :is(.header-language-desktop, .header-language-mobile) { width: 44px; padding: 0 !important; flex-basis: 44px; }
    #header-top-row .header-brand-group img { max-width: 140px; object-fit: contain; }
}
@media (max-width: 479.98px) {
    #header-top-row .header-brand-group img { max-width: 96px; }
    #glass-logo img { max-width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
    #glass-header, .vs-menu-wrapper, .vs-menu-backdrop { transition: none !important; }
}
@media (max-width: 359.98px) {
    #header-top-row .header-brand-group img, #glass-logo img { max-width: 76px; }
    #header-top-row .container, #glass-inner { gap: 6px !important; }
}
.vs-menu-wrapper .vs-menu-area { display: flex; flex-direction: column; overflow: hidden; }
.vs-menu-wrapper .mobile-logo { flex-shrink: 0; margin: 0; }
.vs-menu-wrapper .vs-mobile-menu { flex: 1; min-height: 0; max-height: none; margin: 0; overflow-y: auto; overscroll-behavior: contain; }
.vs-menu-wrapper .vs-mobile-menu li { border: 0; }
/* The solid floating bar must not establish a containing block for fixed menus. */
#glass-inner { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Compact library drawer: quiet navigation rows, grouped by purpose. */
#site-mobile-menu .vs-menu-area { background: #002633 !important; }
#site-mobile-menu .mobile-logo { padding: calc(12px + env(safe-area-inset-top)) 16px 12px !important; }
#site-mobile-menu .vs-mobile-menu { padding: 12px !important; }
#site-mobile-menu .vs-mobile-menu ul { display: flex; flex-direction: column; gap: 2px; padding: 0; margin: 0; list-style: none; text-align: start; }
#site-mobile-menu .vs-mobile-menu li { margin: 0; padding: 0; }
#site-mobile-menu .vs-mobile-menu li.drawer-group-start { margin-top: 10px; padding-top: 10px; border-top: 1px solid #244653; }
#site-mobile-menu .vs-mobile-menu li a {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    min-height: 46px; padding: 10px 12px !important; margin: 0;
    border: 0 !important; border-radius: 8px !important; background: transparent;
    font-size: 14px !important; line-height: 1.6; font-weight: 600 !important;
    color: #dce8ec !important; text-decoration: none; text-align: start;
    transition: color .15s, background-color .15s;
}
#site-mobile-menu .vs-mobile-menu li a > span:first-child {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 24px; flex: 0 0 22px;
    background: transparent !important; color: #a8c4ce !important;
}
#site-mobile-menu .vs-mobile-menu li a i { font-size: 16px; }
#site-mobile-menu .vs-mobile-menu li a:is(:hover, [aria-current="page"]) { background: #123b48 !important; color: #f1bc58 !important; }
#site-mobile-menu .vs-mobile-menu li a:is(:hover, [aria-current="page"]) > span:first-child { color: #f1bc58 !important; }
#site-mobile-menu a:focus-visible { outline: 2px solid #f1bc58; outline-offset: -2px; }
#site-mobile-menu { width: min(340px, calc(100vw - 32px)); }
#site-mobile-menu .vs-menu-area { max-width: none; margin: 0; }

/* One navigation mode per viewport, shared by the classic and floating headers. */
@media (min-width: 1200px) {
    #classic-header .header-menu-trigger, #glass-header .header-menu-trigger { display: none; }
}
@media (max-width: 1199.98px) {
    #header-nav-row { display: none; }
    #classic-header .header-menu-trigger, #glass-header .header-menu-trigger { display: flex; }
    #header-top-row .header-primary-links, #header-top-row .header-plan-link { display: none !important; }
    #header-top-row .header-brand-group { margin-inline-end: auto; }
}

/* Keep the language destination visible in the compact floating header. */
#glass-actions .header-language-glass { width:auto !important; padding:0 10px !important; gap:7px; flex-shrink:0; }
#glass-actions .header-language-glass .glass-btn-label { display:inline !important; font-size:12px; white-space:nowrap; }
