/* 
 * Responsive Design
 * Mobile-first approach
 */

/* Hide scrollbar for horizontal sliders */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Snap scroll behavior */
.snap-x {
    scroll-snap-type: x mandatory;
}
.snap-start {
    scroll-snap-align: start;
}
.snap-mandatory {
    scroll-snap-type: x mandatory;
}

/* ============================================
   Tablet (768px and below)
   ============================================ */

@media (max-width: 768px) {
    /* Header */
    .top-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .top-bar-left,
    .top-bar-right {
        width: 100%;
        justify-content: center;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #ffffff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        z-index: 9999;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu > li {
        width: 100%;
    }
    
    .nav-menu > li > a {
        color: #1e293b;
        padding: 15px 10px;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-left: 20px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .dropdown.active .dropdown-menu {
        max-height: 500px;
    }
    
    /* Banner */
    .banner-slider,
    .carousel {
        height: 300px !important;
    }
    
    .banner-content h1 {
        font-size: 24px !important;
    }
    
    .banner-content p {
        font-size: 14px !important;
    }
    
    /* Product Cards - 2 columns on mobile */
    .grid-cols-2 {
        gap: 12px;
    }
    
    /* Better touch targets on mobile */
    .btn-xs {
        min-height: 2rem;
        padding: 0 0.75rem;
        font-size: 0.75rem;
    }
    
    .btn-sm {
        min-height: 2.5rem;
    }
    
    /* Category cards */
    .category-card {
        padding: 1rem !important;
    }
    
    /* Hide "Voir tout" text on mobile, show icon only */
    .md\\:flex.hidden {
        display: none !important;
    }
    
    /* Product card improvements for mobile */
    .line-clamp-2 {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }
    
    /* Banner */
    .banner-prev,
    .banner-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Sections */
    .section-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    /* Grids */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-title {
        font-size: 14px;
        height: 42px;
    }
    
    .current-price {
        font-size: 18px;
    }
    
    .old-price {
        font-size: 14px;
    }
    
    .add-to-cart-btn {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Newsletter */
    .newsletter-content h2 {
        font-size: 24px;
    }
    
    .newsletter-content p {
        font-size: 16px;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* Auth */
    .auth-box {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Mobile (480px and below)
   ============================================ */

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Header */
    .logo h1 {
        font-size: 22px;
    }
    
    .logo img {
        max-height: 40px;
    }
    
    .main-header {
        padding: 15px 0;
    }
    
    /* Banner */
    .banner-slider {
        height: 250px;
    }
    
    .banner-content h1 {
        font-size: 22px;
    }
    
    .banner-content p {
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* Sections */
    .features-section,
    .categories-section,
    .products-section,
    .newsletter-section {
        padding: 40px 0;
    }
    
    .section-header h2 {
        font-size: 20px;
    }
    
    /* Feature Items */
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .feature-item h3 {
        font-size: 16px;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-card {
        padding: 20px 15px;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        border-radius: 6px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 13px;
        height: 38px;
    }
    
    .current-price {
        font-size: 16px;
    }
    
    .old-price {
        font-size: 13px;
    }
    
    .add-to-cart-btn {
        padding: 8px;
        font-size: 13px;
    }
    
    .add-to-cart-btn span {
        display: none;
    }
    
    /* Newsletter */
    .newsletter-content h2 {
        font-size: 20px;
    }
    
    .newsletter-content p {
        font-size: 14px;
    }
    
    /* Footer */
    .footer-top {
        padding: 40px 0 20px;
    }
    
    .footer-col h3 {
        font-size: 18px;
    }
    
    /* Scroll to Top */
    .scroll-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .header,
    .footer,
    .scroll-to-top,
    .newsletter-section,
    .add-to-cart-btn {
        display: none !important;
    }
}

/* ============================================
   Cart & Checkout Page Responsive Fixes
   ============================================ */

@media (max-width: 768px) {
    /* Cart page grid */
    .lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }
    
    .lg\:col-span-2 {
        grid-column: span 1 !important;
    }
    
    /* Cart item layout */
    .cart-item-row {
        flex-direction: column;
    }
    
    /* Make cart summary full width on mobile */
    .lg\:col-span-1 {
        grid-column: span 1 !important;
    }
    
    /* Order summary sticky positioning */
    .sticky.top-20 {
        position: relative !important;
        top: 0 !important;
    }
    
    /* Quantity controls */
    .join .btn-xs {
        min-width: 32px;
        min-height: 32px;
    }
    
    .join .input-xs {
        width: 40px !important;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Progress steps - make more compact */
    .flex.items-center.justify-center.gap-2 {
        gap: 0.25rem !important;
    }
    
    /* Cart items - stack vertically */
    .cart-item .flex {
        flex-direction: column;
    }
    
    /* Smaller product images on very small screens */
    .w-24.sm\:w-32 {
        width: 80px !important;
    }
    
    /* Better quantity row layout */
    .flex-col.sm\:flex-row {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    /* Full width subtotal box */
    .text-right.bg-primary\/5 {
        width: 100%;
        text-align: center !important;
    }
}

/* ============================================
   Order Success Page Responsive Fixes
   ============================================ */

@media (max-width: 768px) {
    /* Order details grid */
    .grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Success icon smaller on mobile */
    .w-20.h-20 {
        width: 4rem !important;
        height: 4rem !important;
    }
    
    .w-20.h-20 .text-4xl {
        font-size: 2rem !important;
    }
    
    /* Heading smaller on mobile */
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    /* Order card padding */
    .p-6 {
        padding: 1rem !important;
    }
    
    /* Action buttons */
    .flex-col.sm\:flex-row {
        flex-direction: column !important;
    }
    
    .flex-1 {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Even smaller heading */
    h1.text-3xl {
        font-size: 1.25rem !important;
    }
    
    /* Badge size */
    .badge-lg {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Container padding */
    .container.mx-auto.px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Card max-width for very small screens */
    .max-w-2xl {
        max-width: 100% !important;
    }
}
