/* ========================================
   PREMIUM MOBILE APP ENHANCEMENTS
   Optimized for mobile-first experience
   ======================================== */

/* 1. APP-LIKE SCROLLING & BASE */
html,
body {
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    padding-bottom: 80px;
}

/* 2. MOBILE SLIDE-UP MENU */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1998;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-slide-menu {
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    max-height: 70vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1999;
    overflow-y: auto;
}

.mobile-slide-menu.active {
    transform: translateY(0);
}

.menu-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto 20px;
}

.mobile-nav-links {
    padding: 0 20px 20px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    color: #333;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
}

.mobile-nav-item:active {
    background: rgba(192, 23, 224, 0.05);
    transform: scale(0.98);
}

.mobile-nav-item i:first-child {
    font-size: 1.2rem;
    color: var(--color-primary);
    width: 24px;
}

.mobile-dropdown {
    margin-top: 8px;
}

.dropdown-trigger {
    justify-content: space-between;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.mobile-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 40px;
}

.mobile-dropdown.active .mobile-dropdown-content {
    max-height: 500px;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.dropdown-item:active {
    background: rgba(192, 23, 224, 0.05);
    color: var(--color-primary);
}

/* 3. MOBILE RESPONSIVE STYLES */
@media (max-width: 768px) {

    /* Hide desktop navigation */
    .desktop-nav {
        display: none !important;
    }

    /* Hide footer on mobile */
    footer {
        display: none !important;
    }

    /* Optimize header for mobile */
    .premium-header {
        height: 60px;
    }

    .navbar-container {
        height: 60px;
        padding: 0 15px;
    }

    .logo-img {
        height: 35px;
    }

    /* Hero section optimization */
    .premium-hero-section {
        min-height: 400px !important;
    }

    .hero-title {
        font-size: 2rem !important;
    }

    .hero-description {
        font-size: 0.95rem !important;
    }

    /* Force 2-column grid for products */
    .grid.grid-3,
    .grid.grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    /* Product card mobile optimization */
    .premium-product-card {
        border-radius: 12px;
    }

    .premium-product-image {
        height: 180px !important;
    }

    .product-title {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }

    /* Hide sidebars */
    aside {
        display: none !important;
    }

    /* Full width containers */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Section padding reduction */
    .section-padding {
        padding: 60px 0 !important;
    }

    /* Desktop-only utilities */
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }
}

/* 4. PREMIUM BOTTOM NAVIGATION */
.bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background: #fff;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.05);
        z-index: 2000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #999;
        text-decoration: none;
        font-size: 10px;
        font-weight: 500;
        flex: 1;
        position: relative;
        padding: 8px 0;
        transition: all 0.2s ease;
    }

    .bottom-nav-item i {
        font-size: 20px;
        margin-bottom: 4px;
        transition: all 0.2s ease;
    }

    .bottom-nav-item.active {
        color: var(--color-primary);
    }

    .bottom-nav-item.active i {
        color: var(--color-primary);
        transform: scale(1.1);
    }

    .bottom-nav-item:active {
        transform: scale(0.95);
    }

    .cart-badge {
        position: absolute;
        top: 4px;
        right: calc(50% - 15px);
        background: linear-gradient(135deg, #FF7A00, #FF5722);
        color: white;
        border-radius: 10px;
        padding: 2px 6px;
        font-size: 9px;
        min-width: 16px;
        text-align: center;
        font-weight: 700;
        box-shadow: 0 2px 8px rgba(255, 122, 0, 0.4);
    }
}

/* 5. PWA & APP-LIKE FEATURES */
@media (max-width: 768px) {

    /* Smooth scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Touch optimization */
    button,
    a,
    input,
    select,
    textarea {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Pull to refresh indicator */
    body {
        overscroll-behavior-y: contain;
    }

    /* Safe area insets for notched devices */
    .premium-header {
        padding-top: env(safe-area-inset-top);
    }
}