:root { color-scheme: dark; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #e8e8e8;
  background: #121212;
  line-height: 1.5;
}

header {
  background: #1a1a1a;
  color: #fff;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 { font-size: 2rem; font-weight: 600; line-height: 1.15; }

header h1 a {
  color: inherit;
  text-decoration: none;
  display: block;
}

header h1 a:hover { color: #ccc; }

.nom-site-ligne2 {
  display: block;
  font-size: 0.5em;
  font-weight: 500;
  color: #bbb;
}

.selecteur-langue {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.selecteur-langue a {
  color: #999;
  text-decoration: none;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.selecteur-langue a:hover { color: #fff; }

.selecteur-langue a.lang-actif {
  color: #fff;
  font-weight: 700;
  background: rgba(255,255,255,0.12);
}

.selecteur-langue span { color: #555; }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

/* Le catalogue utilise toute la largeur disponible du navigateur ;
   les autres pages (commande, confirmation) restent limitées à 960px pour rester lisibles. */
body.page-catalogue main {
  max-width: none;
}

/* La barre récapitulative est en position fixed, donc elle sort du flux normal
   et ne pousse aucun élément suivant. Comme <footer> est un frère de <main>
   (pas un enfant), un padding-bottom sur main seul ne le protège pas : il faut
   réserver l'espace directement sur le footer de cette page. */
body.page-catalogue footer {
  margin-bottom: 6rem;
}

@media (max-width: 480px) {
  /* Sur mobile la barre passe en colonne (voir .barre-recap ci-dessous) et
     devient plus haute : on augmente la réserve d'espace en conséquence. */
  body.page-catalogue footer {
    margin-bottom: 9rem;
  }
}

body.page-catalogue .header-inner {
  max-width: none;
}

main > p { color: #bbb; }

.grille-produits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.barre-recherche {
  margin-top: 1.5rem;
}

.barre-recherche input {
  width: 100%;
  max-width: 360px;
  padding: 0.6rem 0.9rem;
  border: 1px solid #444;
  border-radius: 6px;
  background: #1e1e1e;
  color: #eee;
  font-size: 0.95rem;
}

.barre-recherche input::placeholder { color: #888; }
.barre-recherche input:focus { outline: none; border-color: #D8232A; }

.aucun-resultat {
  grid-column: 1 / -1;
  color: #999;
  padding: 2rem 0;
  text-align: center;
}

.carte-produit {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.carte-produit:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-color: #444;
}

.carte-produit.selectionnee {
  border-color: #D8232A;
  box-shadow: 0 0 0 1px #D8232A;
}

/* L'attribut HTML "hidden" est normalement traduit en display:none par le
   navigateur, mais notre règle .carte-produit { display: flex } est plus
   spécifique et l'emporterait sinon — on force explicitement le masquage ici. */
.carte-produit[hidden] {
  display: none;
}

.carte-produit img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  background: #2a2a2a;
  margin-bottom: 0.75rem;
}

.carte-produit h2 { font-size: 1.05rem; margin-bottom: 0.25rem; color: #f2f2f2; }
.carte-produit p { font-size: 0.9rem; color: #aaa; flex-grow: 1; margin-bottom: 0.75rem; }
.prix { font-weight: 600; font-size: 1.1rem; margin-bottom: 0.75rem; color: #fff; }

.selection-produit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.option-produit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: #ddd;
}

.option-produit input { width: auto; }

.qte-produit {
  width: 60px;
  padding: 0.4rem;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #2a2a2a;
  color: #eee;
}

.qte-produit:disabled {
  background: #232323;
  color: #666;
  cursor: not-allowed;
}

.barre-recap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: #1a1a1a;
  border-top: 1px solid #333;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}

.recap-texte {
  font-size: 0.95rem;
  color: #ddd;
}

.bouton-commander {
  font-size: 1.05rem;
  padding: 0.8rem 2.5rem;
  flex-shrink: 0;
  order: -1; /* place le bouton tout à gauche visuellement, sans changer
                l'ordre du DOM (le récapitulatif reste lu en premier
                par les lecteurs d'écran) */
}

.bouton {
  display: inline-block;
  background: #D8232A;
  color: #fff;
  text-decoration: none;
  text-align: center;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.bouton:hover { background: #b91d24; }

.bouton:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
}

input[type="checkbox"], input[type="radio"] {
  accent-color: #D8232A;
}

@media (max-width: 480px) {
  .barre-recap {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 0.75rem 1rem;
  }
}

form.commande {
  margin-top: 1.5rem;
}

.recap-selection {
  width: 100%;
  max-width: 480px;
  margin-top: 1.5rem;
  border-collapse: collapse;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

.recap-selection td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #2a2a2a;
}

.recap-selection tr:last-child td { border-bottom: none; }
.recap-selection .montant { text-align: right; }
.recap-selection .ligne-sous-total { font-weight: 600; }
.recap-selection .ligne-sous-total td { background: #232323; }
.recap-selection .ligne-livraison td { color: #bbb; font-size: 0.9rem; }
.recap-selection .ligne-total { font-weight: 700; font-size: 1.05rem; }
.recap-selection .ligne-total td { background: #2a2a2a; color: #fff; }

.section-commande {
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
  max-width: 480px;
}

.section-commande h2 { font-size: 1.2rem; margin-bottom: 0.5rem; color: #f2f2f2; }
.section-commande > p { font-size: 0.9rem; color: #aaa; margin-bottom: 1rem; }

.champ { margin-bottom: 1rem; }
.champ label { display: block; font-size: 0.9rem; margin-bottom: 0.3rem; font-weight: 500; color: #ddd; }
.champ input, .champ textarea, .champ select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 0.95rem;
  background: #2a2a2a;
  color: #eee;
}

.champ input::placeholder, .champ textarea::placeholder { color: #777; }

.option-livraison {
  display: block;
  font-weight: 400;
  font-size: 0.95rem;
  margin-top: 0.4rem;
  color: #ddd;
}

.option-livraison input { width: auto; margin-right: 0.4rem; }

.info-livraison {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.4rem;
}

.note-tva {
  font-size: 0.8rem;
  color: #999;
  text-align: right;
  margin-top: 0.4rem;
  max-width: 480px;
}

.cgv-contenu {
  white-space: pre-line;
  line-height: 1.6;
  color: #ddd;
  margin-top: 1rem;
  max-width: 720px;
}

.lien-cgv {
  color: #999;
  text-decoration: none;
  font-size: 0.85rem;
}

.lien-cgv:hover { color: #fff; }

.header-droite {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bloc-iban {
  background: #16261a;
  border: 1px solid #2e4a34;
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.bloc-iban dl { display: grid; grid-template-columns: 140px 1fr; gap: 0.4rem 1rem; margin-top: 0.75rem; color: #d5e8d5; }
.bloc-iban dt { font-weight: 600; }
.bloc-iban .reference { font-size: 1.2rem; font-weight: 700; color: #5fd97f; }

.avertissement {
  background: #2e2712;
  border: 1px solid #5c4e21;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
  color: #f0dca0;
}

footer {
  border-top: 1px solid #2a2a2a;
  margin-top: 3rem;
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
}

footer p { margin: 0.2rem 0; }

footer a {
  color: #888;
  text-decoration: none;
}

footer a:hover { color: #ccc; }

.titre-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-principal {
  height: 130px;
  width: auto;
  display: block;
}
