:root {
  --vert-nuit: #0f2e24;
  --vert-nuit-clair: #163d30;
  --or: #c9a24a;
  --or-clair: #e0c37a;
  --fond: #faf9f5;
  --texte: #232323;
  --texte-doux: #5c5c5c;
  --carte: #ffffff;
  --ombre: 0 4px 18px rgba(15, 46, 36, 0.10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
  background: var(--fond);
  color: var(--texte);
}

.entete {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--vert-nuit) 0%, var(--vert-nuit-clair) 100%);
  color: #fff;
  padding: 28px 20px;
}

.circuits {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(201, 162, 74, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 74, 0.09) 1px, transparent 1px),
    radial-gradient(circle, rgba(224, 195, 122, 0.5) 1.7px, transparent 2.2px);
  background-size: 42px 42px, 42px 42px, 126px 126px;
  background-position: 0 0, 0 0, 21px 21px;
  animation: derive-grille 28s linear infinite;
}

@keyframes derive-grille {
  100% { background-position: 42px 42px, 42px 42px, 63px 147px; }
}

@media (prefers-reduced-motion: reduce) {
  .circuits { animation: none; }
}

.entete-contenu {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--or);
  flex-shrink: 0;
}

.entete h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.devise {
  margin: 4px 0 0;
  color: var(--or-clair);
  font-size: 0.85rem;
  font-style: italic;
}

.intro {
  max-width: 800px;
  margin: 24px auto 0;
  padding: 0 20px;
  text-align: center;
  color: var(--texte-doux);
  font-size: 0.95rem;
  line-height: 1.5;
}

.recherche-zone {
  max-width: 500px;
  margin: 20px auto 0;
  padding: 0 20px;
}

.recherche {
  width: 100%;
  border: 1px solid #d8d3c4;
  background: #fff;
  color: var(--texte);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.recherche:focus {
  outline: none;
  border-color: var(--or);
}

.categories, .sous-categories {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  justify-content: flex-start;
  scrollbar-width: thin;
}

@media (min-width: 700px) {
  .categories, .sous-categories {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
  }
}

.sous-categories { margin-top: 10px; }

.categorie {
  --cat-couleur: var(--vert-nuit);
  border: 1px solid #d8d3c4;
  border-left: 4px solid var(--cat-couleur);
  background: #fff;
  color: var(--texte);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.categorie:hover { border-color: var(--cat-couleur); }

.categorie.actif {
  background: var(--cat-couleur);
  border-color: var(--cat-couleur);
  color: #fff;
}

.categorie[data-principale="TOUT"] { --cat-couleur: var(--vert-nuit); }

.sous-categorie {
  border: 1px solid #e5e1d3;
  background: #f8f7f2;
  color: var(--texte-doux);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.sous-categorie:hover { border-color: var(--or); }

.sous-categorie.actif {
  background: var(--vert-nuit);
  border-color: var(--vert-nuit);
  color: #fff;
}

.grille-produits {
  max-width: 1100px;
  margin: 28px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.chargement, .vide {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--texte-doux);
  padding: 40px 0;
}

.carte-produit {
  background: var(--carte);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--ombre);
  border: 1px solid #f0ede3;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.carte-produit:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 26px rgba(15, 46, 36, 0.16);
  border-color: var(--or);
}

.carte-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f2f1ea;
  overflow: hidden;
}

.carte-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.carte-produit:hover .carte-photo img { transform: scale(1.06); }

.carte-photo.sans-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b9b4a3;
  font-size: 2rem;
}

.carte-corps { padding: 14px 16px 16px; flex: 1; display: flex; flex-direction: column; }

.carte-categorie {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--or);
  font-weight: 600;
  margin: 0 0 4px;
}

.carte-nom {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.carte-marque {
  margin: 0;
  font-size: 0.82rem;
  color: var(--texte-doux);
}

.pied {
  text-align: center;
  padding: 24px 20px 32px;
  color: var(--texte-doux);
  font-size: 0.82rem;
  border-top: 1px solid #ece8db;
}

.pied a { color: var(--vert-nuit); font-weight: 600; text-decoration: none; }
.pied a:hover { text-decoration: underline; }

.fiche-fond {
  position: fixed;
  inset: 0;
  background: rgba(15, 46, 36, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.fiche {
  background: #fff;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px;
  position: relative;
}

.fiche-fermer {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f2f1ea;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--texte);
}

.fiche-galerie {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.fiche-galerie img {
  width: 140px;
  height: 105px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

.fiche h2 { margin: 0 0 4px; font-size: 1.25rem; }
.fiche .fiche-meta { color: var(--texte-doux); font-size: 0.85rem; margin-bottom: 14px; }
.fiche p { line-height: 1.55; color: var(--texte); white-space: pre-line; }

.fiche-bouton {
  display: inline-block;
  margin-top: 12px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}

.fiche-bouton:hover { filter: brightness(1.05); }

@media (max-width: 480px) {
  .logo { width: 38px; height: 38px; border-radius: 9px; }
  .entete h1 { font-size: 1.1rem; }
  .devise { font-size: 0.78rem; }
  .grille-produits { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
}
