[dir] body {
    cursor: default;
    margin: 0;
}

* {
    box-sizing: border-box;
    outline: none;
    scroll-behavior: smooth;
}

[dir="rtl"] {
    font-family: "Cairo",
        "Tajawal",
        sans-serif !important;
}

*,
::after,
::before {
    box-sizing: border-box;
}


.header {
    position: fixed;
    top: 0;
    z-index: 600;
    transition: all .3s ease;
}

[dir="rtl"] .header {
    left: 0;
    right: 0;
}


.container {
    width: 1200px;
    max-width: 100%;
}

[dir="ltr"] .container {
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 992px) {
    [dir] .header-wrapper {
        padding: 0 15px;
    }
}


/* Logo */
.logo img {
    max-height: 60px;
    width: auto;
}

.menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all .3s ease;
}

/* Secondary Menu (top row) */
.secondary-menu {
    display: flex;
}



[dir="rtl"] .lang {
    margin-left: 5px;
}

[dir] .lang {
    border-radius: 100%;
    background: #1a3c6c;
}

.lang:hover {
    background-color: #fff;
    color: #1a3c6c;
    border-color: #1a3c6c;
}


a[href] {
    text-decoration: none;
}

@media (max-width: 992px) {

    .lang,
    .social-icon:not(.social-icon2) {
        width: 25px;
        height: 25px;
    }
}


@media (max-width: 992px) {
    .lang {
        font-size: 12px;
    }
}

.lang {
    width: 30px;
    height: 30px;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all .3s ease;
    font-weight: 700;
}

[dir] .mobile-social-btn {
    padding: 13px;
    background-color: #1a3c6c;
    border-radius: 100%;
    border: none;
}

.mobile-social-btn {
    display: none;
    font-size: 20px;
    color: #fff;
    position: absolute;
}


[dir] .contact-social-list,
[dir] .main-menu-list,
[dir] .social-list {
    margin: 0;
    padding: 0;
}

.contact-social-list,
.main-menu-list,
.social-list {
    list-style: none;
    display: flex;
}

@media (max-width: 992px) {

    .lang,
    .social-icon:not(.social-icon2) {
        width: 25px;
        height: 25px;
    }
}

[dir] .social-icon {
    background-color: #1a3c6c;
    border-radius: 100%;
    margin: 0 1px;
}

.social-icon {
    width: 30px;
    height: 30px;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all .3s ease;
}

.social-icon:hover {
    background-color: #fff;
    color: #1a3c6c;
    /* transform: translateY(-2px); */
}


/* main menu */
[dir] .main-menu {
    margin: 20px 0;
}

.main-menu {
    transition: all .3s ease;
}

[dir] .burger {
    margin: 0 3px;
    cursor: pointer;
    border: 1px solid #fff;
    border-radius: 100%;
    padding: 6px 0;
}

.burger {
    width: 31px;
    height: 31px;
    z-index: 550;
    display: none;
    transition: all .3s linear;
}

[dir="rtl"] .main-menu-list>li:first-child {
    margin-right: 0;
}

@media (max-width: 992px) {
    [dir] .main-menu-list>li {
        margin: 0 7px;
        margin-right: 7px;
    }
}

@media (min-width: 769px) {

    .main-menu-list>li.active::after,
    .main-menu-list>li:not(.active):hover::after,
    .main-menu-list>li:not(.active):hover::before {
        width: 100%;
    }
}

[dir] .main-menu-list>li {
    margin: 0 10px;
    padding: 5px 0 7px;
}

@media (max-width: 992px) {
    .main-menu-list>li {
        font-size: 14px;
    }
}

.main-menu-list li {
    position: relative;
    /* font-weight: 900; */
}

[dir] .main-menu-list>li::after,
[dir] .main-menu-list>li::before {
    background-color: #fff;
    border-radius: 10px;
}

.main-menu-list>li::before {
    top: 0;
}


[dir="rtl"] .main-menu-list>li::after {
    left: 0;
}

[dir="ltr"] .main-menu-list>li::after {
    right: 0;
}


.main-menu-list>li::after {
    bottom: 0;
}

.main-menu-list>li::after,
.main-menu-list>li::before {
    position: absolute;
    content: "";
    height: 2px;
    transition: all .35s ease;
    width: 0;
}

.main-menu-list>li>a {
    color: #fff;
}


/* logo */
[dir] .logo {
    padding: 50px 10px 58px;
}

@media (max-width: 992px) {
    [dir="ltr"] .logo::before {
        border-right: 99px solid #fff;
    }
}

[dir="ltr"] .logo::before {
    right: 0;
    left: 0;
    border-right: 120px solid #fff;
}

@media (max-width: 992px) {
    .logo {
        width: 100px;
    }
}

.logo {
    position: relative;
    display: block;
    transition: all .3s ease;
}

@media (max-width: 992px) {
    [dir="rtl"] .logo::before {
        border-left: 99px solid #fff;
    }
}

[dir="rtl"] .logo::before {
    left: 0;
    right: 0;
    border-left: 120px solid #fff;
}

[dir] .logo::before {
    border-bottom: 30px solid transparent;
}

.logo::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: -1;
}

.logo a,
.logo img {
    display: block;
}

iframe,
img {
    max-width: 100%;
}




[dir="rtl"] .header.sticky {
    box-shadow: -3px -1px 14px 0 rgba(0, 0, 0, .21961), 0 4px 22px 0 rgba(0, 0, 0, .06);
}

[dir] .header.sticky {
    background-color: #fff;
}

[dir="ltr"] .header,
[dir="rtl"] .header {
    left: 0;
    right: 0;
}

[dir] .header.sticky .menu {
    padding: 20px 0;
}

@media (min-width: 769px) {
    [dir] .header.sticky .main-menu {
        margin: 20px 0 0;
    }
}

[dir] .header.sticky .main-menu {
    margin: 20px 0 0;
}

[dir] .header.sticky .burger {
    border-color: #1a3c6c;
}

/* Change main menu links to dark blue when sticky */
.header.sticky .main-menu-list>li>a {
    color: #1a3c6c !important;
    transition: color 0.3s ease;
}


/* Language switcher and social icons adjustment */
.header.sticky .lang,
.header.sticky .social-icon {
    background-color: #1a3c6c;
    /* Keep them dark blue */
    color: #fff;
}

.header,
.menu,
.main-menu,
.logo img,
.main-menu-list>li>a {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* This prevents the 'wing' from creating an awkward shape on the white background */
.header.sticky .logo::before {
    opacity: 0;
    transition: opacity 0.3s ease;
}

[dir] .header.sticky .logo {
    padding: 20px 10px;
}

/* This targets the icon inside the social-menu ONLY when scrolling */
.header.sticky .social-icon:not(.social-icon2) i {
    font-size: 12px;
    transition: font-size 0.3s ease;
    /* Makes the shrinking look smooth */
}

/* Ensure logo wing remains visible in sticky header on mobile */
@media (max-width: 992px) {

    .header.sticky [dir="ltr"] .logo::before,
    .header.sticky [dir="rtl"] .logo::before {
        opacity: 1 !important;
        /* Keep wing visible */
    }
}




/* --- Responsive Fixes --- */

/* 1. Show burger menu on mobile */
@media (max-width: 992px) {
    .burger {
        display: flex !important;
        /* Force show burger */
        z-index: 2000 !important;
        position: relative;
        background: transparent;
        border: 1px solid #fff;
        border-radius: 100%;
        width: 30px;
        /* Reduced from 35px */
        height: 30px;
        /* Reduced from 35px */
        padding: 6px 0;
        /* Reduced from 8px */
        margin: 0 3px;
        /* Reduced from 5px */
        cursor: pointer;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .burger span {
        width: 14px;
        /* Reduced from 18px */
        height: 2px;
        background-color: #fff;
        margin: 1.5px 0;
        /* Reduced from 2px */
        transition: 0.3s;
        display: block;
    }

    /* Burger animation when active */
    .burger.active span:nth-child(1) {
        transform: rotate(45deg) translate(3px, 3px);
        /* Adjusted for smaller size */
    }

    .burger.active span:nth-child(2) {
        opacity: 0;
    }

    .burger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(3px, -3px);
        /* Adjusted for smaller size */
    }

    /* Hide the main menu list by default on mobile */
    .menu-list {
        position: fixed;
        top: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        padding: 80px 20px;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1500;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        /* Allow scrolling if menu is long */
    }

    /* English (LTR): Slide from Left */
    [dir="ltr"] .menu-list {
        left: 0;
        transform: translateX(-100%);
        /* Start hidden on the left */
    }

    [dir="ltr"] .menu-list.active {
        transform: translateX(0);
        /* Slide in */
    }

    /* Arabic (RTL): Slide from Right */
    [dir="rtl"] .menu-list {
        right: 0;
        transform: translateX(100%);
        /* Start hidden on the right */
    }

    [dir="rtl"] .menu-list.active {
        transform: translateX(0);
        /* Slide in */
    }

    /* Ensure main menu list is visible inside the sliding panel */
    .main-menu-list {
        flex-direction: column !important;
        gap: 15px;
        display: flex !important;
    }

    .main-menu-list li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-menu-list li a {
        color: #1a3c6c !important;
        font-size: 1rem;
        display: block;
        padding: 12px 15px;
        border-radius: 8px;
        transition: background-color 0.3s ease;
        font-weight: 600;
    }

    .main-menu-list li a:hover {
        background-color: rgba(26, 60, 108, 0.08);
    }

    /* Active menu item styling */
    .main-menu-list li.active a {
        background-color: rgba(26, 60, 108, 0.12);
        font-weight: 700;
        border-left: 3px solid #1a3c6c;
    }

    [dir="rtl"] .main-menu-list li.active a {
        border-left: none;
        border-right: 3px solid #1a3c6c;
    }

    /* Hide the hover effects on mobile */
    .main-menu-list>li::after,
    .main-menu-list>li::before {
        display: none;
    }

    /* Adjust header layout for mobile */
    .header-wrapper {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 5px 15px;
    }

    /* Menu container adjustment */
    .menu {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex: 0 1 auto;
    }

    /* Secondary menu hidden on very small screens */
    .secondary-menu {
        display: flex;
        margin-right: 8px;
        /* Reduced from 10px */
    }

    [dir="rtl"] .secondary-menu {
        margin-right: 0;
        margin-left: 8px;
        /* Reduced from 10px */
    }

    /* Logo positioning - FIXED */
    .logo {
        position: relative;
        display: block;
        padding: 15px 5px 20px !important;
        margin: 0 !important;
        width: auto;
        z-index: 100;
    }

    .logo img {
        max-height: 45px;
        width: auto;
        display: block;
        position: relative;
        z-index: 2;
    }

    /* Fix wing positioning - KEEP IT ATTACHED */
    [dir="ltr"] .logo::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        border-right: 90px solid #fff;
        border-bottom: 25px solid transparent;
        z-index: 1;
        opacity: 1 !important;
    }

    [dir="rtl"] .logo::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        border-left: 90px solid #fff;
        border-bottom: 25px solid transparent;
        z-index: 1;
        opacity: 1 !important;
    }

    /* Sticky header adjustments for mobile */
    .header.sticky .logo {
        padding: 12px 5px 17px !important;
    }

    .header.sticky .burger {
        border-color: #1a3c6c;
    }

    .header.sticky .burger span {
        background-color: #1a3c6c;
    }

    .header.sticky .lang,
    .header.sticky .social-icon {
        background-color: #1a3c6c;
        color: #fff;
    }
}

/* Menu overlay - FIXED BLUR ISSUE */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    /* Darker for better visibility */
    z-index: 1400;
    /* Just below the menu-list */
    display: none;
    transition: opacity 0.3s ease;
}



/* Remove any blur effect if it's causing issues */
.menu-overlay.active {
    backdrop-filter: none;
    /* Remove blur if it was there */
    -webkit-backdrop-filter: none;
}

/* Small mobile devices */
@media (max-width: 576px) {
    .menu-list {
        width: 250px;
        padding: 70px 15px;
    }

    .main-menu-list li a {
        font-size: 0.95rem;
        padding: 10px 12px;
    }

    .logo img {
        max-height: 38px;
    }

    [dir="ltr"] .logo::before {
        border-right: 70px solid #fff;
        border-bottom-width: 22px;
    }

    [dir="rtl"] .logo::before {
        border-left: 70px solid #fff;
        border-bottom-width: 22px;
    }

    .secondary-menu {
        margin-right: 5px;
    }

    [dir="rtl"] .secondary-menu {
        margin-left: 5px;
    }

    /* Even smaller burger for very small screens */
    .burger {
        width: 28px;
        /* Further reduced */
        height: 28px;
        /* Further reduced */
        padding: 5px 0;
    }

    .burger span {
        width: 13px;
        /* Further reduced */
        margin: 1px 0;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .burger {
        width: 26px;
        height: 26px;
        padding: 4px 0;
    }

    .burger span {
        width: 12px;
    }

    .secondary-menu {
        margin-right: 3px;
    }

    [dir="rtl"] .secondary-menu {
        margin-left: 3px;
    }

    .lang,
    .social-icon {
        width: 22px;
        height: 22px;
    }
}



/* Force menu items to stay on one line */
.main-menu-list>li>a {
    white-space: nowrap;
}

/* Adjust spacing on medium screens */
@media (max-width: 1200px) {
    .main-menu-list>li {
        margin: 0 6px;
    }

    .main-menu-list>li>a {
        font-size: 0.9rem;
    }
}