
/* box-sizing global pour éviter les problèmes de taille/chevauchement */
*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, p, ul, li { margin: 0; padding: 0; }
body {
  font-family: 'Georgia', serif;
  background-color: #fffaf5;
  color: #333;
  padding-top: 120px; /* espace pour header + menu fixes */
  scroll-behavior: smooth;
}

/* HEADER */
header {
  background: #d28c6e;
  color: #fff;
  text-align: center;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 1002;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
header .top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  position: relative;
}
header h1 {
  font-size: 1.6em;
  margin: 0;
}

.info-banner {
     background-color: #c7f5d3; /* vert clair */
    color: #1a3d1a;
    text-align: center;
    padding: 12px 15px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #a2d9b5;
}
/* MINI CART */
.mini-cart {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  background: #fff;
  color: #d28c6e;
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: bold;
  z-index: 1003;
  font-size: 0.9em;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, background 0.3s ease;
}
.mini-cart.animate {
  transform: translateY(-50%) scale(1.2);
  background: #f5d2c0;
}

/* MENU */
nav {
  background: #f4e1d2;
  width: 100%;
}
nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  padding: 10px 0;
}
nav ul li { margin: 0 15px; }
nav ul li a {
  color: #5b3822;
  text-decoration: none;
  font-weight: bold;
}
nav ul li a:hover { color: #d28c6e; }

/* BURGER */
.burger {
  display: none;
  cursor: pointer;
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
}
.burger div {
  width: 25px;
  height: 3px;
  background: #fff;
  margin: 4px 0;
}

/* PRODUITS - GRILLE (max 4 par ligne) */
.category-section { padding: 40px 20px; text-align: center; }
.category-header h2 { font-size: 1.8em; color: #5b3822; margin-bottom: 5px; }
.separator {
  width: 80px; height: 4px; background: #d28c6e;
  margin: 10px auto 30px auto; border-radius: 2px;
}

/* Grid contrôlée : 4 colonnes max, responsive par breakpoints */
.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 colonnes sur grand écran */
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}


/* Chaque carte prend tout l'espace de sa colonne, avec un max pour garder la ligne jolie */
.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* bouton en bas */
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 15px;
  width: 100%;
  max-width: 280px; /* empêchera les cartes d'être trop larges */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, background-color 0.3s ease, border 0.3s ease;
}
.product-card:hover { transform: scale(1.03); }
.product-card img { width: 100%; height: auto; border-radius: 10px; display:block; }
.product-card h3 { margin: 10px 0 5px 0; font-size: 1.05rem; }
.product-card p { color: #555; font-size: 0.9em; }


#mode-retrait .message-retrait {
  display: flex;
  align-items: center;
  justify-content: center; /* centrage horizontal */
  gap: 6px;
  font-size: 0.7rem;
  color: green;
  margin-top: 10px;
}

/* BOUTON AJOUTER */
.product-card button.add-btn {
  background: #d28c6e;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 15px;
  margin-top : 15px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.product-card button.add-btn:hover { background: #b06f52; }

/* COMPTEUR QUANTITÉ */
.quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.quantity-controls button {
  background-color: #f4e2d1;
  border: 1px solid #d28c6e;
  border-radius: 8px;
  width: 35px;
  height: 35px;
  font-size: 1.2em;
  font-weight: bold;
  color: #5c3b28;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.quantity-controls button:hover { background-color: #e8c8b3; }
.quantity-controls button:active { transform: scale(0.95); }
.quantity-controls span {
  font-size: 1em;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
  color: #5c3b28;
}

/* FOOTER */
footer {
  text-align: center;
  padding: 20px;
  background: #f4e1d2;
  color: #5b3822;
  font-size: 0.9em;
}

/* CENTRER LES CARTES DU MODE DE RETRAIT */
#mode-retrait .products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  justify-content: center;
  gap: 20px;
  max-width: 640px; /* 3 cartes × 200px + gaps */
  margin: 0 auto; /* centre la grille */
}

/* RESPONSIVE GRID BREAKPOINTS */
/* 3 colonnes <= 1200px */
@media screen and (max-width: 1200px) {
  .products { grid-template-columns: repeat(3, 1fr); }
  header h1 { font-size: 1.5em; }
}

/* 2 colonnes <= 768px (mobile large) */
@media screen and (max-width: 768px) {
  .products { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card { max-width: 260px; }

  header h1 { font-size: 1.4em; }
  .burger { display: block; }

  nav ul {
    display: none;
    flex-direction: column;
    align-items: center;
    background: rgba(210,140,110,0.95);
    backdrop-filter: blur(6px);
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: 0 0 10px 10px;
    z-index: 1001;
  }
  nav ul.active { display: flex; }
  nav ul li { margin: 12px 0; }
  nav ul li a { font-size: 1.2em; color: #fff; }

  .mini-cart {
    position: fixed;
    top: 60px;
    right: 15px;
    transform: none;
    z-index: 1004;
    font-size: 0.85em;
  }
   #modes-retrait .products {
    grid-template-columns: repeat(2, 1fr); /* 2 cartes par ligne sur tablette */
  }
  #modes-retrait .product-card {
    max-width: 100%;
  }
}

/* 1 colonne sur très petit écrans <= 400px */
@media screen and (max-width: 400px) {
  .products { grid-template-columns: 1fr; }
  .product-card { max-width: 95%; }
  #modes-retrait .products {
    grid-template-columns: 1fr; /* 1 carte par ligne sur mobile */
  }
  #modes-retrait .product-card {
    max-width: 100%;
  }
}

/* Bouton sélectionné */
.add-btn.selected-btn {
  background-color: #28a745 !important; /* vert */
  color: #fff;
}


#mode-retrait .product-card.selected-mode {
  border: 2px solid #28a745;
  background-color: #d4edda;
  transition: all 0.2s ease-in-out;
}

