/* ================================
   1. FONTS & VARIABLES GLOBALES
================================ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;900&display=swap');

:root {
    --primary: #ff4d29;
    --bg: #080808;
    --text: #ffffff;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --modal-bg: #111111;
    --btn-text: #ffffff;
    --shadow: none;
}

.light-mode {
    --bg: #ffffff;
    --text: #000000;
    --glass: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.1);
    --modal-bg: #f9f9f9;
    --btn-text: #000000;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.light-mode input,
.light-mode select {
    background: #fff;
    color: #000;
    border: 1px solid #ddd;
}

#theme-toggle i { font-size: 1.7rem; }
.theme-pulse { animation: pulse-theme 2s infinite; }

@keyframes pulse-theme {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.1); }
}

/* ================================
   2. RESET GLOBAL
================================ */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }
body { background: var(--bg); color: var(--text); overflow-x: hidden; transition: background 0.4s, color 0.4s; }
body.cart-open { overflow: hidden; position: fixed; width: 100%; left: 0; right: 0; }
.container { max-width: 1100px; width: 92%; margin: auto; }

/* ================================
   3. HEADER
================================ */
header { position: fixed; top: 0; width: 100%; z-index: 1000; background: rgba(8, 8, 8, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); transition: all 0.4s ease; }
.nav { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; }
.logo { color: var(--primary); font-weight: 900; font-size: 1.5rem; text-decoration: none; }
.header-icons { display: flex; align-items: center; gap: 15px; }
#theme-toggle, .cart-box { background: transparent; border: none; cursor: pointer; position: relative; font-size: 1.5rem; }
#theme-toggle { color: var(--primary); }
.cart-box { color: var(--primary); }
#cart-count { position: absolute; top: -5px; right: -8px; background: var(--text); color: var(--bg); font-size: 10px; padding: 2px 5px; border-radius: 50%; font-weight: 900; }
.light-mode header { background: rgba(255, 255, 255, 0.9); }

/* ================================
   4. SPLASH SCREEN (Corrigé)
================================ */
#splash-screen { position: fixed; inset: 0; background:#080808 !important; z-index: 9999; display: flex; justify-content: center; align-items: center; transition: opacity 0.5s ease, visibility 0.5s; }
.splash-content { text-align: center; width: 80%; max-width: 300px; }
.splash-logo { width: 120px; height: 120px; border-radius: 50%; border: 3.5px solid var(--primary); margin-bottom: 20px; animation: pulse 2s infinite; }
.splash-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 25px; color: #fff; }
.progress-container { width: 100%; height: 6px; background: var(--glass); border-radius: 10px; overflow: hidden; }

/* DANGER COUVERT : Isolation de l'animation pour ne pas corrompre la jauge de fidélité */
.splash-bar { height: 100%; width: 0%; background: var(--primary); border-radius: 10px; animation: fill-bar 2s linear forwards; }
.splash-hidden { opacity: 0; visibility: hidden; pointer-events: none; z-index: -1; }

.loyalty-container { margin: 15px 0; }
.loyalty-header { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--primary); font-weight: bold; margin-bottom: 5px; }
.loyalty-track { height: 8px; background: var(--border); }
.loyalty-bar { height: 100%; width: 0%; background: var(--primary); border-radius: 10px; transition: width 0.8s ease-in-out; }
#loyalty-msg { font-size: 0.75rem; color: #888; display: none; margin-top: 5px; }

/* ================================
   5. HERO & CAROUSEL
================================ */
.hero-section { margin-top: 80px; }
.carousel-16-9 { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 5px; overflow: hidden; border: 3px solid var(--primary); box-shadow: 0 0 0 1px var(--primary); }
/* CORRECTION : Transition plus douce pour le carousel */
.carousel-wrapper { display: flex; width: 100%; height: 100%; transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); }
.carousel-wrapper img { min-width: 100%; height: 100%; object-fit: cover; }
.carousel-btn { position: absolute; top: 50%; transform: translateY(-50%); font-size: 3rem; color: rgba(255, 255, 255, 0.5); cursor: pointer; z-index: 10; transition: all 0.3s ease; border: none; background: transparent; }
.carousel-btn:hover { color: var(--primary); transform: translateY(-50%) scale(1.1); }
.carousel-btn.prev { left: 10px; }
.carousel-btn.next { right: 10px; }
.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    color: #f9f9f9;
    background: linear-gradient(to top, rgba(8, 8, 8, 0.65) 0%, transparent 70%);
    z-index: 10;
    pointer-events: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}
.hero-overlay h1 { font-size: clamp(1.2rem, 5vw, 2.2rem); }
.carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; z-index: 10; }
.dot { width: 6px; height: 6px; background: rgba(255,255,255,0.5); border-radius: 50%; cursor: pointer; transition: 0.3s; }
.dot.active { background: var(--primary); transform: scale(1.2); width: 10px; border-radius: 5px;}

/* ================================
   6. PRODUITS
================================ */
.section-title { margin: 30px 0 20px; text-align: center; font-size: 1.6rem; }
.shop-content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .shop-content { grid-template-columns: repeat(4, 1fr); } }
.product-box { background: var(--glass); border: 1px solid var(--border); border-radius: 24px; padding: 10px; transition: 0.3s; animation: fadeIn 0.5s ease backwards; }
.product-box:hover { border-color: var(--primary); }
.product-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 18px; cursor: pointer; }

/* CORRECTION BUG : Le bouton garde son icône d'origine, on s'assure qu'il est stylé correctement */
.add-cart { font-size: 1.8rem; color: var(--primary); cursor: pointer; transition: color 0.25s ease, transform 0.25s ease; }
.add-cart:active { transform: scale(0.9); }
.add-cart.added-success { color: #25D366 !important; transform: scale(1.15); }
.product-box h3 { font-size: 0.9rem; margin: 8px 0; color: var(--text); }
.product-box .price { color: var(--primary); font-weight: bold; }

/* ================================
   7. PANIER & UI
================================ */
.cart-overlay { position: fixed; inset: 0; display: none; background: rgba(0, 0, 0, 0.8); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(10px); }
.cart-overlay.active { display: flex; }
.cart-modal { width: 92%; max-width: 450px; padding: 25px; border-radius: 30px; background: var(--modal-bg); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); transition: all 0.4s ease; position: relative; }
#close-cart { position: absolute; float: right; top: 15px; right: 15px; background: transparent; border: none; font-size: 2.5rem; color: var(--primary); cursor: pointer; }
.cart-title { text-align: left; color: var(--text); font-size: 1.5rem;}
.cart-content { margin: 15px 0; max-height: 180px; overflow-y: auto; border-top: 1px solid var(--border); padding-top: 10px;}
.empty-msg { text-align: center; opacity: 0.5; padding: 20px 0; }

input, select { width: 100%; padding: 14px; margin: 8px 0; border-radius: 12px; background: var(--glass); border: 1px solid var(--border); color: var(--text); outline: none; transition: 0.3s; font-size: 16px; }
input:focus, select:focus { border-color: var(--primary); background-color: var(--bg); }
.total { margin: 15px 0; font-size: 1rem; border-top: 1px solid var(--border); padding-top: 12px; background: var(--glass); border-radius: 12px; padding: 12px; }
.total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--text); font-weight: 600; }
.delivery-row b, #delivery-fee { color: var(--text); font-weight: 800; font-size: 1.05rem; }
.total-final { margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 1.15rem; }
.total-final .total-price { color: var(--primary); font-weight: 900; }
#cart-subtotal { color: var(--text); font-weight: 700; }
.loyalty-track { position: relative; z-index: 1; }

/* ================================
   8. FOOTER & VIEWER
================================ */
.footer {
    background: rgba(15, 15, 15, 0.85);
    padding: 40px 0 25px;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid var(--border);
}
.light-mode .footer { background: rgba(245, 245, 245, 0.95); }
.footer h4 { color: var(--text); font-size: 1.1rem; margin-bottom: 8px; }
.footer h5 { color: var(--text); font-size: 0.95rem; font-weight: 700; margin-bottom: 15px; opacity: 0.9; }
.footer p { color: #888; font-size: 0.9rem; line-height: 1.5; }
.footer-line { border: 0; border-top: 1px solid var(--border); margin: 20px auto; width: 50%; }
.social-icons { display: flex; justify-content: center; gap: 20px; margin: 20px 0; }
.social-icons a {
    color: var(--primary);
    font-size: 1.8rem;
    transition: 0.3s;
    animation: bounce-social 2s ease-in-out;
}
.social-icons a:nth-child(2) { animation-delay: 0.2s; }
.social-icons a:nth-child(3) { animation-delay: 0.4s; }
.social-icons a:hover { color: var(--text); transform: scale(1.15); }
.copyright { opacity: 0.5; font-size: 0.75rem; margin-top: 15px; }

@keyframes bounce-social {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

.image-viewer { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 3000; display: none; align-items: center; justify-content: center; flex-direction: column; text-align: center; cursor: zoom-out; }
.image-viewer.active { display: flex; animation: fadeIn 0.3s ease; }
.viewer-content h3 { color: var(--primary); font-size: 1.4rem; }
#full-res-img { max-width: 90%; max-height: 70vh; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }

.filter-container { margin-bottom: 20px; }
.search-box {
   position: relative;
   background: var(--glass);
   border-radius: 15px;
   border: 1px solid var(--border);
   display: flex;
   align-items: center;
   padding: 0 15px;
   margin-bottom: 15px;
}

.search-box i { color: var(--primary); font-size: 1.2rem; }
.search-box input { border: none; background: transparent; margin: 0; padding: 12px; }

/* ================================
   9. MODIFICATIONS DYNAMIQUES
================================ */
.btn-buy { background: #25D366 !important; color: #000000 !important; font-weight: 900; padding: 5px; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; }
.btn-buy:disabled { background: #555 !important; color: #aaa !important; cursor: not-allowed; }

/* SÉCURITÉ VISUELLE : État de récompense sécurisé */
.btn-buy.gold-mode { background: #FFD700 !important; box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); animation: pulse 2s infinite; }

/* ================================
   10. ANIMATIONS
================================ */
@keyframes fill-bar { from { width: 0%; } to { width: 100%; } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
