/* --- 1. RESET & BASES --- */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  cursor: default; 
}

html { 
  scroll-behavior: smooth; 
}

:root {
  --primary: #d81b60; /* Rose signature */
  --secondary: #fce4ec; /* Rose pâle fond */
  --dark: #1a1a1a;
  --gold: #c5a059;
}

body {
  background-color: var(--secondary);
  font-family: 'Montserrat', sans-serif;
  color: #333;
  overflow-x: hidden; /* Empêche le scroll horizontal avec les sections Hero */
}

/* Éléments cliquables */
a, button, .option, .menu-btn, .cart-btn, .menu-link, .floating-cart, .close-btn { 
  cursor: pointer; 
}

/* --- 2. LOADER & ANIMATIONS --- */
#loader {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: white; 
  display: flex; flex-direction: column;
  justify-content: center; align-items: center; 
  z-index: 9999;
}

.spinner {
  border: 5px solid #f3f3f3; 
  border-top: 5px solid var(--primary);
  border-radius: 50%; 
  width: 50px; height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.welcome { 
  text-align: center; 
  font-family: "Rouge Script", cursive; 
  font-size: 2rem; 
  margin-top: 45px;
  color: var(--primary);
  animation: appear 1.5s ease-out;
}

@keyframes appear {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* --- 3. HEADER & NAVIGATION --- */
.header {
  position: fixed; 
  top: 0; width: 100%; 
  padding: 15px 5%;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
  z-index: 2000; 
  transition: all 0.4s ease;
  background: rgba(255, 255, 255, 0.1); 
  backdrop-filter: blur(10px);
}

.header.scrolled {
  background: white; 
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  padding: 10px 5%;
}

.site-title { 
  font-family: "Rouge Script", cursive; 
  font-size: 2.2rem; 
  color: var(--primary); 
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Menu Latéral */
.menu { 
  position: fixed; 
  top: 0; right: -100%; 
  width: 300px; height: 100%; 
  background: white; 
  z-index: 4000; 
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
  padding: 40px 20px;
  box-shadow: -5px 0 15px rgba(0,0,0,0.1);
}

.menu.open { right: 0; }

.menu-link { 
  display: block; 
  padding: 15px 0; 
  text-decoration: none; 
  color: var(--dark); 
  border-bottom: 1px solid #eee; 
  font-weight: 500;
  transition: 0.3s;
}

.menu-link:hover { color: var(--primary); padding-left: 10px; }

.close-btn { 
  font-size: 1.5rem; 
  position: absolute; 
  top: 20px; right: 20px; 
}

/* --- 4. SECTIONS HERO (FULL WIDTH) --- */
.category-section { 
  margin-bottom: 80px; 
}

.category-hero {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Effet parallaxe luxueux */
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
  width: 100%; height: 100%;
  display: flex; flex-direction: column; 
  justify-content: center; align-items: center;
  color: white; text-align: center;
}

.hero-title {
  font-family: "Rouge Script", cursive;
  font-size: 3rem; /* Légèrement réduit pour mobile */
  text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.hero-subtitle {
  text-transform: uppercase; 
  letter-spacing: 5px; 
  font-size: 0.8rem;
  margin-top: 10px; 
  font-weight: 300; 
  color: var(--secondary);
}

/* --- 5. GRILLE PRODUITS (CENTRALE & RESPONSIVE) --- */
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 0 20px; 
}

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

/* --- CARTE PRODUIT UNIQUE & NETTOYÉE --- */
.product {
  background: white; 
  border-radius: 15px; 
  overflow: hidden;
  transition: all 0.3s ease; 
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
}

.product:hover { 
  transform: translateY(-10px); 
  box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}
/* Style du Panier Dropdown */
.cart-dropdown {
  position: absolute; /* Le détache pour qu'il flotte par-dessus le site */
  top: 70px; /* L'écarte vers le bas sous l'icône */
  right: 5%; /* L'aligne à droite de l'écran */
  background-color: white; /* Indispensable sinon il est transparent ! */
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  min-width: 300px;
  display: none; /* Le cache par défaut, ton JS l'ouvrira au clic */
  z-index: 3000; /* Force l'affichage au premier plan */
  color: #333; /* S'assure que le texte est bien lisible */
}
.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-name { font-weight: bold; font-size: 0.9rem; display: block; }
.cart-item-details { color: #888; font-size: 0.8rem; }
.cart-item-price { font-weight: bold; color: #d4af37; } /* Couleur Or pour le prix */

.cart-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.checkout-btn {
  flex: 2;
  background: #25D366; /* Vert WhatsApp */
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.clear-cart-btn {
  flex: 1;
  background: #ffeded;
  color: #ff4444;
  border: 1px solid #ff4444;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
}

.empty-msg { text-align: center; color: #aaa; padding: 20px 0; }

/* --- AFFICHAGE IMAGE HARMONIEUX (FINI LE ZOOM) --- */
.product-image-container {
  width: 100%;
  aspect-ratio: 1 / 1; /* Forcer un carré pour la grille */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #fcfcfc; /* Fond très léger */
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  padding: 10px; /* Padding pour ne pas que l'objet touche les bords */
}

.img-display {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* Garantit que l'image n'est ni zoomée ni coupée */
  transition: opacity 0.2s ease-in-out;
  display: block;
}

/* On enlève les styles .slider, .img-primary, .img-secondary qui ne sont plus utiles */

/* --- INFOS PRODUIT --- */
.product-info { 
  padding: 20px; 
  text-align: center; 
  flex-grow: 1; 
  display: flex; 
  flex-direction: column; 
}

.product h3 { 
  font-family: "Rouge Script", cursive; 
  font-size: 1.8rem; 
  margin-bottom: 8px; 
  color: var(--dark); 
}

.price { 
  color: var(--primary); 
  font-weight: bold; 
  font-size: 1.3rem; 
  margin: 10px 0; 
}

/* OPTIONS (Corrigé pour qu'il n'hérite pas de styles universels dérangeants) */
.options { 
  display: flex; 
  justify-content: center; 
  flex-wrap: wrap; /* Gère le débordement des options */
  gap: 8px; 
  margin-bottom: 15px; 
}

.option { 
  padding: 6px 14px; 
  border-radius: 20px; 
  background: #f0f0f0; 
  font-size: 0.8rem; 
  transition: 0.3s; 
  text-transform: capitalize; /* Yara, Yara pack 1, Yara pack 2 -> Capitaliser la première lettre */
}

.option.selected { 
  background: var(--primary); 
  color: white; 
}

/* QUANTITÉ & ACTIONS */
.quantity { 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  gap: 15px; 
  margin-bottom: 15px; 
}

.quantity button { 
  width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  border: 1px solid #ddd; 
  background: white; 
  font-size: 1rem;
}

.add-cart {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 25px;
  background: var(--primary);
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  transition: 0.3s;
  margin-top: auto; /* Pousse le bouton en bas de la carte */
}

.add-cart:hover { 
  background: #b71c46; 
}

/* --- 6. PANIER & FOOTER (NETTOYÉS ET OPTIMISÉS) --- 
/* Panier Flottant */
.floating-cart {
  position: fixed; 
  bottom: 30px; right: 30px;
  background: var(--primary); color: white;
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  font-size: 1.5rem; z-index: 3000;
  box-shadow: 0 5px 20px rgba(216, 27, 96, 0.4);
}


/* Footer Noir Nettoyé */
.main-footer {
  background: #000; 
  color: white; 
  padding: 40px 5% 20px;
  margin-top: 50px;
}

.footer-content {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 40px;
}

.footer-brand { flex: 1; min-width: 300px; }
.footer-logo-text { font-family: "Rouge Script", cursive; font-size: 3rem; color: var(--primary); margin-bottom: 10px; }

.footer-info { flex: 1; text-align: right; min-width: 300px; }
.footer-info h3 { color: var(--primary); margin-bottom: 20px; text-transform: uppercase; letter-spacing: 2px; }
.footer-info ul { list-style: none; }
.footer-info li { margin-bottom: 12px; color: #aaa; font-size: 0.9rem; }

.footer-socials { position: relative; left: 0; gap: 30px;} 
.footer-socials a { color: white; font-size: 1.8rem; transition: 0.3s; }
.footer-socials a:hover { color: var(--primary); transform: translateY(-5px); }

.footer-bottom {
  text-align: center; margin-top: 60px; padding-top: 20px;
  border-top: 1px solid #222; color: #555; font-size: 0.8rem;
}

/* --- 7. RESPONSIVE --- */
@media (max-width: 768px) {
  .hero-title { font-size: 3rem; }
  .site-title { font-size: 1.8rem; }
  .footer-info { text-align: left; }
  .footer-socials { justify-content: flex-start; }
  .menu { width: 80%; }
}
@media (max-width:480px) {
  .hero-title { font-size: 2.2rem; }
  .products { 
    gap: 20px; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Cartes plus petites sur mobile si besoin */
  }
}
/* --- 8. MODALE DE COMMANDE (POP-UP) --- */
.modal {
  display: none;
  position: fixed;
  z-index: 5000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Arrière-plan assombri */
  backdrop-filter: blur(4px); /* Effet de flou esthétique */
  align-items: center;
  justify-content: center;
}

/* Classe ajoutée par le JS pour afficher la modale au centre */
.modal.show {
  display: flex;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 450px;
  position: relative;
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
  animation: modalSlideIn 0.3s ease-out;
}

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

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--primary);
}

.modal-content h2 {
  font-family: "Rouge Script", cursive;
  font-size: 2.2rem;
  color: var(--primary);
  margin-bottom: 20px;
  text-align: center;
}

.checkout-form .form-group {
  margin-bottom: 15px;
}

.checkout-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--dark);
  font-size: 0.9rem;
}

.checkout-form input, 
.checkout-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s;
}
.checkout-form option{
  max-width: 100%;
}
.checkout-form input:focus, 
.checkout-form select:focus {
  border-color: var(--primary);
}

.checkout-summary {
  background: var(--secondary); /* Utilise ton rose pâle */
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
}

.checkout-summary p {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #555;
  font-size: 0.9rem;
}

.checkout-summary h3 {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  color: var(--primary);
  font-size: 1.2rem;
}
.paylink{
  width: 100%;
  font-style: normal;
  text-decoration-style: none;
  text-decoration: none;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.paylink::after{
  color: var(--primary);
}
.confirm-order-btn {
  width: 100%;
  background: #25D366; /* Vert officiel WhatsApp */
  color: white;
  border: none;
  padding: 14px;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.confirm-order-btn:hover {
  background: #1ebd5a;
  transform: scale(1.02);
}
/* --- Badge Épuisé --- */
.stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #e53935;
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

/* Bouton Ajouter au panier désactivé */
.add-cart:disabled {
  background: #ccc !important;
  color: #999 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.add-cart:disabled:hover {
  background: #ccc !important;
  transform: none !important;
}