/* 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: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(230, 165, 48, 0.2);
    transform: translateY(-5px);
}

.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;
}

#overlay-search-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    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;
    }

    #overlay-search-input {
        font-size: 18px !important;
        padding: 0 20px !important;
    }

    .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:hover .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: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !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;
}

.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;
}

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

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

.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: 991px) {
    #header-nav-row {
        display: block !important;
    }

    #header-nav-row .header-nav-links {
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 6px 12px !important;
        padding: 8px 10px !important;
    }

    #header-nav-row .classic-nav-link {
        flex-direction: row !important;
        align-items: center;
        gap: 6px !important;
        padding: 7px 9px;
        font-size: 12px;
        white-space: nowrap;
    }

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

    #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: 4px 6px !important;
        padding: 7px 8px !important;
    }

    #header-nav-row .classic-nav-link {
        flex-direction: column !important;
        justify-content: center;
        gap: 3px !important;
        padding: 6px 7px;
        font-size: 10px;
    }

    #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: rgba(0, 31, 41, 0.98);
    backdrop-filter: blur(35px);
    border: 1px solid rgba(50, 178, 208, 0.25);
    border-radius: 35px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    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: rgba(255, 255, 255, 0.5);
    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;
}

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; }
}
