/* ==========================================================================
   CHARYINE E-COMMERCE - STYLE GLOBAL CENTRALISÉ
   ========================================================================== */

/* ==========================================================================
   1. VARIABLES & CONFIGURATION DE BASE
   ========================================================================== */
:root {
    /* Couleurs principales */
    --primary: #2c3e50;
    --primary-light: #34495e;
    --secondary: #27ae60;
    --secondary-hover: #219150;
    --accent: #e67e22;
    
    /* Variables Spécifiques Landing Page (Produit) */
    --lp-primary: #28a745;
    --lp-whatsapp: #25D366;
    --lp-bg: #f8fafc;
    --lp-text: #2d3748;

    /* Couleurs de fond et bordures */
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border: #edf2f7;
    
    /* Typographie */
    --text-dark: #2d3748;
    --text-muted: #718096;
    
    /* Effets */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    margin: 0; 
    background: var(--bg-light); 
    color: var(--text-dark); 
    line-height: 1.6;
    overflow-x: hidden;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

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

.flex-1 { flex: 1; }
.mt-40 { margin-top: 40px; }
.w-100 { width: 100%; }

/* ==========================================================================
   2. COMPOSANTS GLOBAUX
   ========================================================================== */
.card-modern {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.btn-modern {
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--secondary); color: white; }
.btn-modern:hover { opacity: 0.9; transform: translateY(-1px); }

/* ==========================================================================
   3. HEADER, RECHERCHE LIVE & BANNIÈRE PROMO
   ========================================================================== */
.promo-banner { background: linear-gradient(90deg, var(--primary-light), var(--primary)); color: #fff; text-align: center; padding: 8px 15px; font-size: 0.9rem; font-weight: bold; letter-spacing: 0.5px; }
.promo-banner i { color: var(--accent); margin-right: 5px; }

.main-header {
    background: var(--bg-white);
    padding: 10px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-grid { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo-img { height: 70px; width: auto; object-fit: contain; transition: var(--transition); }

.header-search { position: relative; flex: 1; max-width: 500px; }
.search-form { display: flex; background: var(--bg-light); border-radius: 50px; padding: 5px 15px; border: 1px solid var(--border); height: 45px; transition: var(--transition); }
.search-form:focus-within { background: white; box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1); border-color: var(--secondary); }
.search-form input { border: none; background: transparent; width: 100%; outline: none; }
.search-form button { border: none; background: transparent; color: var(--text-muted); cursor: pointer; }

.search-results-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: #ffffff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); max-height: 400px; overflow-y: auto; z-index: 1000; margin-top: 5px; border: 1px solid #e2e8f0; display: none; }
.search-item { display: flex; align-items: center; padding: 10px 15px; border-bottom: 1px solid #f1f5f9; text-decoration: none; color: #2d3748; transition: background 0.2s; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #f8fafc; }
.search-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; margin-right: 15px; }
html[dir="rtl"] .search-item img { margin-right: 0; margin-left: 15px; }
.search-item-info { flex: 1; }
.search-item-title { font-weight: 600; font-size: 0.9em; margin-bottom: 3px; line-height: 1.2; }
.search-item-price { color: var(--primary, #28a745); font-weight: bold; font-size: 0.85em; }

.header-actions { display: flex; align-items: center; gap: 20px; }
.action-btn { text-decoration: none; color: var(--primary); display: flex; align-items: center; gap: 5px; font-weight: 500; }
.cart-icon-container { position: relative; font-size: 1.5rem; color: var(--primary); }
.cart-badge { position: absolute; top: -8px; right: -10px; background: var(--secondary); color: white; font-size: 0.7rem; min-width: 18px; height: 18px; border-radius: 50%; border: 2px solid white; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* ==========================================================================
   4. INDEX : HERO SLIDER
   ========================================================================== */
.hero { position: relative; height: 330px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: white; text-align: center; margin-bottom: 40px; }
.hero-slider .slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease-in-out; }
.slide.active { opacity: 1; }
.hero-content { position: relative; z-index: 2; }
.hero-content h1 { font-size: 2.5rem; margin-bottom: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.hero-content p { font-size: 1.2rem; margin-bottom: 20px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

/* ==========================================================================
   5. GRILLE PRODUITS & SHOP LAYOUT
   ========================================================================== */
.shop-layout { display: flex; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
.shop-main-content { flex: 1; min-width: 300px; }
.shop-title { margin: 0 0 30px 0; font-size: 1.8rem; color: var(--primary); font-weight: bold; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px; }

.product-card { background: #ffffff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.04); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease; position: relative; display: flex; flex-direction: column; border: 1px solid #f1f5f9; }
.product-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }

.product-image-container { position: relative; height: 250px; overflow: hidden; cursor: pointer; background: #f8fafc; display: flex; align-items: center; justify-content: center; }
.product-image-container img, .product-image-container video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.product-card:hover .product-image-container img, .product-card:hover .product-image-container video { transform: scale(1.08); }

.product-actions-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; gap: 15px; opacity: 0; backdrop-filter: blur(2px); transition: opacity 0.3s ease; z-index: 2; }
.product-card:hover .product-actions-overlay { opacity: 1; }

.btn-circle { width: 45px; height: 45px; border-radius: 50%; background: #ffffff; color: var(--primary, #28a745); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; transform: translateY(20px); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, color 0.3s; text-decoration: none; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.product-card:hover .btn-circle { transform: translateY(0); }
.btn-circle:hover { background: var(--primary, #28a745); color: #ffffff; }

.discount-badge { position: absolute; top: 15px; left: 15px; background: linear-gradient(135deg, #ff416c, #ff4b2b); color: white; font-weight: 800; font-size: 0.75rem; padding: 6px 12px; border-radius: 20px; z-index: 10; box-shadow: 0 4px 10px rgba(255, 65, 108, 0.3); letter-spacing: 0.5px; }

.product-info { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.cat-tag { font-size: 0.7rem; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.product-link { text-decoration: none; color: #1e293b; }
.product-card h3 { margin: 0 0 10px 0; font-size: 1rem; line-height: 1.4; height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; transition: color 0.3s ease; }
.product-card:hover h3 { color: var(--primary, #28a745); }

.price-wrapper { margin-top: auto; display: flex; align-items: baseline; gap: 10px; margin-bottom: 15px; }
.current-price { font-size: 1.3rem; font-weight: 800; color: #10b981; }
.old-price { font-size: 0.9rem; color: #94a3b8; text-decoration: line-through; font-weight: 500; }

.btn-add-cart { width: 100%; padding: 12px; border-radius: 8px; background: #f8fafc; color: var(--primary, #28a745); font-weight: 700; border: 1px solid #e2e8f0; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-add-cart:hover { background: var(--primary, #28a745); color: white; border-color: var(--primary, #28a745); }

/* Progress bar de stock & Status */
.stock-section { margin-bottom: 15px; }
.stock-status-wrapper { display:flex; justify-content: space-between; font-size: 0.75rem; color: #64748b; }
.text-available { color: #10b981; font-weight: 600; }
.text-empty { color: #ef4444; font-weight: 600; }
.stock-progress-bar { background: #e2e8f0; height: 6px; border-radius: 10px; margin-top: 5px; overflow: hidden; }
.stock-fill { height: 100%; transition: width 0.5s ease-out; }

/* Pagination */
.pagination-container { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 50px; }
.btn-page { display: inline-block; padding: 8px 16px; border-radius: 5px; background-color: #edf2f7; color: var(--text-dark); text-decoration: none; font-weight: bold; transition: all 0.3s ease; }
.btn-page:hover { background-color: #cbd5e0; }
.btn-page.active { background-color: var(--primary, #28a745); color: white; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }


/* ==========================================================================
   6. PAGE PRODUIT (LANDING PAGE)
   ========================================================================== */
.lp-container { max-width: 1200px; margin: 40px auto; padding: 0 15px; }

.lp-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; margin-bottom: 60px; }

/* FIX CRITIQUE: box-sizing et min-width pour empêcher le débordement horizontal */
.lp-media-gallery { background: #fff; border-radius: 16px; padding: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); border: 1px solid #edf2f7; min-width: 0; width: 100%; box-sizing: border-box; }
.lp-buy-box { position: sticky; top: 120px; min-width: 0; width: 100%; box-sizing: border-box; }

#media-viewer { width: 100%; aspect-ratio: 1 / 1; background: var(--lp-bg); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
#media-viewer img, #media-viewer video { width: 100%; height: 100%; object-fit: contain; }

.lp-thumbnails { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.lp-thumbnails div { cursor: pointer; width: 80px; height: 80px; border: 2px solid transparent; border-radius: 10px; overflow: hidden; flex-shrink: 0; transition: all 0.3s ease; }
.lp-thumbnails div:hover, .lp-thumbnails div.active { border-color: var(--lp-primary); transform: translateY(-2px); }
.lp-thumbnails img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb-icon { background: #1a202c; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; }

.lp-badge { display: inline-block; background: #ebf8ff; color: #3182ce; padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; margin-bottom: 15px; }
.lp-title { font-size: 2.5rem; line-height: 1.2; color: #1a202c; margin-bottom: 20px; font-weight: 800; }
.lp-price-container { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; padding-bottom: 25px; border-bottom: 2px dashed #e2e8f0; }
.lp-price { font-size: 2.5rem; color: var(--lp-primary); font-weight: 900; }
.lp-currency { font-size: 1.2rem; }
.lp-old-price { font-size: 1.4rem; color: #a0aec0; text-decoration: line-through; font-weight: 600; }
.lp-short-desc { font-size: 1.1rem; color: #4a5568; line-height: 1.7; margin-bottom: 30px; }

.lp-stock-status { font-weight: bold; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; }
.lp-stock-status.available { color: var(--lp-primary); }
.lp-stock-status.empty { color: #e53e3e; }

.lp-action-buttons { display: flex; flex-direction: column; gap: 15px; }
.lp-btn { width: 100%; padding: 18px; font-size: 1.2rem; border-radius: 12px; font-weight: bold; text-align: center; border: none; cursor: pointer; transition: all 0.3s ease; display: flex; justify-content: center; align-items: center; gap: 10px; text-decoration: none; }
.lp-btn-cart { background: var(--lp-primary); color: white; box-shadow: 0 8px 20px rgba(40, 167, 69, 0.25); }
.lp-btn-cart:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(40, 167, 69, 0.35); }
.lp-btn-whatsapp { background: var(--lp-whatsapp); color: white; box-shadow: 0 8px 20px rgba(37, 211, 102, 0.25); }
.lp-btn-whatsapp:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(37, 211, 102, 0.35); }
.whatsapp-icon-lg { font-size: 1.5rem; }
.lp-btn-disabled { background: #cbd5e0; color: #718096; cursor: not-allowed; }
.lp-btn-share { background: none; border: none; color: var(--text-muted); text-decoration: underline; margin-top: 10px; cursor: pointer; font-size: 1rem; padding: 0; display: inline-block; transition: color 0.3s ease; }
.lp-btn-share:hover { color: var(--primary); }

.lp-story-section { background: #fff; border-radius: 16px; padding: 50px; box-shadow: 0 10px 30px rgba(0,0,0,0.05); margin-bottom: 60px; max-width: 900px; margin-left: auto; margin-right: auto; }
.lp-story-title { text-align: center; font-size: 2rem; color: #1a202c; margin-bottom: 30px; position: relative; }
.lp-story-title::after { content: ''; display: block; width: 60px; height: 4px; background: var(--lp-primary); margin: 15px auto 0; border-radius: 2px; }
.lp-story-content { font-size: 1.15rem; color: #4a5568; line-height: 1.9; }

.mobile-sticky-cta { display: none; }


/* ==========================================================================
   7. PANIER & CHECKOUT (CART.PHP / CHECKOUT.PHP)
   ========================================================================== */
/* Panier */
.cart-page-container { min-height: 60vh; padding: 50px 20px; }
.cart-page-title { border-bottom: 2px solid var(--secondary); padding-bottom: 10px; margin-bottom: 30px; }
.cart-empty-state { text-align: center; padding: 50px; }
.cart-empty-icon { font-size: 4rem; color: #edf2f7; margin-bottom: 20px; }
.cart-card { padding: 25px; }

.cart-table-wrapper { width: 100%; border-collapse: collapse; }
.cart-table-wrapper th { padding: 15px; text-align: left; border-bottom: 2px solid var(--border); color: var(--text-muted); }
.cart-item-row { border-bottom: 1px solid var(--border); }
.cart-item-row td { padding: 15px; }
.cart-qty-input { width: 60px; padding: 5px; border-radius: 5px; border: 1px solid var(--border); text-align: center; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.85em; }
.cart-product-cell { display: flex; align-items: center; gap: 15px; }
.cart-product-img { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; }
.cart-item-total { text-align: right; font-weight: bold; color: var(--primary); }
.btn-remove-cart { color: #e53e3e; background: none; border: none; cursor: pointer; font-size: 1.2rem; transition: color 0.3s; }
.btn-remove-cart:hover { color: #c53030; }

.cart-summary-box { margin-top: 30px; border-top: 2px solid var(--bg-light); padding-top: 20px; max-width: 400px; margin-left: auto; }
.cart-summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; }
.shipping-row { color: var(--secondary); font-weight: 600; }
.cart-summary-total { display: flex; justify-content: space-between; margin-bottom: 25px; font-size: 1.4rem; font-weight: 800; align-items: center;}
.total-label { font-size: 1.1rem; }
.total-amount { color: var(--secondary); }
.btn-checkout { padding: 15px; font-size: 1.1rem; text-align: center; display: block; }

/* Checkout */
.checkout-wrapper { padding: 40px 20px; }
.checkout-title { margin-bottom: 30px; color: var(--primary); font-weight: 800; }
.guest-alert { background: #e6fffa; border: 1px solid #319795; color: #234e52; padding: 15px; border-radius: 8px; margin-bottom: 25px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.guest-alert a { color: #319795; font-weight: bold; text-decoration: underline; }
.checkout-section-title { margin-top: 0; margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px; color: var(--primary); }
.checkout-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; align-items: start; }

.form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-control { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); box-sizing: border-box; }
select.form-control { font-family: inherit; font-size: 1rem; outline: none; background: white; }
textarea.form-control { resize: vertical; }

.payment-method-box { padding: 15px; background: var(--bg-light); border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; gap: 12px; }
.payment-method-text { font-weight: 600; font-size: 0.95rem; color: var(--text-dark); }
.radio-custom { width: 18px; height: 18px; margin: 0; }

.summary-card-sticky { padding: 25px; position: sticky; top: 110px; }
.summary-title { margin-top: 0; margin-bottom: 20px; font-size: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.summary-items { max-height: 250px; overflow-y: auto; margin-bottom: 20px; padding-right: 5px; }
.summary-item-row { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #f8f9fa; }
.summary-item-img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.summary-item-title { font-weight: 600; font-size: 0.85em; color: var(--text-dark); }
.summary-item-qty { font-size: 0.8em; color: var(--text-muted); }
.summary-item-price { font-weight: 700; color: var(--primary); font-size: 0.9em; white-space: nowrap; }

.coupon-box { margin-bottom: 25px; display: flex; gap: 10px; }
.coupon-input { flex: 1; padding: 12px; border: 1px solid var(--border); border-radius: 8px; outline: none; box-sizing: border-box; }
.btn-coupon { padding: 10px 15px; white-space: nowrap; font-size: 0.9em; }

.totals-box { padding-top: 10px; background: #fafafa; padding: 15px; border-radius: 10px; }
.totals-row { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-muted); font-size: 0.9rem; }
.totals-discount { color: #e53e3e; font-weight: 600; }
.totals-shipping { color: var(--secondary); font-weight: 600; margin-bottom: 12px; }
.totals-final { display: flex; justify-content: space-between; border-top: 2px solid #eee; padding-top: 15px; font-size: 1.4rem; font-weight: 800; color: var(--primary); }

.btn-confirm-order { margin-top: 25px; padding: 18px; font-size: 1.1rem; font-weight: 700; box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3); }
.secure-payment-text { text-align: center; margin-top: 15px; font-size: 0.8em; color: var(--text-muted); }


/* ==========================================================================
   8. SIDEBAR, AUTHENTIFICATION & FOOTER
   ========================================================================== */
.sidebar-nav { width: 280px; position: sticky; top: 100px; z-index: 10; overflow: hidden; background: white; }
.sidebar-header { background: linear-gradient(135deg, var(--primary) 0%, #34495e 100%); color: white; padding: 18px 20px; font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; gap: 12px; text-transform: uppercase;}
.cat-menu li { border-bottom: 1px solid var(--border); transition: var(--transition); }
.cat-menu li a { display: flex; padding: 14px 20px; text-decoration: none; font-weight: 500; color: var(--text-dark); transition: var(--transition); border-left: 4px solid transparent; }
.cat-menu li:hover { background: #f0fdf4; }
.cat-menu li:hover a { color: var(--secondary); border-left-color: var(--secondary); padding-left: 28px; }

.auth-container { display: flex; justify-content: center; align-items: center; padding: 60px 15px; min-height: 60vh; }
.auth-card { max-width: 450px; width: 100%; padding: 40px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1); }

.error-msg, .success-msg { padding: 12px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.9rem; }
.error-msg { background: #fff5f5; color: #c53030; border-left: 4px solid #f56565; }
.success-msg { background: #f0fff4; color: #2f855a; border-left: 4px solid #48bb78; }

/* Footer */
.main-footer { background: #1a202c; color: #a0aec0; padding: 60px 0 20px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; }
.footer-logo { height: 100px; margin-bottom: 20px; filter: brightness(0) invert(1); }
.footer-desc { font-size: 0.9em; }
.footer-heading { color: white; margin-bottom: 20px; margin-top: 0; }
.footer-links { list-style: none; padding: 0; line-height: 2; }
.footer-links a { color: inherit; text-decoration: none; transition: var(--transition); }
.footer-links a:hover { color: white; }

.social-links { display: flex; gap: 15px; font-size: 1.5rem; }
.social-link { color: inherit; transition: color 0.3s ease; }
.social-link.fb:hover { color: #1877F2; }
.social-link.ig:hover { color: #E4405F; }
.social-link.wa:hover { color: #25D366; }

.footer-bottom { border-top: 1px solid #4a5568; margin-top: 40px; padding: 24px 0; text-align: center; font-size: 0.875rem; color: #a0aec0; }
.footer-bottom p { margin: 0; }
.dev-link { color: #63b3ed; font-weight: 500; text-decoration: none; display: inline-block; margin-left: 8px; transition: text-decoration 0.2s; }
.dev-link:hover { text-decoration: underline; }

/* ==========================================================================
   9. ANIMATIONS & TOASTS
   ========================================================================== */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { background: white; padding: 15px 25px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); margin-bottom: 10px; display: flex; align-items: center; gap: 12px; border-left: 5px solid var(--secondary); transform: translateX(120%); transition: transform 0.4s ease; }
.toast.show { transform: translateX(0); }
.toast.error { border-left-color: #e53e3e; }

@keyframes shake-cart { 0% { transform: scale(1) rotate(0); } 15% { transform: scale(1.2) rotate(-15deg); } 30% { transform: scale(1.2) rotate(15deg); } 45% { transform: scale(1.2) rotate(-15deg); } 60% { transform: scale(1.2) rotate(15deg); } 100% { transform: scale(1) rotate(0); } }
.shake { animation: shake-cart 0.6s ease-in-out; display: inline-block; }
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }

/* ==========================================================================
   10. MEDIA QUERIES GLOBALES (Tablettes & Mobiles)
   ========================================================================== */

/* TABLETTES (Max 992px) */
@media (max-width: 992px) {
    /* Layouts Généraux */
    .sidebar-nav { width: 100%; position: static; order: -1; margin-bottom: 20px; }
    
    /* Page Produit / Landing Page */
    .lp-hero { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
    .lp-buy-box { position: static; }
    .lp-story-section { padding: 30px 20px; }
    .lp-title { font-size: 2rem; margin-bottom: 15px; }
    
    /* Checkout */
    .checkout-grid { grid-template-columns: 1fr; }
    .summary-card-sticky { position: static; top: auto; }
}

/* SMARTPHONES (Max 768px) */
@media (max-width: 768px) {
    /* Header & Sidebar Mobile */
    .header-grid { flex-wrap: wrap; }
    .header-search { order: 3; width: 100%; max-width: 100%; }
    .sidebar-nav .sidebar-header { display: none !important; }
    .sidebar-nav { width: 100%; position: static; margin-bottom: 25px; box-shadow: none; border: none; background: transparent; }
    .sidebar-nav .cat-menu { display: flex !important; flex-direction: row !important; justify-content: center !important; gap: 25px !important; padding: 10px 0 !important; }
    .sidebar-nav .cat-menu li { border: none; background: transparent !important; }
    .sidebar-nav .cat-menu li a { padding: 0 !important; border: none !important; }
    .sidebar-nav .cat-menu li a span { display: none !important; }
    .sidebar-nav .cat-menu li a i { font-size: 2rem !important; }

    /* Panier Mobile (Cart) */
    .cart-table-wrapper thead { display: none; }
    .cart-item-row { display: block; border: 1px solid var(--border); margin-bottom: 10px; border-radius: var(--radius-sm); }
    .cart-item-row td { display: flex; justify-content: space-between; text-align: right; border-bottom: none; align-items: center;}
    .cart-item-row td::before { content: attr(data-label); font-weight: bold; }

    /* Authentification */
    .auth-card { padding: 25px 20px; }
    
    /* -------------------------------------------
       FIXES : LANDING PAGE MOBILE (product_details)
       ------------------------------------------- */
    .lp-container { overflow-x: hidden; padding-bottom: 80px; }
    .lp-hero { grid-template-columns: 1fr; gap: 20px; margin-bottom: 30px; }
    
    /* Conteneur principal de la galerie (empêche le dépassement horizontal) */
    .lp-media-gallery { padding: 10px; border-radius: 12px; overflow: hidden; width: 100%; box-sizing: border-box; }
    
    /* Image principale et miniatures */
    #media-viewer { aspect-ratio: 1 / 1; height: auto; max-height: 380px; margin-bottom: 10px; }
    .lp-thumbnails { padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
    .lp-thumbnails div { width: 60px; height: 60px; flex-shrink: 0; }
    
    /* Textes et prix ajustés pour petits écrans */
    .lp-title { font-size: 1.5rem; margin-bottom: 10px; }
    .lp-price { font-size: 1.8rem; }
    .lp-price-container { margin-bottom: 15px; padding-bottom: 15px; }
    .lp-short-desc { font-size: 0.95rem; margin-bottom: 20px; }
    
    /* Boutons d'achat ajustés */
    .lp-action-buttons { gap: 10px; }
    .lp-btn { padding: 12px 10px; font-size: 1rem; width: 100%; box-sizing: border-box; }
    
    /* Bouton Sticky Mobile ajusté (empêche le dépassement de l'écran) */
    .mobile-sticky-cta {
        display: block; position: fixed; bottom: 0; left: 0; right: 0; background: white;
        padding: 10px 15px; box-shadow: 0 -5px 20px rgba(0,0,0,0.1); z-index: 1000; border-top: 1px solid #edf2f7;
        width: 100%; box-sizing: border-box;
    }
    .mobile-sticky-cta .lp-btn { margin: 0; width: 100%; padding: 14px 10px; font-size: 1.1rem; box-sizing: border-box; }
}

/* PETITS SMARTPHONES (Max 576px) */
@media (max-width: 576px) {
    /* Checkout */
    .form-row-2col { grid-template-columns: 1fr; }
    h1.checkout-title { font-size: 1.6rem; }
}

/* ==========================================================================
   11. NOUVELLES FONCTIONNALITÉS (DARK MODE, WISHLIST, QUICK VIEW)
   ========================================================================== */

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-light: #1a202c;
    --bg-white: #2d3748;
    --border: #4a5568;
    --text-dark: #f7fafc;
    --text-muted: #a0aec0;
    --lp-bg: #1a202c;
    --lp-text: #f7fafc;
}

[data-theme="dark"] .product-card, [data-theme="dark"] .card-modern {
    background: var(--bg-white);
    border-color: var(--border);
}

[data-theme="dark"] .main-header {
    background: var(--bg-white);
}

body { transition: background 0.4s ease, color 0.4s ease; }

/* Theme Toggle Button */
.theme-toggle {
    background: none; border: none; cursor: pointer; color: var(--text-dark);
    font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; transition: var(--transition);
}
.theme-toggle:hover { background: var(--border); }

/* Quick View Modal (Glassmorphism) */
.quickview-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center; z-index: 10000;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.quickview-overlay.active { opacity: 1; pointer-events: all; }
.quickview-modal {
    background: var(--bg-white); width: 90%; max-width: 800px;
    border-radius: 16px; overflow: hidden; position: relative;
    transform: translateY(30px); transition: transform 0.3s ease; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.quickview-overlay.active .quickview-modal { transform: translateY(0); }
.quickview-close {
    position: absolute; top: 15px; right: 20px; font-size: 1.5rem; color: var(--text-muted);
    cursor: pointer; z-index: 10; border: none; background: none; font-weight: bold;
}
.quickview-content { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media(max-width:768px) { .quickview-content { grid-template-columns: 1fr; } }

/* Wishlist Button */
.btn-wishlist {
    position: absolute; top: 15px; right: 15px; background: rgba(255,255,255,0.9);
    border: none; width: 40px; height: 40px; border-radius: 50%; z-index: 5;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); font-size: 1.2rem; color: #cbd5e0; transition: all 0.3s;
}
.btn-wishlist:hover { transform: scale(1.1); color: #e53e3e; }
.btn-wishlist.active { color: #e53e3e; }

/* Animated floating image */
.flying-img {
    position: fixed; z-index: 99999; border-radius: 50%; opacity: 0.8;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Search Backdrop blur */
.search-form:focus-within ~ .search-backdrop {
    display: block;
}
.search-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 999; backdrop-filter: blur(3px);
}
.header-search { z-index: 1000; }