/* Site-wide Global Scroll Lock on the X-Axis to prevent any horizontal scrollbar on any screen size */
html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
}

/* Tighten main-menu link margins for a sleeker, more compact desktop header spacing */
html body .main-menu ul li {
    margin-right: 18px !important;
    margin-left: 0 !important;
}

html[dir="rtl"] body .main-menu {
    margin-left: 15px !important;
    margin-right: 0 !important;
}

html[dir="rtl"] body .main-menu ul li {
    margin-left: 18px !important;
    margin-right: 0 !important;
}

/* Modern Premium Solid Dark / Transparent Header Design - Luxury Dark Theme */
html body .th-header.header-layout4 {
    background: #ffffff !important;
    background-color: #ffffff !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    transition: all 0.4s ease !important;
    border-bottom: 1px solid rgba(72, 113, 140, 0.08) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.02) !important;
}

/* Keep transparent & absolutely positioned */
html body .sticky-wrapper {
    background: transparent !important;
    border: none !important;
    width: 100% !important;
}

/* Hide top social area to keep the header extremely clean and modern */
html body .th-header.header-layout4 .top-area {
    display: none !important;
}

/* Hide the old diagonal white logo shape completely! */
html body .th-header.header-layout4 .logo-shape {
    display: none !important;
}

/* Seamless full-width navbar container */
html body .th-header.header-layout4 .menu-area {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    box-shadow: none !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    html body .th-header.header-layout4 .menu-area {
        padding: 10px 15px !important;
    }
}

/* Logo container styled as a premium minimal card */
html body .header-logo {
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
}

html body .header-logo img {
    max-height: 46px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
    transition: all 0.3s ease !important;
}

html body .header-logo img:hover {
    transform: scale(1.03);
}

/* Main menu item alignments & styling */
html body .main-menu ul {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

html body .main-menu ul li {
    display: inline-block !important;
}

/* Base menu item link styling - Crisp Slate Black for great visibility */
html body .th-header.header-layout4 .main-menu>ul>li>a {
    font-weight: 700 !important;
    font-size: 15px !important;
    letter-spacing: 0.5px !important;
    color: #1E293B !important;
    padding: 8px 10px !important;
    margin: 4px 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    transition: all 0.25s ease !important;
    position: relative !important;
    display: inline-block !important;
}

/* Active state: no bottom line/border and brand blue color */
html body .th-header.header-layout4 .main-menu>ul>li.active>a {
    color: #357797 !important;
    border-bottom: 2px solid transparent !important;
    background: transparent !important;
}

/* Hover state: border-bottom ONLY underneath the link */
html body .th-header.header-layout4 .main-menu>ul>li>a:hover {
    color: #357797 !important;
    border-bottom: 2px solid #357797 !important;
    background: transparent !important;
}

/* Sticky state transforms into a magnificent frosted-glass white header banner */
html body .sticky-wrapper.sticky .menu-area {
    background: rgba(255, 255, 255, 0.96) !important;
    background-color: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(25px) saturate(130%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(130%) !important;
    border-bottom: 1px solid rgba(72, 113, 140, 0.08) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04) !important;
    padding: 6px 0 !important;
    transform: none !important;
}

/* Frameless Language Selector (removed all borders and background boxes) */
html body .th-header.header-layout4 .lang-btn {
    background: transparent !important;
    border: none !important;
    color: #1E293B !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    padding: 8px 10px !important;
}

html body .th-header.header-layout4 .lang-btn span {
    color: #1E293B !important;
    font-weight: 700 !important;
}

html body .th-header.header-layout4 .lang-btn i {
    color: #1E293B !important;
}

html body .th-header.header-layout4 .lang-btn:hover {
    background: transparent !important;
    border: none !important;
}

html body .th-header.header-layout4 .lang-btn:hover span,
html body .th-header.header-layout4 .lang-btn:hover i {
    color: #357797 !important;
}

html body .lang-menu {
    background: #ffffff !important;
    border: 1px solid rgba(72, 113, 140, 0.15) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
    border-radius: 8px !important;
    padding: 6px 0 !important;
}

html body .lang-item {
    color: #1E293B !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

html body .lang-item:hover {
    background: rgba(72, 113, 140, 0.08) !important;
    color: #357797 !important;
}

@media (max-width: 991px) {
    /* Globally lock horizontal scroll on mobile viewport */
    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
    }

    /* Absolute mobile menu containment to completely prevent offscreen container overflow */
    html body .th-menu-wrapper {
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        overflow: hidden !important;
    }

    /* Zero out all bootstrap row margins on mobile to ensure no negative spacing breaks the screen width */
    html body .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    html body .container,
    html body .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* ULTRA-PREMIUM MOBILE HEADER & SIDEBAR NAVIGATION SYSTEM */

/* 1. Slim & Sleek Mobile Header Navbar */
@media (max-width: 991px) {
    html body .th-header.header-layout4 .menu-area {
        box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
        background: #ffffff !important;
    }

    html body .header-logo img {
        max-height: 40px !important;
        transition: all 0.3s ease !important;
    }

    /* Compact & Gorgeous Brand Hamburger Toggle Button */
    html body .th-menu-toggle {
        width: 42px !important;
        height: 42px !important;
        line-height: 42px !important;
        border-radius: 12px !important;
        padding: 0 !important;
        background: rgba(53, 119, 151, 0.08) !important;
        color: #357797 !important;
        border: 1px solid rgba(53, 119, 151, 0.15) !important;
        font-size: 16px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 2px 8px rgba(53, 119, 151, 0.08) !important;
    }

    html body .th-menu-toggle:hover,
    html body .th-menu-toggle:focus {
        background: #357797 !important;
        color: #ffffff !important;
        border-color: #357797 !important;
        box-shadow: 0 4px 12px rgba(53, 119, 151, 0.2) !important;
    }
}

/* 2. Premium Frosted-Glass Sidebar Wrapper */
html body .th-menu-wrapper {
    background: rgba(15, 23, 42, 0.45) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 100000 !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 3. Luxurious Sidebar Content Drawer */
html body .th-menu-area {
    background: #ffffff !important;
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.15) !important;
    padding: 20px 20px !important;
    width: 300px !important;
    max-width: 85vw !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    border-left: 1px solid rgba(53, 119, 151, 0.08) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Handle RTL orientation for Arabic sidebar drawer */
html[dir="rtl"] body .th-menu-area {
    box-shadow: 10px 0 40px rgba(15, 23, 42, 0.15) !important;
    border-left: none !important;
    border-right: 1px solid rgba(53, 119, 151, 0.08) !important;
}

/* 4. Elegant & Clean Top Close Button */
html body .th-menu-wrapper .th-menu-toggle {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    left: auto !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(15, 23, 42, 0.05) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #1E293B !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    z-index: 9999 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Handle close button positioning in Arabic RTL */
html[dir="rtl"] body .th-menu-wrapper .th-menu-toggle {
    right: auto !important;
    left: 15px !important;
}

html body .th-menu-wrapper .th-menu-toggle:hover {
    background: rgba(15, 23, 42, 0.1) !important;
    transform: rotate(90deg) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

/* 5. Well-Spaced Mobile Logo Container */
html body .th-menu-area .mobile-logo {
    text-align: left !important;
    margin-top: 0px !important;
    margin-bottom: 12px !important;
    padding-right: 35px !important;
    padding-left: 0 !important;
}

html[dir="rtl"] body .th-menu-area .mobile-logo {
    text-align: right !important;
    padding-right: 0 !important;
    padding-left: 35px !important;
}

html body .th-menu-area .mobile-logo img {
    max-height: 40px !important;
    height: 40px !important;
    width: auto !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03) !important;
}

/* 6. Premium Pill-Shaped Mobile Language Switcher */
html body #langSelector_mobile {
    margin: 5px 0 15px 0 !important;
    text-align: left !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    padding-bottom: 12px !important;
}

html[dir="rtl"] body #langSelector_mobile {
    text-align: right !important;
}

html body #langSelector_mobile .lang-btn {
    background: rgba(53, 119, 151, 0.06) !important;
    color: #357797 !important;
    border: 1px solid rgba(53, 119, 151, 0.12) !important;
    padding: 6px 12px !important;
    border-radius: 30px !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: none !important;
    transition: all 0.25s ease !important;
}

html body #langSelector_mobile .lang-btn:hover {
    background: rgba(53, 119, 151, 0.12) !important;
    border-color: rgba(53, 119, 151, 0.25) !important;
}

html body #langSelector_mobile .lang-btn span {
    color: #357797 !important;
    font-weight: 700 !important;
}

html body #langSelector_mobile .lang-btn i {
    color: #357797 !important;
}

html body #langSelector_mobile .lang-menu {
    left: 0 !important;
    right: auto !important;
    transform: translateY(10px) !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12) !important;
    border: 1px solid rgba(15, 23, 42, 0.06) !important;
    width: 150px !important;
}

html[dir="rtl"] body #langSelector_mobile .lang-menu {
    left: auto !important;
    right: 0 !important;
}

html body #langSelector_mobile .lang-menu.show {
    transform: translateY(0) !important;
}

/* 7. Beautiful Card-Style Sidebar Menu Links */
html body .th-mobile-menu {
    margin-top: 5px !important;
    text-align: left !important;
}

html[dir="rtl"] body .th-mobile-menu {
    text-align: right !important;
}

html body .th-mobile-menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

html body .th-mobile-menu ul li {
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body .th-mobile-menu ul li a {
    display: flex !important;
    align-items: center !important;
    padding: 9px 14px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    background: rgba(15, 23, 42, 0.02) !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid rgba(15, 23, 42, 0.01) !important;
}

html body .th-mobile-menu ul li a::before {
    content: "" !important;
    display: inline-block !important;
    width: 6px !important;
    height: 6px !important;
    border-right: 2px solid #357797 !important;
    border-bottom: 2px solid #357797 !important;
    transform: rotate(-45deg) !important;
    margin-right: 10px !important;
    margin-left: 0 !important;
    transition: transform 0.25s ease !important;
}

/* Dynamic chevron adjustment for RTL layout */
html[dir="rtl"] body .th-mobile-menu ul li a::before {
    transform: rotate(135deg) !important;
    margin-right: 0 !important;
    margin-left: 10px !important;
}

/* Gorgeous Active / Hover States */
html body .th-mobile-menu ul li a:hover,
html body .th-mobile-menu ul li.active a {
    color: #357797 !important;
    background: rgba(53, 119, 151, 0.06) !important;
    border-color: rgba(53, 119, 151, 0.12) !important;
    transform: translateX(5px) !important;
    box-shadow: 0 4px 12px rgba(53, 119, 151, 0.03) !important;
}

html[dir="rtl"] body .th-mobile-menu ul li a:hover,
html[dir="rtl"] body .th-mobile-menu ul li.active a {
    transform: translateX(-5px) !important;
}

html body .th-mobile-menu ul li a:hover::before {
    transform: translateX(3px) !important;
}

html[dir="rtl"] body .th-mobile-menu ul li a:hover::before {
    transform: translateX(-3px) !important;
}
