/**
 * Responsive Styles - Mobile First
 * Breakpoints: Mobile (<768px), Tablet (768-1024px), Desktop (>1024px)
 */

/* ==========================================
   MARQUEE BANNER - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .marquee-track {
        animation: marquee 7.5s linear infinite;
    }
}

/* ==========================================
   MOBILE MENU
   ========================================== */

@media (max-width: 768px) {
    /* Hamburger Button */
    .mobile-menu-toggle {
        display: block !important;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 1001;
        position: relative;
    }

    .mobile-menu-toggle span {
        display: block;
        width: 24px;
        height: 2px;
        background: var(--text-primary);
        margin: 5px 0;
        transition: all 0.3s;
    }

    /* Hide desktop nav */
    .header-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
        z-index: 10000;
        padding: 80px 24px 24px;
        overflow-y: auto;
    }

    .header-nav.active {
        left: 0;
    }

    .header-nav a {
        display: block;
        padding: 16px 0;
        border-bottom: 1px solid #f3f4f6;
        font-size: 16px;
    }

    /* Mobile Nav - Position Fixed pour s'afficher par-dessus */
    .mobile-nav {
        position: fixed !important;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(246, 244, 240, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid #ddd8ce;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        padding: 0 24px;
    }

    .mobile-nav.open {
        max-height: 400px;
        padding: 16px 24px;
    }

    .mobile-nav a {
        display: block;
        padding: 16px 0;
        border-bottom: 1px solid #f3f4f6;
        font-size: 16px;
        font-weight: 500;
        color: var(--luxury-text-primary);
        text-decoration: none;
        transition: color 0.2s ease;
    }

    .mobile-nav a:hover {
        color: var(--luxury-rose-gold);
    }

    .mobile-nav a:last-child {
        border-bottom: none;
    }

    /* Overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        z-index: 999;
    }

    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Header au-dessus de tout */
    .site-header {
        position: sticky;
        z-index: 1002;
    }
}

/* ==========================================
   HEADER
   ========================================== */

@media (max-width: 768px) {
    .site-header {
        padding: 0;
    }

    .header-inner {
        gap: 12px;
        padding: 12px 16px;
    }

    .header-logo-img {
        height: 48px;
    }

    .header-icons {
        gap: 8px;
    }

    .icon-btn {
        width: 44px;
        height: 44px;
    }

    .icon-btn svg {
        width: 24px;
        height: 24px;
    }

    .burger-btn {
        width: 44px;
        height: 44px;
    }

    .burger-btn svg {
        width: 28px;
        height: 28px;
    }

    .badge {
        width: 18px;
        height: 18px;
        font-size: 11px;
        top: -2px;
        right: -2px;
    }
}

/* ==========================================
   PRODUCT GRIDS - Horizontal Scroll
   ========================================== */

@media (max-width: 768px) {
    /* Sections avec scroll horizontal */
    .products-grid-scroll {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding: 16px 0;
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .products-grid-scroll::-webkit-scrollbar {
        height: 6px;
    }

    .products-grid-scroll::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 3px;
    }

    .products-grid-scroll::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

    .products-grid-scroll .product-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }

    /* Prix dans TOUTES les cartes produits - Partout sur le site */
    .price-row {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .price-old,
    span.price-old,
    del {
        font-size: 16px !important;
        font-weight: 400 !important;
        color: #9ca3af !important;
        text-decoration: line-through !important;
    }

    .product-price,
    span.product-price {
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #000 !important;
    }

    /* Prix dans les sections spéciales */
    .offer-product-info .price-old,
    .best-product-info .price-old,
    .offer-product-info del,
    .best-product-info del {
        font-size: 15px !important;
        font-weight: 400 !important;
        color: #9ca3af !important;
    }

    .offer-product-info .product-price,
    .best-product-info .product-price {
        font-size: 18px !important;
        font-weight: 700 !important;
    }

    /* Best Selling - Réduire la hauteur des images promo en mode mobile */
    .best-promo-card {
        min-height: 180px !important;
        max-height: 200px !important;
        padding: 24px !important;
        padding-bottom: 48px !important;
        background-size: cover !important;
        background-position: center !important;
    }

    .best-promo-content h3 {
        font-size: 20px !important;
    }

    .best-promo-content p {
        font-size: 16px !important;
        margin-bottom: 16px !important;
    }

    .btn-white {
        padding: 10px 24px !important;
        font-size: 12px !important;
    }

    /* Prix dans la section Nouveaux Produits (Featured Products Slider) - FORCER */
    .featured-products .product-card .price-row,
    .slider-track .product-card .price-row,
    #sliderTrack .product-card .price-row {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .featured-products .product-card .price-old,
    .slider-track .product-card .price-old,
    #sliderTrack .product-card .price-old,
    .featured-products .product-card span.price-old,
    .slider-track .product-card span.price-old,
    #sliderTrack .product-card span.price-old,
    .featured-products .product-card del,
    .slider-track .product-card del,
    #sliderTrack .product-card del,
    .product-info del,
    .product-card del {
        font-size: 16px !important;
        font-weight: 400 !important;
        color: #9ca3af !important;
        text-decoration: line-through !important;
    }

    .featured-products .product-card .product-price,
    .slider-track .product-card .product-price,
    #sliderTrack .product-card .product-price,
    .featured-products .product-card span.product-price,
    .slider-track .product-card span.product-price,
    #sliderTrack .product-card span.product-price {
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #000 !important;
    }

    /* Bouton Ajouter au panier - Une seule ligne */
    .btn-add-cart {
        font-size: 11px;
        padding: 14px 12px;
        white-space: nowrap;
        gap: 8px;
    }

    .btn-add-cart svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    /* Grilles normales (products page) */
    .products-grid:not(.products-grid-scroll) {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* ==========================================
   HOMEPAGE
   ========================================== */

@media (max-width: 768px) {
    /* Hero Section */
    .hero {
        min-height: 500px;
    }
    
    .hero-content {
        min-height: 500px;
    }
    
    .hero-inner {
        padding: 40px 16px;
        text-align: center;
    }
    
    .hero-section {
        padding: 40px 16px;
        text-align: center;
    }

    .hero-section h1 {
        font-size: 32px;
    }

    .hero-section p {
        font-size: 16px;
    }
    
    /* Hero Background - Mobile Image */
    .hero-bg[data-mobile-image] {
        background-image: var(--mobile-bg-image) !important;
    }

    /* Sections */
    .section {
        padding: 40px 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-title {
        font-size: 24px;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .categories h2 {
        font-size: 24px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cat-card {
        width: 60%;
        margin: 0 auto;
    }

    /* Offer Products - Scroll Horizontal */
    .offer-products {
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        gap: 16px !important;
        padding: 16px 0;
        padding-left: 16px !important;
        padding-right: 16px;
    }

    .offer-products::-webkit-scrollbar {
        height: 6px;
    }

    .offer-products::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 3px;
    }

    .offer-products::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

    .offer-product {
        flex: 0 0 280px;
        scroll-snap-align: start;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .offer-product-img {
        width: 100% !important;
        height: 200px !important;
    }

    .offer-product-info {
        width: 100%;
    }

    /* Testimonials - Scroll horizontal */
    .testimonials-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding: 16px 0;
        padding-left: 30px !important;
        padding-right: 16px;
    }

    .testimonials-grid::-webkit-scrollbar {
        height: 6px;
    }

    .testimonials-grid::-webkit-scrollbar-track {
        background: #f3f4f6;
        border-radius: 3px;
    }

    .testimonials-grid::-webkit-scrollbar-thumb {
        background: var(--primary);
        border-radius: 3px;
    }

    .testimonial-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }
}

/* ==========================================
   PRODUCT DETAIL
   ========================================== */

@media (max-width: 768px) {
    .product-detail-layout {
        flex-direction: column;
    }

    .product-images,
    .product-info {
        width: 100%;
    }

    .product-gallery {
        flex-direction: column-reverse;
    }

    .product-thumbnails {
        flex-direction: row;
        overflow-x: auto;
    }

    .product-thumbnail {
        flex: 0 0 60px;
    }

    /* Tabs */
    .product-tabs {
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }
}

/* ==========================================
   CHECKOUT
   ========================================== */

@media (max-width: 768px) {
    .checkout-layout {
        flex-direction: column;
    }

    .checkout-form,
    .checkout-summary {
        width: 100%;
    }

    /* Formulaire EN HAUT */
    .checkout-form {
        order: 1;
        width: 100%;
    }

    /* Carte résumé EN BAS */
    .checkout-summary {
        order: 2;
        position: static;
        margin-top: 24px;
        max-height: none;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    /* Cart items */
    .cart-item {
        padding: 12px;
        gap: 10px;
    }

    .cart-item img {
        width: 60px !important;
        height: 60px !important;
    }

    /* Boutons pleine largeur */
    .checkout-form button[type="submit"],
    .btn-place-order {
        width: 100%;
        padding: 16px;
        font-size: 16px;
    }

    /* Résumé compact */
    .order-summary-card {
        padding: 16px;
    }

    .summary-row {
        font-size: 14px;
    }

    .summary-total {
        font-size: 18px;
    }
}

/* ==========================================
   ACCOUNT PAGE
   ========================================== */

@media (max-width: 768px) {
    .account-layout {
        flex-direction: column;
    }

    .account-sidebar {
        width: 100%;
        position: static;
    }

    .account-nav {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 12px 0;
    }

    .account-nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 14px;
    }

    .account-nav-item svg {
        display: none;
    }

    .account-content {
        width: 100%;
        padding: 16px;
    }

    /* Dashboard Stats */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    /* Orders Table */
    .orders-table-container {
        overflow-x: auto;
    }

    .orders-table {
        min-width: 600px;
    }

    /* Favorites */
    .favorites-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ==========================================
   FOOTER
   ========================================== */

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .footer-brand {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .footer-brand img {
        margin: 0 auto 16px;
    }

    .footer-col {
        text-align: center;
    }

    /* Masquer la colonne Support en mode mobile */
    .footer-col:nth-child(2) {
        display: none !important;
    }

    /* Centrer la colonne Contactez-Nous */
    .footer-col:nth-child(4) {
        text-align: center;
    }

    .footer-col:nth-child(4) .footer-contact {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .footer-col:nth-child(4) .footer-contact li {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
}

/* ==========================================
   UTILITIES
   ========================================== */

@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Hide on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Show only on mobile */
    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .show-mobile {
        display: none !important;
    }
}

/* ==========================================
   TABLET SPECIFIC
   ========================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding-left: 24px;
        padding-right: 24px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .favorites-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* ==========================================
   PRODUCT DETAIL PAGE IMPROVEMENTS
   ========================================== */

/* Gallery Improvements */
.gallery-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #f0f0f0;
}

.gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbs::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-thumb:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.gallery-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Related Products Section */
.related-products {
    margin-top: 80px;
    padding-top: 80px;
    border-top: 1px solid var(--border);
}

.related-products .section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 48px;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}

.related-products .products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Product Actions Button Improvements */
.product-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.product-actions .btn-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.product-actions .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-actions .btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* Loading Spinner Animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .related-products .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .related-products {
        margin-top: 60px;
        padding-top: 60px;
    }
    
    .related-products .section-title {
        font-size: 28px;
        margin-bottom: 36px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .related-products .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .related-products {
        margin-top: 48px;
        padding-top: 48px;
    }
    
    .related-products .section-title {
        font-size: 24px;
        margin-bottom: 24px;
    }
    
    .gallery-thumbs {
        gap: 8px;
    }
    
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions .icon-btn {
        width: 100% !important;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .related-products .products-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-thumb {
        width: 50px;
        height: 50px;
    }
}
