/* ============================================
   TABLE DES MATIÈRES
   ============================================
   1.  VARIABLES & RESET
   2.  COMPOSANTS DE BASE
   3.  HEADER & NAVIGATION
   4.  ESPACE PUBLICITAIRE
   5.  PRODUITS & CARTES
   6.  BOUTONS
   7.  MENU FIXE BAS
   8.  MODAL DE COMMANDE
   9.  FORMULAIRES
   10. NOTIFICATIONS & TOASTS
   11. RAPPEL DE PANIER
   12. BADGE FLOTTANT
   13. RECHERCHE & SUGGESTIONS
   14. FILTRES & CATÉGORIES
   15. FOOTER
   16. PAGES SPÉCIFIQUES
   17. ANIMATIONS
   18. RESPONSIVE
   19. UTILITAIRES
   20. THÈMES (CLAIR/SOMBRE/AUTO)
   ============================================ */

/* ========== 1. VARIABLES & RESET ========== */
:root {
    --primary-color: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FF8A5C;
    --secondary-color: #2C3E50;
    --secondary-dark: #1A252F;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #343a40;
    --light: #f8f9fa;
    --white: #FFFFFF;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    /* Variables spécifiques au thème (surchargées par les classes body) */
    --background: #F5F5F5;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    
    /* Ombres et effets */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.2);
    --radius-sm: 5px;
    --radius: 10px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    --radius-circle: 50%;
    --transition-fast: 0.2s ease;
    --transition: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== 2. COMPOSANTS DE BASE ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 70px;
    transition: background-color var(--transition), color var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ========== 3. HEADER & NAVIGATION ========== */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 12px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: background-color var(--transition), box-shadow var(--transition);
    max-width: 100%;
    overflow-x: hidden;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.search-bar {
    position: relative;
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.search-bar input {
    flex: 1;
    min-width: 0;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-bar button {
    background: var(--primary-color);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-circle);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-bar button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.cart-icon {
    position: relative;
}

.cart-icon a {
    color: var(--secondary-color);
    font-size: 24px;
    transition: color var(--transition-fast);
}

.cart-icon a:hover {
    color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-circle);
    padding: 2px 6px;
    font-size: 11px;
    min-width: 18px;
    text-align: center;
    font-weight: bold;
    transition: transform var(--transition-fast);
}

/* ========== 4. ESPACE PUBLICITAIRE ========== */
.ad-space {
    margin-top: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 10px 5px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.ad-carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.ad-slide {
    display: none;
    text-align: center;
    animation: fadeIn var(--transition);
}

.ad-slide.active {
    display: block;
}

.ad-slide img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.ad-caption {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 8px;
    font-size: 14px;
    backdrop-filter: blur(5px);
}

.ad-prev, .ad-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition-fast);
}

.ad-prev:hover, .ad-next:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.05);
}

.ad-prev { left: 10px; }
.ad-next { right: 10px; }

.ad-dots {
    text-align: center;
    padding: 10px;
}

.ad-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-circle);
    background: rgba(255,255,255,0.5);
    margin: 0 5px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ad-dot.active {
    background: var(--primary-color);
    width: 20px;
    border-radius: 10px;
}

/* ========== 5. PRODUITS & CARTES ========== */
.products-slider {
    padding: 20px;
    height: calc(100vh - 200px);
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

.swipe-indicator {
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    animation: bounce 1s infinite;
}

.product-card {
    scroll-snap-align: start;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    border: 1px solid var(--border-color);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.badge.stock-low {
    background: var(--warning);
    color: var(--dark);
}

.badge.stock-out {
    background: var(--danger);
    color: white;
}

.badge.new {
    background: var(--success);
    color: white;
}

.badge.promo {
    background: var(--primary-color);
    color: white;
}

.product-image {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.product-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.quick-view {
    background: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform var(--transition);
}

.quick-view:hover {
    transform: scale(1.05);
}

.product-info {
    padding: 15px 0 0;
}

.product-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.product-rating {
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-rating i {
    color: #ffc107;
    font-size: 12px;
}

.rating-count {
    font-size: 11px;
    color: var(--text-secondary);
}

.product-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 10px 0;
    line-height: 1.4;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 10px 0;
}

.current-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.old-price {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 14px;
}

.stock-info {
    margin: 10px 0;
}

.stock-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.stock-fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    transition: width var(--transition);
}

.stock-text {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 5px;
    display: block;
}

/* ========== 6. BOUTONS ========== */
.product-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-add, .btn-buy, .btn-out-of-stock, .btn-notify {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add {
    background: var(--secondary-color);
    color: white;
}

.btn-add:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

.btn-buy {
    background: var(--primary-color);
    color: white;
}

.btn-buy:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-out-of-stock {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-notify {
    background: var(--info);
    color: white;
}

.btn-notify:hover {
    background: #138496;
}

/* ========== 7. MENU FIXE BAS ========== */
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 12px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    border-top: 1px solid var(--border-color);
}

.category-dropdown {
    text-align: center;
}

.category-dropdown select {
    width: 90%;
    padding: 12px 16px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-dropdown select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

/* ========== 8. MODAL DE COMMANDE ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-primary);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: var(--radius-xl);
    overflow-y: auto;
    animation: modalSlideIn var(--transition);
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    font-size: 28px;
    cursor: pointer;
    transition: transform var(--transition);
    line-height: 1;
}

.close-modal:hover {
    transform: rotate(90deg);
}

.modal-content form {
    padding: 20px;
}

/* ========== 9. FORMULAIRES ========== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group label i {
    color: var(--primary-color);
    margin-right: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.help-text {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.recap {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 15px;
    margin: 20px 0;
}

.recap h3 {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--text-primary);
}

.recap-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.recap-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 0;
}

.recap-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    margin-top: 10px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-finalize {
    flex: 2;
    background: var(--success);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all var(--transition);
}

.btn-finalize:hover {
    background: #218838;
    transform: scale(1.02);
}

.btn-cancel-order {
    flex: 1;
    background: var(--gray-600);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
}

.btn-cancel-order:hover {
    background: var(--gray-700);
}

/* ========== 10. NOTIFICATIONS & TOASTS ========== */
.notification-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius);
    z-index: 10000;
    animation: slideInRight var(--transition);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast {
    visibility: hidden;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    border-radius: 50px;
    padding: 12px 24px;
    z-index: 2100;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

.toast.show {
    visibility: visible;
    animation: toastFadeIn 0.3s, toastFadeOut 0.3s 2.7s;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== 11. RAPPEL DE PANIER ========== */
.cart-reminder-bar {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
}

.cart-reminder-bar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.reminder-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    gap: 10px;
    flex-wrap: wrap;
}

.reminder-icon {
    position: relative;
    font-size: 24px;
}

.reminder-count {
    position: absolute;
    top: -8px;
    right: -12px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-circle);
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.reminder-message {
    flex: 1;
    font-size: 13px;
}

.reminder-message strong {
    display: block;
    margin-bottom: 3px;
}

.reminder-message span {
    font-size: 11px;
    opacity: 0.9;
}

.reminder-actions {
    display: flex;
    gap: 8px;
}

.reminder-btn-cart {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: transform var(--transition-fast);
}

.reminder-btn-cart:hover {
    transform: scale(1.05);
}

.reminder-btn-close {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-circle);
    cursor: pointer;
    font-size: 14px;
    transition: background var(--transition-fast);
}

.reminder-btn-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ========== 12. BADGE FLOTTANT ========== */
.floating-cart-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    width: 55px;
    height: 55px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    z-index: 999;
    transition: transform var(--transition);
    animation: pulse 2s infinite;
}

.floating-cart-badge:hover {
    transform: scale(1.1);
}

.floating-cart-badge i {
    font-size: 24px;
    color: white;
}

.floating-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-circle);
    width: 22px;
    height: 22px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ========== 13. RECHERCHE & SUGGESTIONS ========== */
.search-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.suggestions-header {
    padding: 10px 15px;
    background: var(--bg-secondary);
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.suggestion-item:hover {
    background: var(--bg-secondary);
}

.suggestion-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.suggestion-item div {
    flex: 1;
    min-width: 0;
}

.suggestion-item strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-item span {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: bold;
}

.suggestions-footer {
    padding: 10px 15px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
}

.suggestions-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    display: block;
}

/* Overlay pour fermer les suggestions */
#suggestions-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9999;
    display: none;
}

/* Version mobile - suggestions style bottom sheet */
@media (max-width: 768px) {
    .search-suggestions {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-height: 60vh;
        border-radius: var(--radius-lg);
        box-shadow: 0 5px 25px rgba(0,0,0,0.3);
        animation: slideUpSuggestions 0.3s ease-out;
    }
    
    @keyframes slideUpSuggestions {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .suggestion-item {
        padding: 12px 15px;
    }
    
    .suggestion-item img {
        width: 50px;
        height: 50px;
    }
    
    .suggestion-item strong {
        font-size: 15px;
        white-space: normal;
        word-break: break-word;
    }
    
    .suggestions-header {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .suggestions-footer {
        padding: 12px 15px;
    }
    
    .suggestions-footer a {
        font-size: 14px;
        padding: 8px;
    }
}

/* Pour très petits écrans */
@media (max-width: 480px) {
    .search-suggestions {
        left: 8px;
        right: 8px;
        bottom: 8px;
        max-height: 65vh;
    }
    
    .suggestion-item {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .suggestion-item img {
        width: 45px;
        height: 45px;
    }
    
    .suggestion-item strong {
        font-size: 14px;
    }
    
    .suggestion-item span {
        font-size: 13px;
    }
    
    .mobile-header {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .logo-img {
        height: 30px;
        width: auto;
        max-width: 80px;
    }
    
    .cart-icon a {
        font-size: 20px;
    }
    
    .search-bar input {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .search-bar button {
        width: 35px;
        height: 35px;
    }
}

/* ========== 14. FILTRES & CATÉGORIES ========== */
.quick-filters {
    display: flex;
    gap: 10px;
    padding: 15px;
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--bg-primary);
    margin-top: 5px;
}

.quick-filters::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-filter-info {
    background: #e3f2fd;
    padding: 10px 15px;
    margin: 10px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #1a1a2e;
}

.clear-filter {
    color: var(--danger);
    text-decoration: none;
    font-weight: bold;
}

.clear-filter:hover {
    text-decoration: underline;
}

/* ========== 15. FOOTER ========== */
.mobile-footer {
    background: var(--secondary-color);
    color: var(--gray-300);
    padding: 30px 20px 20px;
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 {
    margin-bottom: 15px;
    font-size: 16px;
    color: white;
}

.footer-section h4 i {
    margin-right: 8px;
    color: var(--primary-color);
}

.footer-section p {
    font-size: 13px;
    line-height: 1.6;
    margin: 8px 0;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--gray-300);
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition-fast);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.footer-section ul li a i {
    width: 20px;
    margin-right: 8px;
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.social-link {
    width: 35px;
    height: 35px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: transform var(--transition);
}

.social-link:hover {
    transform: translateY(-3px);
}

.social-link.whatsapp { background: #25D366; }
.social-link.facebook { background: #1877F2; }
.social-link.instagram { background: #E4405F; }

.newsletter-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 25px;
    font-size: 13px;
}

.newsletter-form button {
    background: var(--primary-color);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-circle);
    color: white;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.newsletter-form button:hover {
    transform: scale(1.05);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
}

/* ========== 16. PAGES SPÉCIFIQUES ========== */
.search-page, .category-page, .cart-page, .checkout-page, .contact-page {
    padding: 20px;
    margin-top: 80px;
    margin-bottom: 80px;
}

.search-header, .category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    text-align: center;
}

.search-header h1, .category-header h1 {
    margin-bottom: 20px;
    font-size: 24px;
}

.search-form-page {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.search-form-page input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
}

.search-form-page button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: transform var(--transition);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.no-results, .search-prompt {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
}

.no-results i, .search-prompt i {
    font-size: 64px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.popular-searches {
    margin-top: 20px;
}

.popular-searches a {
    display: inline-block;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    margin: 5px;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.popular-searches a:hover {
    background: var(--primary-color);
    color: white;
}

/* Panier */
.cart-item {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.cart-item-info h3 {
    margin-bottom: 5px;
    font-size: 16px;
    color: var(--text-primary);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-controls button {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-circle);
    font-size: 16px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.quantity-controls button:hover {
    transform: scale(1.1);
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.btn-remove:hover {
    transform: scale(1.05);
}

.cart-summary {
    position: fixed;
    bottom: 80px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
}

.empty-cart {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

/* ========== 17. ANIMATIONS ========== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255,107,53,0.6);
    }
}

@keyframes reminderSlideIn {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes reminderPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes toastFadeIn {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

@keyframes toastFadeOut {
    from { bottom: 30px; opacity: 1; }
    to { bottom: 0; opacity: 0; }
}

@keyframes skeletonLoading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.product-card {
    animation: slideIn var(--transition);
}

/* ========== 18. RESPONSIVE ========== */
@media (min-width: 768px) {
    .products-slider {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
        height: auto;
    }
    
    .product-card {
        margin-bottom: 0;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form-page {
        flex-direction: column;
    }
    
    .search-form-page button {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter-form {
        max-width: 300px;
        margin: 0 auto;
    }
    
    .ad-space {
        margin-top: 60px;
        padding: 8px 5px;
        border-radius: 0;
    }

    .ad-slide img {
        max-height: 100px;
        object-fit: contain;
    }

    .ad-caption {
        font-size: 12px;
        padding: 5px;
        bottom: 5px;
        background: rgba(0,0,0,0.7);
    }

    .ad-prev, .ad-next {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .ad-prev { left: 5px; }
    .ad-next { right: 5px; }

    .ad-dot {
        width: 6px;
        height: 6px;
        margin: 0 3px;
    }
    .ad-dot.active {
        width: 16px;
    }
}

@media (max-width: 480px) {
    .reminder-content {
        flex-direction: column;
        text-align: center;
    }
    
    .reminder-message {
        text-align: center;
    }
    
    .reminder-btn-cart {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .product-card {
        padding: 15px;
    }
    
    .current-price {
        font-size: 20px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

/* ========== 19. UTILITAIRES ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 30px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 30px; }

.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 30px; }

.hidden { display: none; }
.visible { display: block; }

.loader {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

.loader i {
    font-size: 40px;
    color: var(--primary-color);
    animation: pulse 1s infinite;
}

.progress-indicator {
    position: fixed;
    bottom: 80px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    z-index: 999;
    backdrop-filter: blur(5px);
}

.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-circle);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    z-index: 998;
    transition: all var(--transition);
}

.back-to-top:hover {
    transform: scale(1.1);
}

/* Skeleton Loader */
.skeleton-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.skeleton {
    width: 300px;
    padding: 20px;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, var(--border-color) 25%, var(--gray-300) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    border-radius: var(--radius);
}

.skeleton-title {
    height: 20px;
    background: var(--border-color);
    margin: 10px 0;
    border-radius: var(--radius-sm);
    animation: skeletonLoading 1.5s infinite;
}

.skeleton-price {
    height: 30px;
    width: 60%;
    background: var(--border-color);
    margin: 10px 0;
    border-radius: var(--radius-sm);
    animation: skeletonLoading 1.5s infinite;
}

.skeleton-button {
    height: 40px;
    background: var(--border-color);
    border-radius: 20px;
    animation: skeletonLoading 1.5s infinite;
}

/* Styles pour les avertissements de stock */
.stock-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 5px;
    font-size: 12px;
    color: #856404;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-out {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 5px;
    font-size: 12px;
    color: #721c24;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 20. THÈMES (CLAIR/SOMBRE/AUTO) ========== */

/* Thème clair (défini par défaut dans :root, mais on assure la classe) */
body.light-theme {
    --background: #F5F5F5;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
}

/* Thème sombre - TOUTES les variables sont redéfinies */
body.dark-theme {
    --background: #121212;
    --bg-primary: #1e1e2e;
    --bg-secondary: #2a2a3a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #3a3a4a;
    
    /* Ajustements spécifiques pour le mode sombre */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.5);
    
    background: var(--background);
    color: var(--text-primary);
}

/* Styles supplémentaires pour le mode sombre (composants spécifiques) */
body.dark-theme .ad-space {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
}

body.dark-theme .category-filter-info {
    background: #2c3e50;
    color: white;
}

body.dark-theme .filter-chip {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-theme .filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.dark-theme .recap {
    background: var(--bg-secondary);
}

body.dark-theme .modal-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-theme .close-modal {
    color: white;
}

body.dark-theme .suggestion-item,
body.dark-theme .search-suggestions {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-theme .suggestion-item:hover {
    background: var(--bg-primary);
}

body.dark-theme .quick-filters {
    background: var(--bg-secondary);
}

body.dark-theme .cart-summary {
    background: var(--bg-secondary);
}

body.dark-theme .cart-item {
    background: var(--bg-secondary);
}

body.dark-theme .stock-warning {
    background: #332701;
    border-left-color: #ffc107;
    color: #ffecb3;
}

body.dark-theme .stock-out {
    background: #3d1a1f;
    border-left-color: #dc3545;
    color: #f8d7da;
}

body.dark-theme #suggestions-overlay {
    background: rgba(0,0,0,0.5);
}

/* Bouton pour basculer manuellement le thème (si vous l'implémentez) */
.theme-toggle-btn {
    position: fixed;
    bottom: 140px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
}