/**
 * Mobile Menu Styles
 *
 * Custom mobile menu overlay that slides in from the right.
 * Separate from desktop nav for distinct navigation experiences.
 */

/* ==========================================================================
   Slide-In Animations
   ========================================================================== */

@keyframes slideInFromRight {
    from {
        right: -100vw;
    }
    to {
        right: 0;
    }
}

@keyframes slideInFromRightTablet {
    from {
        right: -24rem;
    }
    to {
        right: 0;
    }
}

/* ==========================================================================
   Base Styles - Menu Panel
   ========================================================================== */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    right: -100vw; /* Hidden off-screen by default */
    width: 100vw;
    height: 100vh;
    background-color: var(--wp--preset--color--white);
    z-index: 9999;
    overflow-y: auto;
    padding: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
    box-sizing: border-box;
    transition: right 0.2s ease-out;

    /* Mobile-landscape and up: constrained width */
    @media (min-width: 568px) {
        width: 24rem; /* 384px */
        right: -24rem;
    }
}

/* ==========================================================================
   Open State & Body Lock
   ========================================================================== */

body.mobile-menu-open {
    overflow: hidden;

    .mobile-menu-overlay {
        right: 0;
        animation: slideInFromRight 0.2s ease-out;

        @media (min-width: 568px) {
            animation: slideInFromRightTablet 0.2s ease-out;
        }
    }

    .mobile-menu-backdrop {
        display: block;
    }
}

/* ==========================================================================
   Backdrop
   ========================================================================== */

.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    cursor: pointer;
}

/* ==========================================================================
   Close Button
   ========================================================================== */

.mobile-menu-close {
    position: absolute;
    top: var(--wp--preset--spacing--40);
    right: var(--wp--preset--spacing--40);
    width: 40px;
    height: 40px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--wp--preset--color--bright-red);
    z-index: 10000;

    &:hover {
        color: var(--wp--preset--color--red);
    }

    svg {
        width: 24px;
        height: 24px;
    }
}

/* ==========================================================================
   Language Switcher
   ========================================================================== */

.mobile-menu-language {
    margin-bottom: var(--wp--preset--spacing--50);
}

/* ==========================================================================
   Menu Groups
   ========================================================================== */

.menu-group {
    margin-bottom: var(--wp--preset--spacing--50);
}

/* Dividers between groups (::before on group 2 and 3) */
.menu-group-2,
.menu-group-3 {
    &::before {
        content: "";
        display: block;
        width: 40px;
        height: 3px;
        background-color: var(--wp--preset--color--bright-red);
        margin-bottom: var(--wp--preset--spacing--50);
    }
}

/* ==========================================================================
   Menu Links
   ========================================================================== */

.menu-link {
    margin: 0;
    padding: 0;

    & + .menu-link {
        margin-top: var(--wp--preset--spacing--30);
    }

    a {
        font-family: var(--wp--preset--font-family--body);
        font-size: 0.875rem;
        font-weight: 600;
        text-decoration: none;
        color: var(--wp--preset--color--blue);
        letter-spacing: 0.02em;
        transition: color 0.15s ease;

        &:hover {
            color: var(--wp--preset--color--bright-red);
        }
    }
}

/* ==========================================================================
   Mobile Menu Trigger (Hamburger Button in Header)
   ========================================================================== */

.mobile-menu-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    padding: 10px;
    padding-right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--wp--preset--color--bright-red);

    &:hover {
        color: var(--wp--preset--color--red);
    }

    svg {
        width: 24px;
        height: 24px;
        stroke: currentColor;
    }
}
