/* =========================
   RESET & BASE
========================= */

* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  margin: 0;
  background: #f4f4f4;
  color: #333;
}

/* =========================
   HEADER
========================= */

header {
  text-align: center;
  padding: 30px 20px;
  background: #222;
  color: #fff;
}

header h1 {
  margin: 0 0 10px;
}

header p {
  margin: 0;
  font-size: 0.95em;
}

/* =========================
   GALERIE PRODUITS
========================= */

/* Mobile : 2 colonnes */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  padding: 15px;
}

/* Tablette : 3 à 5 colonnes */
@media (min-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
  }
}

/* PC : 5 à 8 colonnes */
@media (min-width: 1000px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    max-width: 1600px;
    margin: auto;
  }
}

/* =========================
   CARTE PRODUIT
========================= */

.product {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.product:hover {
  transform: translateY(-4px);
}

.product h2 {
  margin: 10px 0 6px;
  font-size: 1em;
}

.description {
  font-size: 0.85em;
  color: #666;
  margin: 0 0 8px;
}

.price {
  font-weight: bold;
  font-size: 0.9em;
  margin-bottom: 10px;
}

/* =========================
   IMAGE PRODUIT (CARRÉE)
========================= */

.product img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
}

/* =========================
   BOUTON
========================= */

.btn {
  display: inline-block;
  width: 100%;
  padding: 10px;
  background: #0070ba;
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.9em;
}

.btn:hover {
  background: #005c99;
}

/* =========================
   FOOTER
========================= */

footer {
  text-align: center;
  padding: 20px;
  background: #ddd;
  font-size: 0.85em;
}

/* =========================
   OPTIMISATION MOBILE
========================= */

@media (max-width: 600px) {

  header h1 {
    font-size: 1.5em;
  }

  .btn {
    padding: 14px;
    font-size: 1em;
  }

}

/* =========================
   VACANCES
========================= */
.banner-alert {
  background-color: #ffcc00; /* jaune alerte */
  color: #222;
  text-align: center;
  padding: 15px 20px;
  font-weight: bold;
  border-radius: 8px;
  margin: 20px auto;
  max-width: 900px; /* aligné avec ton main */
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  font-size: 1rem;
}

/* =========================
   PANIER
========================= */

.cart {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cart h2 {
  text-align: center;
  margin-bottom: 15px;
}

#cart-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

#cart-items li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9em;
}

.cart-total {
  font-weight: bold;
  text-align: right;
  margin: 15px 0;
}
.cart-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-actions button {
  border: none;
  background: #ddd;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.8em;
}

.cart-actions button:hover {
  background: #bbb;
}
/* =========================
   PANIER FLOTTANT
========================= */

#cart-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0070ba;
  color: #fff;
  padding: 14px 16px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.1em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  z-index: 999;
}

#cart-count {
  background: #ff4444;
  border-radius: 50%;
  padding: 2px 7px;
  font-size: 0.8em;
  margin-left: 5px;
}
/* =========================
   PAGE PRODUIT
========================= */

.product-page {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  max-width: 900px;
  margin: 30px auto;
  padding: 20px;
}

.product-page .product-image {
  flex: 0 0 280px; /* largeur fixe de la colonne image */
  text-align: center;
}

.product-page .product-image img {
  max-width: 260px;   /* 🔥 taille réelle de l’image */
  width: 100%;
  height: auto;
  aspect-ratio: auto; /* annule le carré */
  object-fit: contain; /* pas de rognage */
  border-radius: 10px;
  background: #fff;
}
@media (max-width: 600px) {
  .product-page {
    flex-direction: column;
    align-items: center;
  }

  .product-page .product-image img {
    max-width: 220px;
  }
}
/* =========================
   ZOOM IMAGE PRODUIT
========================= */

.zoomable {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

/* Overlay */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.zoom-overlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  background: #fff;
  cursor: zoom-out;
}
/* =========================
   CARROUSEL PRODUIT
========================= */

.carousel {
  position: relative;
  width: 260px;
  margin: auto;
}

.carousel-track {
  overflow: hidden;
}

.carousel-track img {
  width: 100%;
  display: none;
  border-radius: 10px;
  background: #fff;
}

/* Image active */
.carousel-track img.active {
  display: block;
}

/* Flèches */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1.4em;
  padding: 8px 12px;
  border-radius: 50%;
  cursor: pointer;
}

.carousel-btn.prev { left: -15px; }
.carousel-btn.next { right: -15px; }

.carousel-btn:hover {
  background: rgba(0,0,0,0.8);
}
.categories {
  text-align: center;
  margin-bottom: 20px;
}

.categories button {
  margin: 5px;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 5px;
  border: none;
  background: #eee;
}

.categories button:hover {
  background: #ddd;
}
/* =========================
   ANIMATION FILTRAGE PRODUITS
========================= */

.product {
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

/* État masqué (animation) */
.product.hidden {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
}
/* =========================
   ANIMATION GALERIE
========================= */

.gallery {
  transition: opacity 0.25s ease;
}

.gallery.fading {
  opacity: 0;
}
/* =========================
   MENU SANDWICH (DROITE)
========================= */

#menu-toggle {
  position: fixed;
  top: 20px;
  right: 20px; /* 🔥 à droite */
  font-size: 1.8em;
  background: #0070ba;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

/* Menu latéral */
#side-menu {
  position: fixed;
  top: 0;
  right: -260px; /* caché à droite */
  width: 260px;
  height: 100%;
  background: #222;
  transition: right 0.3s ease;
  z-index: 1002;
  display: flex;
  flex-direction: column;
}

/* Menu ouvert */
#side-menu.open {
  right: 0;
}

/* Logo */
.menu-logo {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.menu-logo img {
  max-width: 140px;
  height: auto;
}

/* Liens */
#side-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#side-menu li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

#side-menu a {
  display: block;
  padding: 16px 20px;
  color: #fff;
  text-decoration: none;
  font-size: 1.05em;
}

#side-menu a:hover {
  background: #0070ba;
}

/* Overlay */
#menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

#menu-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.categories button.active {
  background: #0070ba;
  color: #fff;
}
