/**
 * WOS Menu Widget Styles
 *
 * File: wos-helper/widgets/wos-menu/assets/wos-menu.css
 * Version: 1.6.0 (Animation & Visibility Fix)
 */

/* --- Trigger Button --- */
.wos-menu-trigger {
    background: none;
    border: 1px solid #ccc;
    padding: 8px;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    font-size: 24px;
}
.wos-menu-trigger i,
.wos-menu-trigger svg {
    display: block;
    width: 1em;
    height: 1em;
}

/* --- Overlay --- */
.wos-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease-in-out, visibility 0s linear 0.35s;
}
.wos-menu-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

/* --- Main Menu Panel --- */
.wos-menu-panel {
    position: fixed;
    top: 0;
    width: 300px; /* Default, overridden by style controls */
    max-width: 85%; /* Default, overridden by style controls */
    height: 100%;
    background-color: #ffffff;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    /* CORRECTED: This is the transition for CLOSING the panel. */
    /* It animates the transform, and then hides the element AFTER the animation is done. */
    transition: transform 0.35s ease-in-out, visibility 0s linear 0.35s;
}

/* Define the off-screen positions */
.wos-menu-panel.wos-menu-ltr {
    left: 0;
    transform: translateX(-100%);
}
.wos-menu-panel.wos-menu-rtl {
    right: 0;
    transform: translateX(100%);
}

/* This rule MUST come after the LTR/RTL rules */
.wos-menu-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    /* CORRECTED: This is the transition for OPENING the panel. */
    /* It makes the panel visible instantly, then animates the transform. */
    transition: transform 0.35s ease-in-out, visibility 0s linear 0s;
}


/* --- Menu Header --- */
.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    flex-shrink: 0;
}
.mobile-nav-header .back-button,
.mobile-nav-header .mobile-nav-close {
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.mobile-nav-title-wrapper {
    flex-grow: 1;
    text-align: center;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* --- Menu Content & Levels --- */
.mobile-nav-content {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}
.menu-level {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: inherit;
    transition: transform 0.35s ease-in-out;
    overflow-y: auto;
    visibility: hidden;
}

/* LTR Animation States */
.wos-menu-ltr .menu-level {
    transform: translateX(100%);
}
.wos-menu-ltr .menu-level.is-active {
    transform: translateX(0);
    visibility: visible;
}
.wos-menu-ltr .menu-level.is-staged-left {
    transform: translateX(-100%);
    visibility: visible;
}

/* RTL Animation States */
.wos-menu-rtl .menu-level {
    transform: translateX(-100%);
}
.wos-menu-rtl .menu-level.is-active {
    transform: translateX(0);
    visibility: visible;
}
.wos-menu-rtl .menu-level.is-staged-left {
    transform: translateX(100%);
    visibility: visible;
}


/* --- Menu Items --- */
.menu-level li {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
}
.menu-level li .menu-item-link {
    padding: 15px;
    text-decoration: none;
    flex-grow: 1;
    display: flex;
    align-items: center;
}
.menu-level li .submenu-trigger-button {
    background: none;
    border: none;
    font-size: inherit;
    font-family: inherit;
    text-align: left;
    padding: 0 15px;
    cursor: pointer;
    align-self: stretch;
    display: flex;
    align-items: center;
}
.submenu-arrow {
    pointer-events: none;
}

/* --- Accessibility --- */
.wos-menu-trigger:focus,
.mobile-nav-header button:focus,
.menu-item-link:focus,
.submenu-trigger-button:focus {
    outline: none;
}
.wos-menu-trigger:focus-visible,
.mobile-nav-header button:focus-visible,
.menu-item-link:focus-visible,
.submenu-trigger-button:focus-visible {
    outline: 2px solid var(--e-global-color-accent, #0051af);
    outline-offset: -2px;
}