
/* 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;
  cursor: pointer;
  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;
}

/* Quand le panier contient des articles */
.mini-cart.active {
  background-color: #71a866;
  color: #fff;
  box-shadow: 0 0 10px rgba(113,168,102,0.6);
  animation: pulse 1.5s infinite;
}

.mini-cart-hint {
  font-size: 0.85em;
  color: #fff;
  margin-top: 4px;
  text-align: right;
}

/* 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; }
  .floating-cta {
    right: 20px;
    font-size: 1em;
  }
}

/* 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;
  }*/
  
  .mini-cart-wrapper {
  position: fixed;
  top: 60px;
  right: 15px;
  transform: none;
  z-index: 1004;
}
   #modes-retrait .products {
    grid-template-columns: repeat(2, 1fr); /* 2 cartes par ligne sur tablette */
  }
  #modes-retrait .product-card {
    max-width: 100%;
  }
  
  .floating-cta {
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 420px;
    text-align: center;
    font-size: 1.1em;
  }

  body {
    padding-bottom: 90px;
  }
  
}

/* 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;
}





/*NEW*/

/* Wrapper du mini-cart */
.mini-cart-wrapper {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  z-index: 1003;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* On enlève le positionnement du mini-cart */
.mini-cart {
  position: relative;
  top: auto;
  right: auto;
  transform: none;
}

/* Texte sous le panier */
.mini-cart-hint {
  margin-top: 4px;
  font-size: 0.8em;
  color: #fff;
  white-space: nowrap;
}


/* CTA flottant global */
.floating-cta {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;        /* à droite */
  z-index: 2000;

  background: #28a745;
  color: #fff;
  font-weight: bold;
  cursor: pointer;

  padding: 14px 22px;
  border-radius: 30px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);

  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Effet clic */
.floating-cta:active {
  transform: scale(0.97);
}