/*
 * 805StreetFoods - Mobile Navigation System
 * App-like navigation experience for mobile devices
 */

/* ==================== HAMBURGER MENU BUTTON ==================== */

.hamburger-btn {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    z-index: 1002;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 5px;
}

.hamburger-icon span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-glass-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
    transform-origin: center;
}

/* Animated X when menu is open */
.hamburger-btn.active .hamburger-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==================== MOBILE SLIDE-OUT MENU ==================== */

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1000;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: linear-gradient(
        180deg,
        rgba(20, 20, 30, 0.95) 0%,
        rgba(15, 15, 25, 0.98) 100%
    );
    backdrop-filter: var(--blur-xl) saturate(180%);
    -webkit-backdrop-filter: var(--blur-xl) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        -10px 0 40px rgba(0, 0, 0, 0.4),
        inset 1px 0 0 rgba(255, 255, 255, 0.1);
    padding: var(--space-2xl) var(--space-lg);
    overflow-y: auto;
    transition: right var(--transition-base);
    z-index: 1001;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mobile-menu-brand {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-glass-primary);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-glass-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
    color: var(--text-glass-primary);
    background: linear-gradient(
        90deg,
        rgba(255, 102, 0, 0.15) 0%,
        rgba(255, 0, 128, 0.1) 100%
    );
}

.mobile-nav-links a i {
    font-size: 1.4rem;
    width: 28px;
    text-align: center;
    color: var(--brand-orange);
}

.mobile-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--space-md) 0;
}

.mobile-nav-cta {
    margin-top: var(--space-xl);
}

.mobile-nav-cta .btn-glass-primary {
    width: 100%;
    justify-content: center;
}

/* ==================== BOTTOM NAVIGATION BAR ==================== */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(
        180deg,
        rgba(20, 20, 30, 0.92) 0%,
        rgba(15, 15, 25, 0.98) 100%
    );
    backdrop-filter: var(--blur-lg) saturate(200%);
    -webkit-backdrop-filter: var(--blur-lg) saturate(200%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 -4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-glass-muted);
    font-size: 0.7rem;
    font-weight: 500;
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-width: 60px;
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.5rem;
    transition: all var(--transition-fast);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--brand-orange);
}

.bottom-nav-item.active i {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px var(--glow-primary));
}

/* Active indicator dot */
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand-orange);
    box-shadow: 0 0 8px var(--glow-primary);
}

/* CTA button in bottom nav */
.bottom-nav-cta {
    background: linear-gradient(
        135deg,
        var(--brand-orange) 0%,
        var(--brand-hot-pink) 100%
    );
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-md);
    color: white !important;
    font-weight: 600;
    box-shadow:
        0 4px 12px rgba(255, 102, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.bottom-nav-cta i {
    color: white !important;
}

.bottom-nav-cta:hover {
    transform: scale(1.05);
}

/* ==================== PAGE CONTENT PADDING FOR BOTTOM NAV ==================== */

body.has-bottom-nav {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

body.has-bottom-nav .footer-glass {
    padding-bottom: calc(var(--space-xl) + 70px + env(safe-area-inset-bottom, 0px));
}

/* ==================== MOBILE RESPONSIVE BREAKPOINTS ==================== */

/* Tablet and below */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .nav-links {
        display: none !important;
    }

    .bottom-nav {
        display: block;
    }

    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    /* Adjust footer for bottom nav */
    .footer-glass {
        padding-bottom: calc(var(--space-xl) + 80px);
    }

    /* Seasonal badge positioning */
    .seasonal-badge {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }

    .seasonal-toggle {
        bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }
}

/* Small phones */
@media (max-width: 375px) {
    .mobile-menu {
        width: 280px;
    }

    .bottom-nav-item {
        min-width: 50px;
        font-size: 0.65rem;
    }

    .bottom-nav-item i {
        font-size: 1.3rem;
    }

    .bottom-nav-cta {
        padding: var(--space-xs) var(--space-sm);
    }
}

/* Large phones */
@media (min-width: 376px) and (max-width: 425px) {
    .bottom-nav-item {
        min-width: 55px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .bottom-nav {
        height: 60px;
    }

    .bottom-nav-item i {
        font-size: 1.3rem;
    }

    .bottom-nav-item span {
        display: none;
    }

    body {
        padding-bottom: 60px;
    }
}

/* ==================== TOUCH OPTIMIZATIONS ==================== */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .bottom-nav-item {
        min-height: 48px;
        min-width: 64px;
    }

    .mobile-nav-links a {
        min-height: 48px;
    }

    /* Active state feedback */
    .bottom-nav-item:active {
        transform: scale(0.95);
    }

    .mobile-nav-links a:active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ==================== REDUCED MOTION ==================== */

@media (prefers-reduced-motion: reduce) {
    .mobile-menu,
    .mobile-menu-overlay,
    .hamburger-icon span,
    .bottom-nav-item,
    .bottom-nav-item i {
        transition: none !important;
    }
}

/* ==================== HIDE BOTTOM NAV ON PRINT ==================== */

@media print {
    .bottom-nav,
    .mobile-menu,
    .mobile-menu-overlay,
    .hamburger-btn {
        display: none !important;
    }
}
