/**
 * Mobile Drawer Styles
 *
 * Slide-in drawer menu for mobile navigation with glass-morphism effect.
 *
 * @package flavor_flavor_flavor
 * @version 1.1.0
 */

/* ==========================================================================
   Drawer Overlay
   ========================================================================== */

.bne-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--bne-duration-normal) ease,
                visibility var(--bne-duration-normal) ease;
    z-index: var(--bne-z-overlay);
}

.bne-drawer-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Drawer Container
   ========================================================================== */

.bne-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85vw;
    max-width: 320px;
    background: var(--bne-glass-bg-light);
    backdrop-filter: var(--bne-glass-blur-strong);
    -webkit-backdrop-filter: var(--bne-glass-blur-strong);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform var(--bne-duration-normal) var(--bne-ease-out);
    z-index: var(--bne-z-drawer);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;

    /* Safe area for notch devices */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
}

.bne-drawer.is-open {
    transform: translateX(0);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(16px)) {
    .bne-drawer {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* ==========================================================================
   Drawer Header
   ========================================================================== */

.bne-drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--bne-space-4);
    border-bottom: 1px solid var(--bne-border-gray);
    flex-shrink: 0;
}

.bne-drawer__logo {
    max-height: 40px;
    width: auto;
}

.bne-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    border-radius: var(--bne-radius-md);
    color: var(--bne-dark-gray);
    cursor: pointer;
    transition: background var(--bne-transition-fast), color var(--bne-transition-fast);
}

.bne-drawer__close:hover,
.bne-drawer__close:focus {
    background: rgba(0, 0, 0, 0.05);
}

.bne-drawer__close:focus-visible {
    outline: 2px solid var(--bne-primary-blue);
    outline-offset: 2px;
}

.bne-drawer__close svg {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   Drawer Navigation
   ========================================================================== */

.bne-drawer__nav {
    flex: 1;
    padding: var(--bne-space-4);
    overflow-y: auto;
    max-height: calc(100vh - 180px);
}

.bne-drawer__menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bne-drawer__menu li {
    margin: 0;
}

.bne-drawer__menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: var(--bne-space-3) var(--bne-space-4);
    font-size: var(--bne-font-size-lg);
    font-weight: var(--bne-font-medium);
    color: var(--bne-dark-gray);
    text-decoration: none;
    border-radius: var(--bne-radius-md);
    transition: background var(--bne-transition-fast), color var(--bne-transition-fast);
}

.bne-drawer__menu a:hover,
.bne-drawer__menu a:focus {
    background: var(--bne-primary-blue-100);
    color: var(--bne-primary-blue);
}

.bne-drawer__menu .current-menu-item a {
    background: var(--bne-primary-blue-100);
    color: var(--bne-primary-blue);
    font-weight: var(--bne-font-semibold);
}

/* Sub-menu items */
.bne-drawer__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 var(--bne-space-4);
}

.bne-drawer__menu .sub-menu a {
    font-size: var(--bne-font-size-base);
    min-height: 44px;
    padding-left: var(--bne-space-6);
}

/* ==========================================================================
   Drawer Footer
   ========================================================================== */

.bne-drawer__footer {
    padding: var(--bne-space-4);
    border-top: 1px solid var(--bne-border-gray);
    margin-top: auto;
    flex-shrink: 0;
}

.bne-drawer__phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bne-space-2);
    min-height: 48px;
    padding: var(--bne-space-3) var(--bne-space-4);
    background: var(--bne-gradient-primary);
    color: var(--bne-white);
    font-weight: var(--bne-font-semibold);
    text-decoration: none;
    border-radius: var(--bne-radius-md);
    box-shadow: var(--bne-shadow-primary);
    transition: transform var(--bne-transition-fast), box-shadow var(--bne-transition-fast);
}

.bne-drawer__phone:hover {
    transform: translateY(-2px);
    box-shadow: var(--bne-shadow-primary-lg);
    color: var(--bne-white);
}

.bne-drawer__phone svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================================
   Body Scroll Lock
   ========================================================================== */

body.drawer-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Desktop - Hide Drawer
   ========================================================================== */

@media (min-width: 1024px) {
    .bne-drawer,
    .bne-drawer-overlay {
        display: none !important;
    }
}

/* ==========================================================================
   Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .bne-drawer,
    .bne-drawer-overlay {
        transition: none;
    }
}
