/**
 * =============================================
 * RESPONSIVE OPTIMIZATIONS - VÊT'CHIC
 * Optimisations UX Mobile & Conversion
 * =============================================
 */

/* ===== GLOBAL MOBILE OPTIMIZATIONS ===== */

/* Touch targets minimum 44px (Apple HIG) */
@media (max-width: 768px) {
    a, button, input[type="submit"], .luxe-menu-link, .luxe-mobile-nav-item {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Smooth scrolling everywhere */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* Better font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== HEADER MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    /* Reduce icon sizes on mobile for cleaner look */
    .luxe-top-icons {
        gap: clamp(6px, 1.2vw, 8px);
    }
    
    .luxe-top-icon,
    .luxe-top-menu-toggle {
        width: 34px;
        height: 34px;
        padding: 6px;
    }
    
    .luxe-top-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* ===== BOTTOM NAV MOBILE - ENHANCED ===== */
@media (max-width: 768px) {
    .luxe-mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(212, 175, 55, 0.2);
        z-index: 900;
        padding: 6px 0 env(safe-area-inset-bottom, 6px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .luxe-mobile-bottom-nav-container {
        display: flex;
        justify-content: space-around;
        align-items: center;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .luxe-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        text-decoration: none;
        color: #666;
        font-size: 0.65rem;
        font-weight: 500;
        padding: 4px 8px;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-height: 44px;
        justify-content: center;
    }
    
    .luxe-mobile-nav-item svg {
        width: 20px;
        height: 20px;
        stroke-width: 1.8;
    }
    
    .luxe-mobile-nav-item.active {
        color: #D4AF37;
    }
    
    .luxe-mobile-nav-item:active {
        transform: scale(0.92);
        background: rgba(212, 175, 55, 0.08);
    }
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .luxe-mobile-bottom-nav {
        display: none;
    }
}

/* ===== CTA BUTTON - ENHANCED FOR CONVERSION ===== */
@media (max-width: 768px) {
    .luxe-cta-fixed {
        bottom: calc(60px + env(safe-area-inset-bottom, 6px));
        padding: 0 16px;
    }
    
    .luxe-cta-button {
        display: block;
        width: 100%;
        padding: 14px 24px;
        font-size: 0.95rem;
        font-weight: 600;
        text-align: center;
        border-radius: 12px;
        text-decoration: none;
        letter-spacing: 0.02em;
    }
}

/* ===== SINGLE PRODUCT - MOBILE UX ===== */
@media (max-width: 767px) {
    /* Ensure content doesn't hide behind fixed bottom elements */
    .adj-single-product {
        padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }
    
    /* Better image gallery on mobile */
    .adj-main-image-container {
        border-radius: 16px;
        margin-bottom: 12px;
    }
    
    /* Thumbnails horizontal scroll */
    .adj-thumbnails {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding: 4px 0;
    }
    
    .adj-thumbnails::-webkit-scrollbar {
        display: none;
    }
    
    /* Product info better spacing */
    .adj-product-info {
        padding: 16px 12px;
    }
    
    /* Price more prominent for conversion */
    .adj-current-price {
        font-size: clamp(1.4rem, 5vw, 1.8rem);
        color: #D4AF37;
        font-weight: 800;
    }
    
    /* CTA buttons sticky bottom for conversion */
    .adj-product-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 901;
        display: flex;
        gap: 8px;
        border-top: 2px solid #D4AF37;
    }
    
    .adj-product-actions .adj-btn {
        flex: 1;
        min-height: 48px;
        border-radius: 12px;
        font-weight: 600;
        font-size: 0.85rem;
    }
    
    /* WhatsApp button more prominent */
    .adj-btn-whatsapp {
        background: linear-gradient(135deg, #25D366, #128C7E);
        color: #fff;
    }
    
    /* Related products horizontal scroll on mobile */
    .adj-related-grid {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding: 0 16px 16px;
        scrollbar-width: none;
    }
    
    .adj-related-grid::-webkit-scrollbar {
        display: none;
    }
    
    .adj-related-item {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }
}

/* ===== ARCHIVE/SHOP - MOBILE GRID ===== */
@media (max-width: 480px) {
    /* 2 columns on mobile for better browsing */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 8px;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-image-hd {
        height: 180px;
        border-radius: 12px 12px 0 0;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-info h3 {
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .product-info .price {
        font-size: 1rem;
        font-weight: 700;
        color: #D4AF37;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 12px;
    }
    
    .product-image-hd {
        height: 220px;
    }
}

/* ===== FILTERS - MOBILE OPTIMIZED ===== */
@media (max-width: 768px) {
    .shop-filters {
        padding: 16px 0;
    }
    
    .filters-grid {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding: 0 12px;
        scrollbar-width: none;
    }
    
    .filters-grid::-webkit-scrollbar {
        display: none;
    }
    
    .filter-select {
        flex: 0 0 auto;
        min-width: 140px;
        padding: 10px 14px;
        font-size: 0.85rem;
        border-radius: 20px;
        border: 1px solid rgba(212, 175, 55, 0.3);
        background: #fff;
        white-space: nowrap;
    }
}

/* ===== HERO SECTION - MOBILE ===== */
@media (max-width: 768px) {
    .luxe-hero-section {
        min-height: 100vh;
        min-height: 100svh; /* Small viewport height for mobile browsers */
    }
}

/* ===== FOOTER - MOBILE OPTIMIZED ===== */
@media (max-width: 768px) {
    /* Add padding for bottom nav */
    .luxe-footer-main {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
    
    .social-grid {
        display: flex;
        gap: 12px;
        justify-content: center;
    }
    
    .social-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ===== ANIMATIONS - REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== SAFE AREA INSETS (iPhone notch) ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .luxe-mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    .adj-product-actions {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
/* GPU acceleration for animated elements */
.luxe-single-logo,
.luxe-menu-container,
.luxe-menu-overlay,
.luxe-hero-section,
.luxe-cta-fixed,
.luxe-mobile-bottom-nav,
.adj-product-actions {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Lazy loading images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded,
img[loading="lazy"][src] {
    opacity: 1;
}

/* ===== PRINT STYLES ===== */
@media print {
    .luxe-top-icons,
    .luxe-social-icons-fixed,
    .luxe-mobile-bottom-nav,
    .luxe-cta-fixed,
    .luxe-menu-container,
    .luxe-menu-overlay,
    .adj-product-actions {
        display: none !important;
    }
}
