@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');
.menu-container {
    position: relative;
}

.menu-toggle {
    cursor: pointer;
    font-size: 30px;
    display: none; /* Hidden by default, shown in mobile */
}

nav {
    display: flex;
/*    justify-content: flex;  Align menu to the right */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
/*    flex-direction: row-reverse;  Reverse the order for right-to-left */
}

nav ul li {
    position: relative;
    font-family: "Cairo", sans-serif;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
/*    direction: rtl;  Ensure RTL direction */
}

nav ul li a {
    display: block;
    padding: 15px;
    color: #000000;
    text-decoration: none;
    position: relative; /* Add relative positioning for arrow */
    font-family: "Cairo", sans-serif;
    font-size: 17px;
    font-weight: bold;
}

.arrow {
    margin-right: 10px; /* Space between text and arrow (reversed for RTL) */
    transition: transform 0.3s ease; /* Animation for arrow rotation */
    display: inline-block; /* Allow transformation */
    transform: rotate(210deg); /* Default position - arrow down */
}

nav ul li a:hover .arrow {
    transform: rotate(270deg); /* Arrow points up on hover */
}

.submenu {
    display: block; /* Allow transitions to work */
    max-height: 0; /* Hidden by default */
    overflow: hidden; /* Prevent content overflow */
    opacity: 0; /* Hidden by default */
    transition: max-height 0.4s ease, opacity 0.4s ease; /* Smooth transition */
    background-color: #ffffff; /* Submenu background */
    position: absolute;
    right: 0; /* Align submenu to the right */
    border-radius: 5px;
    width: auto;
}

.menu ul li:hover .submenu {
    max-height: 200px; /* Maximum height of submenu (adjust as needed) */
    opacity: 1; /* Fully visible */
    transition: max-height 0.4s ease, opacity 0.4s ease; /* Smooth transition */
}

.submenu li a {
    color: #000000 !important;
}

@media screen  and (max-width: 500px) {
    .menu-toggle {
        display: block; /* Show toggle on mobile */
        position: absolute;
        top: -50px;
        left: 4px; /* Align toggle button to the right */
        z-index: 10;
        color: #ffffff;
    }

    nav {
        position: fixed;
        top: 80px;
        left: -60%; /* Start hidden offscreen on the right */
        height: 100%;
        width: 60%;
        background-color: #ffffff;
        transition: left 0.3s ease;
    }

    nav.active {
        left: 0; /* Slide in from the right */
    }

    nav ul {
        flex-direction: column;
        width: 90%;
        text-align: left; /* Align text to the right */
    }

    nav ul li {
        width: 100%;
		margin-bottom: -20px
    }

    nav ul li a {
        width: 100%;
    }

    .submenu {
        position: static; /* Change position for mobile */
        display: none; /* Keep submenus hidden */
    }

    nav ul li.active .submenu {
        display: block; /* Show submenu on click */
        transition: max-height 0.3s ease;
        width: 100%;
    }
	.submenu li a {
		color: #ffffff;
		padding-top: -10px
	}
}

@media screen and (min-width: 505px) and (max-width: 1100px){
    .menu-toggle {
        display: block; /* Show toggle on mobile */
        position: absolute;
        top: -44px;
        left: 10px; /* Align toggle button to the right */
        z-index: 10;
        color: #ffffff;
    }

    nav {
        position: fixed;
        
        right: -60%; /* Start hidden offscreen on the right */
        height: 100%;
        width: 60%;
        background-color: #ffffff;
        transition: left 0.3s ease;
		
    }

    nav.active {
        left: 0; /* Slide in from the right */
    }

    nav ul {
        flex-direction: column;
        width: 90%;
        text-align: left; /* Align text to the right */
    }

    nav ul li {
        width: 100%;
    }

    nav ul li a {
        width: 100%;
		padding-bottom: 0px;
		padding-top: 6px
    }

    .submenu {
        position: static; /* Change position for mobile */
        display: none; /* Keep submenus hidden */
    }

    nav ul li.active .submenu {
        display: block; /* Show submenu on click */
        transition: max-height 0.3s ease;
        width: 100%;
    }
	.submenu li a {
		color: #ffffff;
		
	}
}
