/**
 * Mobile Menu Styles - Matching Header Design
 */

/* ============================================================================
   Animated Hamburger Menu Icon (2 lines to X)
   ============================================================================ */

.hamburger-menu {
    width: 12px;
    height: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
    left: 0;
}

.hamburger-line:first-child {
    top: 0;
}

.hamburger-line:last-child {
    top: 6px;
}

/* When menu is open - animate to X */
.mobile-menu-open .hamburger-line:first-child {
    top: 3px;
    transform: rotate(45deg);
}

.mobile-menu-open .hamburger-line:last-child {
    top: 3px;
    transform: rotate(-45deg);
}

/* Mobile submenu dropdown animation */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.mobile-submenu.show {
    max-height: 3000px;
    opacity: 1;
}

/* Mobile menu container - slides in from right, matches header background */
#mobile-menu {
    position: fixed;
    top: var(--header-height, 88px);
    right: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - var(--header-height, 88px));
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

#mobile-menu.active {
    transform: translateX(0);
}

/* Menu content wrapper */
#mobile-menu-content {
    padding: 1.5rem;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* Navigation */
#mobile-menu-content nav {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

#mobile-menu.active #mobile-menu-content nav {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu-content nav ul {
    list-style: none;
    margin: 0;
    display: flex;
    padding-left: 0;
    flex-direction: column;
    gap: 0.5rem;
}

/* Menu items */
#mobile-menu-content nav ul li {
    list-style: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

#mobile-menu-content nav ul li:last-child {
    border-bottom: none;
}

#mobile-menu-content nav ul li a {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

#mobile-menu-content nav ul li a:hover,
#mobile-menu-content nav ul li a:active {
    opacity: 0.8;
}

#mobile-menu-content nav ul li.current-menu-item a,
#mobile-menu-content nav ul li.current_page_item a {
    font-weight: 600;
    opacity: 1;
}

/* Mobile menu button wrapper */
.mobile-menu-button-wrapper {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
}

#mobile-menu.active .mobile-menu-button-wrapper {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile menu button styling */
#mobile-menu-content .btn {
    width: 100%;
    justify-content: center;
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
    overflow: hidden;
}

/* Smooth scrollbar */
#mobile-menu::-webkit-scrollbar {
    width: 4px;
}

#mobile-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#mobile-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

#mobile-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Fade-in animations when menu opens */
#mobile-menu.active #mobile-menu-content nav ul li {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

#mobile-menu.active #mobile-menu-content nav ul li:nth-child(1) {
    animation-delay: 0.05s;
}

#mobile-menu.active #mobile-menu-content nav ul li:nth-child(2) {
    animation-delay: 0.1s;
}

#mobile-menu.active #mobile-menu-content nav ul li:nth-child(3) {
    animation-delay: 0.15s;
}

#mobile-menu.active #mobile-menu-content nav ul li:nth-child(4) {
    animation-delay: 0.2s;
}

#mobile-menu.active #mobile-menu-content nav ul li:nth-child(5) {
    animation-delay: 0.25s;
}

#mobile-menu.active #mobile-menu-content nav ul li:nth-child(6) {
    animation-delay: 0.3s;
}

#mobile-menu.active #mobile-menu-content nav ul li:nth-child(7) {
    animation-delay: 0.35s;
}

#mobile-menu.active .mobile-menu-button-wrapper {
    animation: fadeInUp 0.4s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
