:root {
  --ardoise: #4f5566;
  --ardoise-fonce: #383d4b;
  --acier: #7883a3;
  --acier-clair: #dfe3ee;
  --orange: #e8541c;
  --orange-fonce: #c6430f;
  --fond: #f2f3f7;
  --carte: #ffffff;
  --texte: #23262f;
  --gris: #6b7080;
  --bord: #e2e5ec;
  --vert: #2f8f5b;
  --rouge: #c0392b;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(30, 34, 45, .06), 0 6px 20px rgba(30, 34, 45, .06);
  --titre: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --corps: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--corps); color: var(--texte); background: var(--fond); font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--orange-fonce); }
.cache { display: none !important; }
.conteneur { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- En-tête ---------- */
.entete { background: var(--ardoise); color: #fff; position: relative; overflow: hidden; }
.entete::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--orange) 0 70%, #fff 70% 72%, var(--acier) 72% 100%); }
.entete-barre { display: flex; align-items: center; gap: 14px; padding-top: 14px; padding-bottom: 18px; }
.entete-logo { width: 62px; height: 62px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .3)); }
.entete-titre { font-family: var(--titre); font-weight: 700; font-size: 26px; letter-spacing: .5px; line-height: 1; text-transform: uppercase; }
.entete-titre small { display: block; font-family: var(--corps); font-weight: 500; font-size: 13px; letter-spacing: .3px; text-transform: none; opacity: .75; margin-top: 4px; }
.entete-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-entete { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); color: #fff; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn-entete:hover { background: rgba(255, 255, 255, .18); }
.btn-entete .pastille { background: var(--orange); color: #fff; border-radius: 99px; min-width: 20px; height: 20px; font-size: 12px; display: inline-grid; place-items: center; padding: 0 6px; }

.hero { background: linear-gradient(180deg, var(--ardoise) 0, var(--ardoise) 100%); color: #fff; padding: 6px 0 26px; }
.hero h1 { font-family: var(--titre); font-size: clamp(30px, 6vw, 46px); line-height: 1; margin: 6px 0 10px; text-transform: uppercase; letter-spacing: .5px; }
.hero h1 span { color: var(--orange); }
.hero p { margin: 0; max-width: 640px; opacity: .85; }

.banniere-demo { background: #fff4d6; color: #6b4e00; text-align: center; font-size: 14px; padding: 8px 16px; border-bottom: 1px solid #f0dd9d; }

/* ---------- Barre membre + filtres ---------- */
.outils { position: sticky; top: 0; z-index: 20; background: rgba(242, 243, 247, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--bord); }
.outils-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-top: 12px; padding-bottom: 12px; }
.membre { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--bord); padding: 6px 6px 6px 14px; border-radius: 99px; font-weight: 600; font-size: 14px; }
.segment { display: inline-flex; background: var(--fond); border-radius: 99px; padding: 3px; }
.segment button { border: 0; background: transparent; padding: 6px 14px; border-radius: 99px; font-weight: 600; font-size: 14px; color: var(--gris); }
.segment button.actif { background: var(--orange); color: #fff; box-shadow: 0 1px 4px rgba(232, 84, 28, .35); }
.filtres { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.filtres::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--bord); background: #fff; padding: 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--ardoise); }
.chip.actif { background: var(--ardoise); border-color: var(--ardoise); color: #fff; }

/* ---------- Catalogue ---------- */
.section-titre { font-family: var(--titre); text-transform: uppercase; font-size: 22px; letter-spacing: .5px; margin: 28px 0 12px; display: flex; align-items: center; gap: 10px; color: var(--ardoise-fonce); }
.section-titre::before { content: ''; width: 18px; height: 4px; background: var(--orange); border-radius: 2px; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.produit { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--bord); }
.produit-visuel { aspect-ratio: 4 / 3; background: radial-gradient(circle at 30% 20%, #eef1f8, #d7dceb); position: relative; display: grid; place-items: center; overflow: hidden; }
.produit-visuel img.photo { width: 100%; height: 100%; object-fit: cover; }
.produit-visuel .filigrane { width: 46%; opacity: .9; filter: drop-shadow(0 6px 14px rgba(40, 46, 70, .18)); }
.etiquette { position: absolute; top: 10px; left: 10px; background: var(--ardoise); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; }
.etiquette.membres { background: var(--orange); }
.produit-corps { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.produit-nom { font-family: var(--titre); font-weight: 700; font-size: 21px; line-height: 1.1; text-transform: uppercase; margin: 0; }
.produit-desc { color: var(--gris); font-size: 14px; margin: -4px 0 0; }
.prix { display: flex; align-items: baseline; gap: 8px; }
.prix strong { font-family: var(--titre); font-size: 26px; color: var(--orange); }
.prix .barre { color: var(--gris); text-decoration: line-through; font-size: 14px; }
.prix .info { font-size: 12px; color: var(--gris); }
.tailles { display: flex; flex-wrap: wrap; gap: 6px; }
.taille { min-width: 44px; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--bord); background: #fff; font-size: 13px; font-weight: 600; color: var(--ardoise); }
.taille.choisie { border-color: var(--orange); background: #fff1eb; color: var(--orange-fonce); box-shadow: inset 0 0 0 1px var(--orange); }
.ajout { display: flex; gap: 8px; margin-top: auto; }
.qte { display: inline-flex; align-items: center; border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; }
.qte button { border: 0; background: #fff; width: 34px; height: 40px; font-size: 18px; color: var(--ardoise); }
.qte span, .qte input { width: 32px; text-align: center; font-weight: 700; border: 0; }
.btn { border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-fonce); }
.btn-orange:disabled { background: #e7b9a7; cursor: not-allowed; }
.btn-gris { background: var(--acier-clair); color: var(--ardoise-fonce); }
.btn-gris:hover { background: #d2d7e5; }
.btn-ligne { background: #fff; border: 1px solid var(--bord); color: var(--ardoise); }
.btn-plein { flex: 1; }
.ferme { background: #fff; border-radius: var(--rayon); padding: 28px; text-align: center; margin-top: 24px; box-shadow: var(--ombre); }
.ferme h2 { font-family: var(--titre); text-transform: uppercase; margin: 0 0 6px; }

/* ---------- Panier (tiroir) ---------- */
.voile { position: fixed; inset: 0; background: rgba(25, 28, 38, .45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.voile.ouvert { opacity: 1; pointer-events: auto; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #fff; z-index: 50; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.tiroir.ouvert { transform: none; }
.tiroir-tete { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--bord); }
.tiroir-tete h2 { margin: 0; font-family: var(--titre); text-transform: uppercase; font-size: 22px; }
.fermer { border: 0; background: var(--fond); width: 36px; height: 36px; border-radius: 10px; font-size: 20px; line-height: 1; }
.tiroir-corps { flex: 1; overflow-y: auto; padding: 16px 18px; }
.tiroir-pied { border-top: 1px solid var(--bord); padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.ligne-panier { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; border-bottom: 1px dashed var(--bord); }
.ligne-panier .nom { font-weight: 700; }
.ligne-panier .sous { color: var(--gris); font-size: 14px; }
.ligne-panier .qte { justify-self: start; }
.ligne-panier .montant { font-weight: 700; text-align: right; }
.ligne-panier .actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.lien { background: none; border: 0; color: var(--gris); text-decoration: underline; font-size: 13px; padding: 0; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.total strong { font-family: var(--titre); font-size: 28px; color: var(--orange); }
.vide { text-align: center; color: var(--gris); padding: 40px 10px; }

/* ---------- Formulaires ---------- */
.champ { display: grid; gap: 5px; margin-bottom: 12px; }
.champ label { font-size: 13px; font-weight: 700; color: var(--ardoise); }
.champ input, .champ select, .champ textarea { border: 1px solid #cfd4df; border-radius: 10px; padding: 10px 12px; background: #fff; width: 100%; }
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 2px solid rgba(232, 84, 28, .35); border-color: var(--orange); }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.note { font-size: 13px; color: var(--gris); }
.erreur { background: #fdecea; color: var(--rouge); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.succes { text-align: center; padding: 20px 4px; }
.succes .coche { width: 64px; height: 64px; border-radius: 50%; background: #e7f5ed; color: var(--vert); display: grid; place-items: center; font-size: 34px; margin: 0 auto 12px; }
.succes .num { font-family: var(--titre); font-size: 30px; color: var(--orange); letter-spacing: 1px; }

/* ---------- Modale ---------- */
.modale { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(25, 28, 38, .5); }
.modale-boite { background: #fff; border-radius: 16px; width: min(460px, 100%); max-height: 90vh; overflow: auto; padding: 20px; }
.modale-boite h2 { margin: 0 0 12px; font-family: var(--titre); text-transform: uppercase; }
.statut { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.s-a-traiter { background: #fff1d6; color: #8a5a00; }
.s-confirmee { background: #e3e9ff; color: #2f47a8; }
.s-en-attente { background: #e2f3ff; color: #0f6a96; }
.s-remise { background: #e3f5ea; color: #1f7a48; }
.s-annulee { background: #f1f1f3; color: #7a7d88; text-decoration: line-through; }
.etapes { display: flex; gap: 4px; margin: 14px 0; }
.etapes div { flex: 1; height: 6px; border-radius: 3px; background: var(--acier-clair); }
.etapes div.ok { background: var(--orange); }

/* ---------- Barre panier mobile ---------- */
.barre-panier { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; display: none; }
.barre-panier .btn { width: 100%; padding: 14px; font-size: 16px; box-shadow: 0 8px 24px rgba(232, 84, 28, .35); justify-content: space-between; border-radius: 14px; }

/* ---------- Pied ---------- */
.pied { margin-top: 48px; background: var(--ardoise-fonce); color: rgba(255, 255, 255, .75); font-size: 14px; }
.pied-in { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; padding: 22px 16px 90px; }
.pied a { color: #fff; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: var(--ardoise-fonce); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; z-index: 80; opacity: 0; transition: .2s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--rouge); }

.chargement { display: grid; place-items: center; padding: 60px; color: var(--gris); }
.roue { width: 34px; height: 34px; border: 3px solid var(--acier-clair); border-top-color: var(--orange); border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Fiche article (volet) ---------- */
.btn-choisir { display: none; }
.feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: #fff; border-radius: 20px 20px 0 0; max-height: 92vh; display: flex; flex-direction: column; transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -10px 40px rgba(20, 24, 36, .25); }
.feuille.ouvert { transform: none; }
.poignee { width: 42px; height: 5px; border-radius: 3px; background: #d5d9e3; margin: 10px auto 0; flex: none; }
.feuille-fermer { position: absolute; right: 14px; top: 12px; }
.feuille-corps { overflow-y: auto; padding: 8px 18px 12px; display: flex; flex-direction: column; gap: 10px; }
.feuille-corps > * { flex-shrink: 0; }
.feuille-corps .produit-nom { font-size: 24px; }
.feuille-corps .produit-desc { margin: -4px 0 0; }
.feuille-visuel { height: 150px; flex: none; border-radius: 14px; background: radial-gradient(circle at 30% 20%, #eef1f8, #d7dceb); display: grid; place-items: center; overflow: hidden; margin: 6px 40px 4px 0; }
.feuille-visuel .photo { width: 100%; height: 100%; object-fit: cover; }
.feuille-visuel .filigrane { height: 118px; width: 118px; }
.feuille-label { font-size: 13px; font-weight: 700; color: var(--gris); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.tailles-grandes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.tailles-grandes .taille { height: 48px; font-size: 15px; border-radius: 12px; }
.qte-grande { align-self: flex-start; border-radius: 12px; }
.qte-grande button { width: 52px; height: 48px; font-size: 22px; }
.qte-grande span { width: 44px; font-size: 18px; }
.feuille-pied { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--bord); }
.feuille-pied .btn { width: 100%; padding: 15px; font-size: 17px; border-radius: 14px; }
body.fige { overflow: hidden; }

@media (max-width: 720px) {
  /* En-tête compact */
  .entete-barre { padding-top: 10px; padding-bottom: 14px; gap: 10px; }
  .entete-logo { width: 42px; height: 42px; }
  .entete-titre { font-size: 17px; }
  .entete-titre small { font-size: 11px; margin-top: 2px; }
  .btn-entete { padding: 9px 11px; border-radius: 12px; }
  .btn-entete .txt { display: none; }
  .hero { padding: 0 0 16px; }
  .hero h1 { font-size: 23px; margin: 0 0 4px; }
  .hero p { font-size: 13px; opacity: .75; }
  .banniere-demo { font-size: 12px; padding: 6px 12px; }

  /* Barre membre + catégories */
  .outils-in { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .membre { width: 100%; justify-content: space-between; padding: 4px 4px 4px 14px; }
  .segment button { padding: 8px 18px; }
  .filtres { margin: 0 -16px; padding: 0 16px; width: calc(100% + 32px); }
  .chip { padding: 8px 14px; }

  /* Articles en liste compacte */
  .section-titre { font-size: 19px; margin: 20px 0 10px; }
  .grille { grid-template-columns: 1fr; gap: 10px; }
  .produit { display: grid; grid-template-columns: 92px 1fr; grid-template-rows: auto; align-items: stretch; cursor: pointer; border-radius: 14px; -webkit-tap-highlight-color: transparent; }
  .produit:active { transform: scale(.99); }
  .produit-visuel { aspect-ratio: auto; width: 92px; height: 100%; min-height: 104px; }
  .produit-visuel .filigrane { width: 72%; }
  .produit-corps { padding: 11px 12px; gap: 3px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "nom nom" "desc desc" "prix btn"; align-items: center; }
  .produit .produit-nom { grid-area: nom; font-size: 17px; }
  .produit .produit-desc { grid-area: desc; font-size: 13px; margin: 0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .produit .prix { grid-area: prix; flex-wrap: wrap; gap: 0 6px; margin-top: 4px; }
  .produit .prix strong { font-size: 22px; }
  .produit .prix .info { font-size: 11px; }
  .produit .tailles, .produit .ajout { display: none; }
  .btn-choisir { display: inline-flex; grid-area: btn; padding: 10px 16px; border-radius: 12px; margin-top: 4px; }
  .etiquette { font-size: 9px; padding: 3px 5px; top: 6px; left: 6px; }

  /* Barre panier en bas */
  .barre-panier.visible { display: block; }
  body:has(.barre-panier.visible) main { padding-bottom: 76px; }
  .toast { top: calc(12px + env(safe-area-inset-top)); bottom: auto; transform: translate(-50%, -30px); }
  .toast.show { transform: translate(-50%, 0); }

  /* Panier plein écran */
  .tiroir { width: 100%; }
  .tiroir-tete { padding: 12px 16px; }
  .tiroir-corps { padding: 12px 16px; }
  .tiroir-pied .btn { padding: 15px; font-size: 17px; border-radius: 14px; }
  .ligne-panier .qte button { width: 42px; height: 42px; }

  /* Suivi en volet bas */
  .modale { place-items: end stretch; padding: 0; }
  .modale-boite { width: 100%; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); }
  .pied-in { padding-bottom: 100px; }
}
@media (max-width: 380px) { .deux { grid-template-columns: 1fr; } }
