/* Prevent body scroll when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* ==========================================
   Mobile Menu Styles
   ========================================== */

/* Mobile Menu Toggle Button (Hamburger) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 501;
    position: relative;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: #d4af37;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.mobile-menu {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 85%;
    max-width: 400px;
    background: #1a1a1a;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

/* Close Button */
.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #d4af37;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    transform: rotate(90deg);
    color: #f4d03f;
}

/* Mobile Menu Header */
.mobile-menu-header {
    padding: 30px 20px 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.mobile-menu-brand {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: #d4af37;
    font-weight: 600;
    letter-spacing: 2px;
    display: inline-block;
    text-decoration: none;
}

.mobile-menu-brand img {
    height: 40px;
    width: auto;
    display: block;
}

/* Mobile Navigation */
.mobile-nav {
    padding: 30px 0;
    flex: 1;
}

.mobile-nav a {
    display: block;
    padding: 15px 30px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
    border-left-color: #d4af37;
    padding-left: 35px;
}

/* Mobile Language Switcher */
.mobile-language-switcher {
    padding: 20px 30px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.mobile-language-switcher .lang-title {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mobile-lang-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.mobile-lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.95rem;
}

.mobile-lang-btn:hover,
.mobile-lang-btn.active {
    background: rgba(212, 175, 55, 0.2);
    border-color: #d4af37;
    color: #d4af37;
}

.mobile-lang-btn .flag-emoji {
    font-size: 1.2rem;
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    padding: 20px 30px 30px;
}

.mobile-menu-footer .social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.mobile-menu-footer .social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    color: #d4af37;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-menu-footer .social-links a:hover {
    background: #d4af37;
    color: #0a0a0a;
    transform: translateY(-3px);
}

/* Responsive Behavior */
@media (max-width: 992px) {

    /* Show mobile menu toggle - HIGH PRIORITY */
    .mobile-menu-toggle {
        display: flex !important;
        z-index: 1001;
    }

    /* Hide desktop navigation links only, keep header visible for logo and hamburger */
    .main-nav {
        display: none !important;
    }

    /* Hide desktop language switcher within nav */
    .navigation .language-switcher,
    .main-nav .language-switcher {
        display: none !important;
    }

    /* Hide desktop sidebar navigation if present */
    .sidebar-nav,
    .sidebar-lang {
        display: none !important;
    }

    /* Make sure header is visible and properly positioned */
    .site-header {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        padding: 15px 20px !important;
        background: rgba(10, 10, 10, 0.95) !important;
        backdrop-filter: blur(10px);
        z-index: 999 !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Add space for fixed header on content */
    .content-area {
        padding-top: 0;
    }

    .hero-slider-container {
        margin-top: 70px;
    }

    .portfolio-archive {
        margin-top: 70px;
    }

    .section:first-of-type {
        padding-top: calc(8rem + 70px);
    }
}

@media (min-width: 993px) {

    /* Hide mobile menu on desktop */
    .mobile-menu-toggle,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* RTL Support for Arabic */
html[dir="rtl"] .mobile-menu {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

html[dir="rtl"] .mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

html[dir="rtl"] .mobile-menu-close {
    right: auto;
    left: 20px;
}

html[dir="rtl"] .mobile-nav a {
    border-left: none;
    border-right: 3px solid transparent;
}

html[dir="rtl"] .mobile-nav a:hover,
html[dir="rtl"] .mobile-nav a.active {
    border-right-color: #d4af37;
    padding-right: 35px;
    padding-left: 30px;
}