/**
 * ASEW Navigation - Off-Canvas Menu Styles
 *
 * Mobile-only off-canvas navigation with multi-level support.
 * Replicates the ASEW mobile menu design.
 *
 * @package ASEW_Navigation
 */

/* ==========================================================================
   CSS Custom Properties (Defaults)
   ========================================================================== */

.asew-nav-offcanvas {
    --asew-nav-width: 355px;
    --asew-nav-bg: #ffffff;
    --asew-nav-z-index: 9999;
    --asew-nav-title-color: #0D0D0D;
    --asew-nav-item-color: #0D0D0D;
    --asew-nav-border-color: #FFE000;
    --asew-nav-active-bg: #FFE000;
    --asew-nav-active-color: #0D0D0D;
    --asew-nav-overlay-color: rgba(0, 0, 0, 0.5);
    --asew-nav-transition-duration: 0.45s;
    --asew-nav-transition-easing: cubic-bezier(0.3, 0, 0.15, 1);
}

/* ==========================================================================
   Widget Container - Mobile Only
   ========================================================================== */

.asew-nav-widget {
    display: block;
}

/* Hide on larger screens by default */
@media (min-width: 769px) {
    .asew-nav-widget[data-breakpoint="768"] {
        display: none;
    }
}

@media (min-width: 1025px) {
    .asew-nav-widget[data-breakpoint="1024"] {
        display: none;
    }
}

/* ==========================================================================
   Trigger Button
   ========================================================================== */

.asew-nav-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: 1;
    transition: opacity 0.2s ease;
}

.asew-nav-trigger:hover {
    opacity: 0.8;
}

.asew-nav-trigger:focus-visible {
    outline: 2px solid var(--asew-nav-border-color);
    outline-offset: 2px;
}

.asew-nav-trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.asew-nav-trigger-icon svg,
.asew-nav-trigger-icon i {
    width: 24px;
    height: 24px;
    display: block;
}

/* ==========================================================================
   Off-Canvas Panel (Hidden State)
   ========================================================================== */

.asew-nav-offcanvas {
    position: fixed;
    inset: 0;
    z-index: var(--asew-nav-z-index);
    visibility: hidden;
    pointer-events: none;
}

.asew-nav-offcanvas[hidden] {
    display: block; /* Override hidden for animation */
}

/* ==========================================================================
   Off-Canvas Panel (Open State)
   ========================================================================== */

.asew-nav-offcanvas.is-open {
    visibility: visible;
    pointer-events: auto;
}

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

.asew-nav-backdrop {
    position: absolute;
    inset: 0;
    background-color: var(--asew-nav-overlay-color);
    opacity: 0;
    transition: opacity var(--asew-nav-transition-duration) var(--asew-nav-transition-easing);
}

.asew-nav-offcanvas.is-open .asew-nav-backdrop {
    opacity: 1;
}

/* ==========================================================================
   Panel Container
   ========================================================================== */

.asew-nav-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--asew-nav-width);
    max-width: 100%;
    background-color: var(--asew-nav-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(-100%);
    transition: transform var(--asew-nav-transition-duration) var(--asew-nav-transition-easing);
}

.asew-nav-offcanvas.is-open .asew-nav-panel {
    transform: translateX(0);
}

/* ==========================================================================
   Header
   ========================================================================== */

.asew-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    flex-shrink: 0;
}

.asew-nav-title {
    font-size: 18.575px;
    font-weight: 700;
    color: var(--asew-nav-title-color);
    margin: 0;
}

.asew-nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--asew-nav-title-color);
    transition: opacity 0.2s ease;
	height: 43px;
	width: 43px;
}

.asew-nav-close:hover {
    opacity: 0.7;
}

.asew-nav-close:focus-visible {
    outline: 2px solid var(--asew-nav-border-color);
    outline-offset: 2px;
}

.asew-nav-close svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* ==========================================================================
   Body / Content Area
   ========================================================================== */

.asew-nav-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Custom Scrollbar */
.asew-nav-body::-webkit-scrollbar {
    width: 4px;
}

.asew-nav-body::-webkit-scrollbar-track {
    background: transparent;
}

.asew-nav-body::-webkit-scrollbar-thumb {
    background-color: var(--asew-nav-border-color);
    border-radius: 2px;
}

/* ==========================================================================
   Content Panels (Main & Submenus)
   ========================================================================== */

.asew-nav-content {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(0);
    transition: transform var(--asew-nav-transition-duration) var(--asew-nav-transition-easing),
                opacity var(--asew-nav-transition-duration) var(--asew-nav-transition-easing);
}

.asew-nav-content[hidden] {
    display: block;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

.asew-nav-content--main {
    position: relative;
}

.asew-nav-content--submenu {
    transform: translateX(100%);
}

.asew-nav-content--submenu.is-active {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

/* Animate main content when submenu is open */
.asew-nav-content--main.is-hidden {
    transform: translateX(-30%);
    opacity: 0;
}

/* ==========================================================================
   Headline (Categories Label)
   ========================================================================== */

.asew-nav-headline {
    padding: 20px 16px 16px;
    font-size: 14.7625px;
    font-weight: 700;
    color: var(--asew-nav-item-color);
}

/* ==========================================================================
   Category Headline (Submenu)
   ========================================================================== */

.asew-nav-category-headline {
    display: block;
    padding: 20px 16px 16px 16px;
    font-size: 14.7625px;
    font-weight: 700;
    color: var(--asew-nav-item-color);
    text-decoration: none;
}

.asew-nav-category-headline:hover {
    opacity: 0.8;
}

/* ==========================================================================
   Menu List
   ========================================================================== */

.asew-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
	border-top: 1px solid var(--asew-nav-border-color);
}

/* ==========================================================================
   Menu Items
   ========================================================================== */

.asew-nav-item {
    margin: 0;
}

/* Remove border from last menu item */
.asew-nav-item:last-child .asew-nav-link {
    /* border-bottom: none; */
}

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

.asew-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    color: var(--asew-nav-item-color);
    text-decoration: none;
    font-size: 14.7625px;
    font-weight: 400;
    border-bottom: 1px solid var(--asew-nav-border-color);
    background-color: var(--asew-nav-bg);
    transition: background-color 0.2s ease;
}

.asew-nav-link:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.asew-nav-link:focus-visible {
    outline: 2px solid var(--asew-nav-border-color);
    outline-offset: -2px;
}

/* ==========================================================================
   Link Text
   ========================================================================== */

.asew-nav-link-text {
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   Link Icons
   ========================================================================== */

.asew-nav-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 19.25px;
    height: 19.25px;
    color: var(--asew-nav-item-color);
}

.asew-nav-link-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==========================================================================
   Home Link (Show All Categories)
   ========================================================================== */

.asew-nav-link--home-all {
    justify-content: flex-start;
    background-color: var(--asew-nav-active-bg);
    font-weight: 400;
	margin-bottom: 16px;
}

.asew-nav-link--home-all:hover {
    background-color: var(--asew-nav-active-bg);
    opacity: 0.9;
}

.asew-nav-link--home-all .asew-nav-link-icon {
    margin-right: 4px;
}

/* ==========================================================================
   Back Link
   ========================================================================== */

.asew-nav-link--back {
    justify-content: flex-start;
    border-bottom: none;
    padding: 12px 16px;
    flex-shrink: 0;
    background-color: #FFFFFF;
}

.asew-nav-link--back .asew-nav-link-icon {
    margin-right: 4px;
    color: inherit;
}

/* ==========================================================================
   Navigation Controls (Back + View Category)
   ========================================================================== */

.asew-nav-controls {
    display: flex;
    align-items: stretch;
    background-color: var(--asew-nav-active-bg);
	border-top: 1px solid var(--asew-nav-active-bg);
	border-bottom: 1px solid var(--asew-nav-active-bg);
	margin-bottom: 16px;
}

.asew-nav-controls .asew-nav-link {
    border-bottom: none;
    background-color: transparent;
}

.asew-nav-controls .asew-nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   Current Category Link (View Category)
   ========================================================================== */

.asew-nav-link--current {
    flex: 1;
    color: var(--asew-nav-active-color);
    font-weight: 400;
}

.asew-nav-link--current .asew-nav-link-icon {
    width: auto;
}

/* ==========================================================================
   No Menu Message
   ========================================================================== */

.asew-nav-no-menu,
.asew-nav-editor-placeholder {
    padding: 20px 16px;
    color: var(--asew-nav-item-color);
    opacity: 0.7;
    font-style: italic;
    margin: 0;
}

/* ==========================================================================
   Elementor Editor Preview
   ========================================================================== */

.asew-nav-offcanvas--editor-preview {
    position: relative;
    visibility: visible;
    pointer-events: auto;
    width: 100%;
    max-width: var(--asew-nav-width);
    min-height: 400px;
    margin-top: 16px;
    border: 1px dashed #ccc;
}

.asew-nav-offcanvas--editor-preview .asew-nav-backdrop {
    display: none;
}

.asew-nav-offcanvas--editor-preview .asew-nav-panel {
    position: relative;
    transform: none;
    height: 100%;
    min-height: 400px;
}

/* ==========================================================================
   Animations - Keyframes
   ========================================================================== */

@keyframes asew-dropdown-fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes asew-dropdown-fade-out {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* ==========================================================================
   Animations - Menu Items Entrance
   ========================================================================== */

/* Initial state: items are invisible */
.asew-nav-offcanvas .asew-nav-item,
.asew-nav-offcanvas .asew-nav-headline,
.asew-nav-offcanvas .asew-nav-link--home-all,
.asew-nav-offcanvas .asew-nav-category-headline,
.asew-nav-offcanvas .asew-nav-controls,
.asew-nav-offcanvas .asew-nav-header {
    opacity: 0;
    transform: translateY(20px);
}

/* Header animates first */
.asew-nav-offcanvas.is-open .asew-nav-header {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.1s both;
}

/* When menu opens, animate items in with staggered delays */
.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-headline {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.15s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(1) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.2s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(2) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.25s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(3) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.3s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(4) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.35s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(5) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.4s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(6) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.45s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(7) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.5s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(8) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.55s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(9) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.6s both;
}

.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(10) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.65s both;
}

/* Fallback for items beyond 10 */
.asew-nav-offcanvas.is-open .asew-nav-content--main .asew-nav-item:nth-child(n+11) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.7s both;
}

/* ==========================================================================
   Animations - Submenu Items Entrance
   ========================================================================== */

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-link--home-all {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.1s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-category-headline {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.15s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-controls {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.2s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(1) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.25s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(2) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.3s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(3) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.35s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(4) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.4s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(5) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.45s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(6) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.5s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(7) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.55s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(8) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.6s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(9) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.65s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(10) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.7s both;
}

.asew-nav-offcanvas .asew-nav-content--submenu.is-active .asew-nav-item:nth-child(n+11) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.75s both;
}

/* ==========================================================================
   Animations - Exit Animation (Closing Menu)
   ========================================================================== */

.asew-nav-offcanvas.is-closing .asew-nav-item,
.asew-nav-offcanvas.is-closing .asew-nav-headline,
.asew-nav-offcanvas.is-closing .asew-nav-link--home-all,
.asew-nav-offcanvas.is-closing .asew-nav-category-headline,
.asew-nav-offcanvas.is-closing .asew-nav-controls,
.asew-nav-offcanvas.is-closing .asew-nav-header {
    animation: asew-dropdown-fade-out 0.2s ease-in both;
}

/* ==========================================================================
   Animations - Submenu Exit (Navigating Back)
   ========================================================================== */

.asew-nav-content--submenu.is-exiting .asew-nav-item,
.asew-nav-content--submenu.is-exiting .asew-nav-link--home-all,
.asew-nav-content--submenu.is-exiting .asew-nav-category-headline,
.asew-nav-content--submenu.is-exiting .asew-nav-controls {
    animation: asew-dropdown-fade-out 0.2s ease-in both;
}

/* ==========================================================================
   Animations - Content Enter (After Navigating Back)
   ========================================================================== */

.asew-nav-content--main.is-entering .asew-nav-headline,
.asew-nav-content--main.is-entering .asew-nav-item {
    opacity: 0;
    transform: translateY(20px);
}

.asew-nav-content--main.is-entering .asew-nav-headline {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.05s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(1) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.1s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(2) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.15s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(3) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.2s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(4) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.25s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(5) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.3s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(6) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.35s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(7) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.4s both;
}

.asew-nav-content--main.is-entering .asew-nav-item:nth-child(n+8) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.45s both;
}

/* Submenu entering animation (when navigating back to a previous submenu) */
.asew-nav-content--submenu.is-entering .asew-nav-link--home-all,
.asew-nav-content--submenu.is-entering .asew-nav-category-headline,
.asew-nav-content--submenu.is-entering .asew-nav-controls,
.asew-nav-content--submenu.is-entering .asew-nav-item {
    opacity: 0;
    transform: translateY(20px);
}

.asew-nav-content--submenu.is-entering .asew-nav-link--home-all {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.05s both;
}

.asew-nav-content--submenu.is-entering .asew-nav-category-headline {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.1s both;
}

.asew-nav-content--submenu.is-entering .asew-nav-controls {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.15s both;
}

.asew-nav-content--submenu.is-entering .asew-nav-item:nth-child(1) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.2s both;
}

.asew-nav-content--submenu.is-entering .asew-nav-item:nth-child(2) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.25s both;
}

.asew-nav-content--submenu.is-entering .asew-nav-item:nth-child(3) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.3s both;
}

.asew-nav-content--submenu.is-entering .asew-nav-item:nth-child(4) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.35s both;
}

.asew-nav-content--submenu.is-entering .asew-nav-item:nth-child(n+5) {
    animation: asew-dropdown-fade-in 0.3s ease-out 0.4s both;
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .asew-nav-offcanvas,
    .asew-nav-panel,
    .asew-nav-backdrop,
    .asew-nav-content,
    .asew-nav-link {
        transition-duration: 0.01ms !important;
    }

    .asew-nav-offcanvas .asew-nav-item,
    .asew-nav-offcanvas .asew-nav-headline,
    .asew-nav-offcanvas .asew-nav-link--home-all,
    .asew-nav-offcanvas .asew-nav-category-headline,
    .asew-nav-offcanvas .asew-nav-controls,
    .asew-nav-offcanvas .asew-nav-header {
        opacity: 1;
        transform: none;
        animation: none !important;
    }
}

/* ==========================================================================
   Focus Trap Helper (Visually Hidden)
   ========================================================================== */

.asew-nav-focus-trap {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
