/* Boutique — feuille de style unique, mobile d'abord.
   Palette : nuit (texte), papier (fond), Majorelle (actions), safran (paiement à la livraison),
   menthe (disponibilité). Une seule famille : Readex Pro, latin et arabe. */

:root {
  --nuit: #1b1f3b;
  --nuit-2: #4a4f6e;
  --papier: #f6f7fb;
  --blanc: #ffffff;
  --majorelle: #2e4bc6;
  --majorelle-fonce: #22389a;
  --majorelle-pale: #e8ecfb;
  --safran: #f2b33d;
  --safran-pale: #fdf1d8;
  --menthe: #1f8a70;
  --rouge: #b42318;
  --trait: #d9dce8;
  --rayon: 14px;
  --rayon-petit: 10px;
  --police: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --gouttiere: 16px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--nuit);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

a { color: var(--majorelle); }

:focus-visible {
  outline: 3px solid var(--safran);
  outline-offset: 2px;
}

.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── En-tête ── */

.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--gouttiere);
  background: var(--blanc);
  border-bottom: 1px solid var(--trait);
}

.marque {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--nuit);
  text-decoration: none;
}

.langue {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--majorelle);
  background: none;
  border: 1.5px solid var(--majorelle);
  border-radius: 999px;
  padding: 4px 14px;
  cursor: pointer;
  min-height: 36px;
}

/* ── Motif zellige : la signature visuelle, utilisée quand il n'y a pas de photo ── */

.zellige {
  background-color: var(--majorelle);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.22' stroke-width='1.5'%3E%3Crect x='16' y='16' width='24' height='24'/%3E%3Crect x='16' y='16' width='24' height='24' transform='rotate(45 28 28)'/%3E%3Ccircle cx='28' cy='28' r='5'/%3E%3Cpath d='M0 0L8 8M56 0L48 8M0 56L8 48M56 56L48 48'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
  color: var(--blanc);
}

/* ── Page produit ── */

.produit {
  display: grid;
  gap: 0;
}

.galerie-cadre { position: relative; }

.galerie {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  aspect-ratio: 4 / 5;
  background: var(--blanc);
}
.galerie::-webkit-scrollbar { display: none; }

.galerie img,
.galerie .visuel-vide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
}

.visuel-vide {
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.points-galerie {
  position: absolute;
  inset-inline: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.points-galerie i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.points-galerie i.actif { background: var(--blanc); }

.fiche {
  padding: 20px var(--gouttiere) 120px;
  display: grid;
  gap: 22px;
}

.titre-produit {
  margin: 0;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.ligne-prix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 8px;
}

.prix {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--majorelle);
}

/* Le « tampon » paiement à la livraison : l'argument principal, en safran */
.tampon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--safran-pale);
  color: #7a4f00;
  border: 1.5px dashed var(--safran);
  border-radius: var(--rayon-petit);
  padding: 4px 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.description {
  margin: 0;
  color: var(--nuit-2);
  max-width: 60ch;
}

/* ── Choix taille / couleur ── */

.choix { border: 0; margin: 0; padding: 0; min-width: 0; }

.choix legend {
  font-weight: 600;
  margin-bottom: 10px;
  padding: 0;
}
.choix legend .valeur { font-weight: 400; color: var(--nuit-2); }

.pastilles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pastilles input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pastilles label {
  min-width: 56px;
  min-height: 48px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--trait);
  border-radius: var(--rayon-petit);
  background: var(--blanc);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.12s, background-color 0.12s;
}

.pastilles input:checked + label {
  border-color: var(--majorelle);
  background: var(--majorelle);
  color: var(--blanc);
}

.pastilles input:focus-visible + label {
  outline: 3px solid var(--safran);
  outline-offset: 2px;
}

.pastilles input:disabled + label {
  color: #a3a7bd;
  background: repeating-linear-gradient(135deg, var(--blanc) 0 6px, #f0f1f6 6px 12px);
  cursor: not-allowed;
  text-decoration: line-through;
}

.choix[data-invalide] .pastilles input:not(:disabled) + label { border-color: var(--rouge); }
.choix > .erreur-champ { color: var(--rouge); font-size: 0.88rem; margin: 8px 0 0; }

.guide-tailles {
  margin-top: 12px;
}
.guide-tailles summary {
  color: var(--majorelle);
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}
.guide-tailles table {
  margin-top: 10px;
  border-collapse: collapse;
  width: 100%;
  background: var(--blanc);
  font-size: 0.92rem;
}
.guide-tailles th,
.guide-tailles td {
  border: 1px solid var(--trait);
  padding: 8px 10px;
  text-align: start;
}
.guide-tailles th { background: var(--majorelle-pale); font-weight: 600; }

/* ── Prix dégressifs « Jemla » ── */

.paliers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.palier {
  font: inherit;
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 10px 6px;
  border: 1.5px solid var(--trait);
  border-radius: var(--rayon-petit);
  background: var(--blanc);
  color: var(--nuit);
  cursor: pointer;
}
.palier.actif { border-color: var(--majorelle); background: var(--majorelle-pale); }
.palier-qte { font-size: 0.85rem; color: var(--nuit-2); }
.palier-total { font-weight: 700; font-size: 1.05rem; }
.palier-unite { font-size: 0.8rem; color: var(--menthe); font-weight: 600; }

/* ── Lot ── */

.lot { display: grid; gap: 10px; }
.lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lignes li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon-petit);
  font-weight: 600;
}
.lien-retirer {
  font: inherit;
  font-size: 0.9rem;
  color: var(--rouge);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.bouton-secondaire {
  font: inherit;
  font-weight: 600;
  min-height: 48px;
  padding: 8px 14px;
  border: 1.5px dashed var(--majorelle);
  border-radius: var(--rayon-petit);
  background: none;
  color: var(--majorelle);
  cursor: pointer;
}
.recap .economie dd { color: var(--menthe); }

/* ── Catalogue par rubrique ── */

.rubrique + .rubrique { margin-top: 32px; }
.rubrique > h2 { margin: 0 0 14px; font-size: 1.15rem; font-weight: 700; }
.carte .des { font-size: 0.85rem; color: var(--menthe); font-weight: 600; }

/* ── Quantité ── */

.etiquette { margin: 0 0 10px; font-weight: 600; }
.aide { margin: 0; color: var(--nuit-2); font-size: 0.88rem; }


.quantite {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--trait);
  border-radius: var(--rayon-petit);
  background: var(--blanc);
  overflow: hidden;
}
.quantite button {
  font: inherit;
  font-size: 1.25rem;
  width: 48px;
  height: 48px;
  border: 0;
  background: none;
  color: var(--majorelle);
  cursor: pointer;
}
.quantite button:disabled { color: #c3c6d6; cursor: default; }
.quantite output {
  min-width: 40px;
  text-align: center;
  font-weight: 700;
}

/* ── Formulaire de commande ── */

.commande {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 20px 16px;
  display: grid;
  gap: 16px;
  scroll-margin-top: 16px;
}

.commande h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.champ { display: grid; gap: 6px; }

.champ label { font-weight: 600; font-size: 0.95rem; }

.champ input,
.champ select,
.champ textarea {
  font: inherit;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--trait);
  border-radius: var(--rayon-petit);
  background: var(--papier);
  color: var(--nuit);
}
.champ textarea { min-height: 76px; resize: vertical; }

.champ input:focus,
.champ select:focus,
.champ textarea:focus {
  outline: none;
  border-color: var(--majorelle);
  background: var(--blanc);
}

.champ input[dir="ltr"] { text-align: start; }
[dir="rtl"] .champ input[type="tel"] { text-align: right; }

.champ .erreur-champ {
  color: var(--rouge);
  font-size: 0.88rem;
  margin: 0;
}
.champ[data-invalide] input,
.champ[data-invalide] select,
.champ[data-invalide] textarea { border-color: var(--rouge); }

.recap {
  margin: 0;
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--trait);
}
.recap div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.recap dt { color: var(--nuit-2); }
.recap dd { margin: 0; font-weight: 600; }
.recap .total dt,
.recap .total dd { color: var(--nuit); font-size: 1.1rem; font-weight: 700; }

.bouton {
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: var(--rayon-petit);
  background: var(--majorelle);
  color: var(--blanc);
  cursor: pointer;
  padding: 10px 16px;
}
.bouton:hover { background: var(--majorelle-fonce); }
.bouton:disabled { opacity: 0.6; cursor: progress; }

.sous-bouton {
  margin: -6px 0 0;
  text-align: center;
  color: var(--nuit-2);
  font-size: 0.9rem;
}

.alerte {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--rayon-petit);
  background: #fdecea;
  color: var(--rouge);
  font-weight: 500;
}

/* ── Réassurance ── */

.reassurance {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.reassurance li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--nuit-2);
}
.reassurance svg { width: 24px; height: 24px; color: var(--menthe); margin-top: 1px; }
.reassurance strong { color: var(--nuit); font-weight: 600; display: block; }

/* ── Barre fixe mobile ── */

.barre-commande {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--gouttiere) calc(10px + env(safe-area-inset-bottom));
  background: var(--blanc);
  border-top: 1px solid var(--trait);
  transition: transform 0.2s ease;
}
.barre-commande[hidden] { display: flex; transform: translateY(110%); }
.barre-commande .montant { font-weight: 700; white-space: nowrap; }
.barre-commande .bouton { min-height: 48px; }

/* ── Confirmation ── */

.confirmation {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px var(--gouttiere) 48px;
  display: grid;
  gap: 18px;
}
.confirmation .bandeau {
  border-radius: var(--rayon);
  padding: 28px 22px;
}
.confirmation .bandeau p { margin: 0; opacity: 0.9; }
.confirmation .numero {
  display: block;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 4px;
}
.confirmation h1 { margin: 0; font-size: 1.5rem; line-height: 1.25; }
.confirmation ol { margin: 0; padding-inline-start: 22px; display: grid; gap: 8px; }

/* ── Catalogue ── */

.catalogue {
  padding: 20px var(--gouttiere) 48px;
  max-width: 1100px;
  margin: 0 auto;
}
.catalogue h1 { margin: 0 0 18px; font-size: 1.5rem; }
.grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.carte {
  display: grid;
  gap: 8px;
  align-content: start;
  color: inherit;
  text-decoration: none;
}
.carte .vignette {
  aspect-ratio: 4 / 5;
  border-radius: var(--rayon);
  overflow: hidden;
}
.carte .vignette:not(.zellige) { background: var(--blanc); }
.carte .vignette img { width: 100%; height: 100%; object-fit: cover; }
.carte h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.3; }
.carte .prix { font-size: 1rem; }

.etat {
  padding: 48px var(--gouttiere);
  text-align: center;
  color: var(--nuit-2);
}

/* ── Écrans larges ── */

@media (min-width: 860px) {
  .produit {
    max-width: 1100px;
    margin: 0 auto;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 40px;
    padding: 32px var(--gouttiere);
    align-items: start;
  }
  .galerie-cadre {
    position: sticky;
    top: 24px;
    border-radius: var(--rayon);
    overflow: hidden;
  }
  .fiche { padding: 0 0 48px; }
  .titre-produit { font-size: 2rem; }
  .barre-commande { display: none !important; }
  .grille { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

.grille > .etat { grid-column: 1 / -1; }

/* Titres qui reçoivent le focus par programme (annonce aux lecteurs d'écran) : pas de cadre visible. */
[tabindex="-1"]:focus { outline: none; }

/* ── Prix barré (ex. 249 barré → 199) ── */
.prix-barre { color: var(--nuit-2); font-size: 1.05rem; text-decoration-thickness: 2px; text-decoration-color: var(--rouge); }
.remise { background: var(--rouge); color: var(--blanc); font-weight: 700; font-size: .85rem; border-radius: 6px; padding: 2px 8px; }
.carte .prix-barre { font-size: .85rem; font-weight: 400; margin-inline-start: 4px; }
.carte .vignette { position: relative; }
.badge-remise {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: var(--rouge); color: var(--blanc); font-weight: 700; font-size: .8rem; border-radius: 6px; padding: 2px 7px;
}
/* Lignes du récapitulatif masquées (ex. « Économie » quand il n'y en a pas) */
.recap [hidden], .prix-barre[hidden], .remise[hidden] { display: none !important; }
