/* Tablette « cabine d'essayage » MADARA (2026-11-14) — écran tactile, palette de la boutique. */
:root {
  --creme: #FBF6F2; --creme-2: #F4EAE3; --rose: #F2DFD5; --ligne: #E7D6CC;
  --encre: #3A2C26; --brun: #562F1F; --terre: #C15D37; --terre-2: #A94F2C; --doux: #8C7366;
  --vert: #3F7A4D; --rouge: #B3261E;
  --ombre: 0 18px 50px rgba(86, 47, 31, .14);
  --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--creme); color: var(--encre); font-family: 'Poppins', system-ui, sans-serif; font-size: 17px; overflow: hidden;
  user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--terre); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; color: var(--brun); }
.logo { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; letter-spacing: .28em; color: var(--terre); }
.logo.grand { font-size: 34px; text-align: center; margin-bottom: 10px; }

/* Barre du haut */
.barre { position: fixed; inset: 0 0 auto 0; height: 76px; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; background: rgba(251, 246, 242, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ligne); }
.marque { display: flex; align-items: baseline; gap: 14px; }
.marque .logo { font-size: 26px; }
.marque .sous { font-size: 14px; color: var(--doux); letter-spacing: .04em; }
.barre-actions { display: flex; gap: 12px; }
.btn-panier { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--brun); color: #fff; font-weight: 600; }
.btn-panier svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.btn-panier b { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: var(--terre); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.btn-panier.bouge { animation: bouge .5s ease; }
@keyframes bouge { 30% { transform: scale(1.08); } }
.btn-fin { height: 52px; padding: 0 20px; border: 1.5px solid var(--ligne); border-radius: 999px; background: #fff; font-weight: 600; color: var(--brun); }

/* Écrans */
.ecran { position: fixed; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#ecran-catalogue, #ecran-photo { top: 76px; }
.ecran.centre { display: flex; align-items: center; justify-content: center; padding: 24px; }

/* Boutons */
.btn-principal { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 60px; padding: 14px 24px; border: 0; border-radius: 16px;
  background: var(--terre); color: #fff; font-size: 18px; font-weight: 600; box-shadow: 0 10px 24px rgba(193, 93, 55, .28); transition: transform .12s ease, background .2s ease; }
.btn-principal:active { transform: scale(.98); background: var(--terre-2); }
.btn-principal:disabled { background: #D9BFB2; box-shadow: none; }
.btn-principal small { font-weight: 400; opacity: .85; }
.btn-principal.geant { min-height: 70px; font-size: 20px; }
.btn-secondaire { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 12px 20px; border: 1.5px solid var(--ligne);
  border-radius: 16px; background: #fff; color: var(--brun); font-size: 17px; font-weight: 600; }
.btn-secondaire:active { background: var(--creme-2); }
.btn-lien { border: 0; background: none; color: var(--doux); font-size: 16px; padding: 12px; }
.erreur { margin: 10px 0 0; min-height: 1em; color: var(--rouge); font-size: 15px; font-weight: 500; }
.note { margin: 8px 0 0; font-size: 14px; color: var(--doux); line-height: 1.5; }
.lbl { display: block; margin: 16px 0 8px; font-size: 14px; font-weight: 600; color: var(--brun); }
.lbl small, .lbl span { font-weight: 400; color: var(--doux); }

/* Connexion */
.carte-code { width: min(460px, 100%); padding: 34px 30px 26px; border-radius: 26px; background: #fff; box-shadow: var(--ombre); text-align: center; }
.carte-code h1 { font-size: 26px; font-family: 'Poppins', sans-serif; }
.aide { color: var(--doux); font-size: 15px; line-height: 1.5; margin: 8px 0 18px; }
.cases { display: flex; justify-content: center; gap: 7px; margin-bottom: 18px; }
.cases span { width: 42px; height: 54px; border-radius: 12px; border: 1.5px solid var(--ligne); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cases span.plein { border-color: var(--terre); background: var(--creme); }
.clavier { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.clavier button { height: 64px; border: 0; border-radius: 16px; background: var(--creme-2); font-size: 26px; font-weight: 600; color: var(--brun); }
.clavier button:active { background: var(--rose); }
.clavier .ok { background: var(--terre); color: #fff; font-size: 18px; }

/* Accueil */
.accueil { min-height: 100%; display: flex; align-items: center; padding: 60px 7vw;
  background: radial-gradient(1200px 600px at 85% 15%, #F6E1D6 0%, transparent 60%), var(--creme); }
.accueil-texte { max-width: 760px; }
.sur-titre { margin: 0 0 12px; font-size: 14px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--terre); }
.accueil h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: clamp(44px, 6.4vw, 76px); line-height: .98; color: var(--brun); }
.intro { margin: 18px 0 0; font-size: 19px; line-height: 1.6; color: var(--encre); max-width: 600px; }
.etapes { list-style: none; counter-reset: e; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 22px; margin: 30px 0 34px; padding: 0; }
.etapes li { counter-increment: e; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.etapes li::before { content: counter(e); grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1.5px solid var(--ligne);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--terre); }
.etapes b { font-size: 17px; color: var(--brun); }
.etapes span { font-size: 14px; color: var(--doux); }
.accueil .btn-principal { max-width: 420px; }
.vie-privee { margin-top: 16px; font-size: 14px; color: var(--doux); }

/* Photo */
.photo-zone { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 24px; min-height: 100%; padding: 22px 26px 26px; }
.viseur { position: relative; border-radius: 24px; overflow: hidden; background: #1E1612; min-height: 60vh; }
.viseur video, .viseur img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viseur video.miroir { transform: scaleX(-1); }
.silhouette { position: absolute; left: 50%; top: 4%; height: 92%; transform: translateX(-50%); fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 1; stroke-dasharray: 3 2.5; pointer-events: none; }
.decompte { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 180px; font-weight: 700; color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .45); }
.camera-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; padding: 30px; text-align: center; }
.camera-off .btn-secondaire { width: auto; }
.photo-cote h2 { font-size: 26px; }
.conseils { margin: 12px 0 0; padding-left: 20px; line-height: 1.75; font-size: 16px; }
.profil { margin-top: 8px; }
.pas { display: flex; align-items: center; gap: 12px; }
.pas button { width: 56px; height: 52px; border: 1.5px solid var(--ligne); border-radius: 14px; background: #fff; font-size: 26px; color: var(--brun); }
.pas output { min-width: 100px; text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces button { min-width: 54px; height: 48px; padding: 0 14px; border: 1.5px solid var(--ligne); border-radius: 12px; background: #fff; font-size: 16px; font-weight: 600; color: var(--brun); font-variant-numeric: tabular-nums; }
.puces button.on { background: var(--brun); border-color: var(--brun); color: #fff; }
.puces button:disabled { color: #C4B3AA; text-decoration: line-through; background: var(--creme); }
.photo-actions { display: grid; gap: 10px; margin-top: 22px; }
/* PROVISOIRE (tests) : photo depuis le PC — bordure pointillée pour la distinguer */
.btn-test { border-style: dashed; cursor: pointer; font-size: 15px; }
.refus { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #FDECEA; color: #7A1F17; line-height: 1.5; font-size: 15px; }

/* Catalogue */
.cat-tete { position: sticky; top: 0; z-index: 5; display: flex; gap: 14px; align-items: center; padding: 14px 26px; background: var(--creme); border-bottom: 1px solid var(--ligne); }
.filtres { display: flex; gap: 8px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtres button { flex: none; height: 46px; padding: 0 18px; border: 1.5px solid var(--ligne); border-radius: 999px; background: #fff; font-weight: 600; color: var(--brun); }
.filtres button.on { background: var(--brun); border-color: var(--brun); color: #fff; }
.recherche, .champ { height: 50px; padding: 0 16px; border: 1.5px solid var(--ligne); border-radius: 14px; background: #fff; font: inherit; font-size: 16px; color: var(--encre); }
.recherche { width: 280px; }
.champ { width: 100%; }
.mes-essais { padding: 16px 26px 0; }
.mes-essais-t { font-size: 14px; font-weight: 600; color: var(--brun); margin-bottom: 8px; }
.mes-essais-l { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.mes-essais-l button { flex: none; width: 92px; height: 128px; padding: 0; border: 2px solid #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 14px rgba(86, 47, 31, .16); background: #eee; }
.mes-essais-l img { width: 100%; height: 100%; object-fit: cover; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; padding: 18px 26px 40px; }
.carte { position: relative; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: var(--r); background: #fff; text-align: left; overflow: hidden; box-shadow: 0 6px 18px rgba(86, 47, 31, .08); }
.carte:active { transform: scale(.985); }
/* Photos d'articles : le vêtement ENTIER est toujours visible (contain) — en « cover » le pantalon était coupé en haut et en bas */
.carte .im { position: relative; aspect-ratio: 4 / 5; background: #fff; overflow: hidden; }
.carte .im img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.carte .tx { padding: 12px 14px 14px; }
.carte .nom { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--encre); }
.carte .px { margin-top: 4px; font-weight: 700; color: var(--brun); }
.carte .px s { color: #A2938A; font-weight: 400; margin-right: 6px; }
.carte .pastilles { display: flex; gap: 5px; margin-top: 8px; }
.carte .pastilles i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.carte .badge-essai { position: absolute; top: 10px; left: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .94); font-size: 12.5px; font-weight: 600; color: var(--terre); }
.vide { text-align: center; color: var(--doux); padding: 40px; }

/* Voiles (fiche, essai, panier) */
.voile { position: fixed; inset: 0; z-index: 40; background: rgba(58, 44, 38, .45); display: flex; align-items: center; justify-content: center; padding: 22px; }
.voile.sombre { background: rgba(30, 22, 18, .82); }
.fermer { position: absolute; top: 14px; right: 14px; width: 52px; height: 52px; border: 0; border-radius: 50%; background: #fff; font-size: 20px; color: var(--brun); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); z-index: 2; }
.fiche { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(1100px, 100%); max-height: 100%; border-radius: 26px; background: #fff; overflow: hidden; box-shadow: var(--ombre); }
.fiche-media { position: relative; background: #fff; min-height: 420px; border-right: 1px solid var(--creme-2); }
.fiche-media img { position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px); object-fit: contain; }
/* Bouton « Voir le dos » présent : le bas de la photo (jambes, ourlet) reste au-dessus du bouton */
.fiche-media:has(.fiche-dos:not([hidden])) img { height: calc(100% - 82px); }
.fiche-dos { position: absolute; left: 16px; bottom: 16px; height: 46px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .95); font-weight: 600; color: var(--brun); }
.fiche-info { padding: 32px 30px 28px; overflow-y: auto; display: flex; flex-direction: column; }
.fiche-info h2 { font-size: 26px; line-height: 1.2; padding-right: 50px; }
.prix { margin-top: 8px; font-size: 22px; font-weight: 700; color: var(--brun); }
.prix s { font-size: 17px; font-weight: 400; color: #A2938A; margin-right: 8px; }
.prix em { font-style: normal; font-size: 14px; color: var(--rouge); margin-left: 8px; }
.couleurs button { width: 48px; min-width: 48px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--ligne); }
.couleurs button.on { box-shadow: 0 0 0 3px var(--terre); background-clip: padding-box; }
.fiche-info .btn-principal { margin-top: 22px; }
.fiche-info .btn-secondaire { margin-top: 10px; }

.essai { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 0; width: min(1200px, 100%); height: min(92vh, 900px); border-radius: 26px; overflow: hidden; background: #fff; }
.essai-image { position: relative; background: #1E1612; }
.essai-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.essai-attente { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(193, 93, 55, .35), rgba(30, 22, 18, .85)); }
.essai-msg { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 34px; margin: 14px 0 0; }
.essai-sous { margin: 0; opacity: .75; }
.anneau { width: 76px; height: 76px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .25); border-top-color: var(--terre); animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.essai-info { padding: 28px 26px; display: flex; flex-direction: column; overflow-y: auto; }
.essai-art { display: flex; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--ligne); }
.essai-art img { width: 74px; height: 92px; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--creme-2); }
.essai-art b { display: block; font-size: 17px; color: var(--brun); }
.essai-art span { font-size: 15px; color: var(--doux); }
.essai-info .btn-principal { margin-top: 20px; }
.essai-info .btn-secondaire { margin-top: 10px; }
.essai-info .btn-lien { margin-top: 6px; }

.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0, 0, 0, .18); }
.tiroir-tete { position: relative; padding: 24px 26px 14px; border-bottom: 1px solid var(--ligne); }
.tiroir-tete .fermer { top: 14px; right: 16px; box-shadow: none; background: var(--creme-2); }
.lignes { flex: 1; overflow-y: auto; padding: 8px 26px; }
.ligne { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--creme-2); }
.ligne img { width: 70px; height: 88px; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--creme-2); }
.ligne b { display: block; font-size: 15px; color: var(--encre); }
.ligne span { font-size: 14px; color: var(--doux); }
.ligne .qte { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ligne .qte button { width: 40px; height: 40px; border: 1.5px solid var(--ligne); border-radius: 10px; background: #fff; font-size: 20px; color: var(--brun); }
.ligne .qte output { min-width: 26px; text-align: center; font-weight: 600; }
.ligne .px { font-weight: 700; color: var(--brun); text-align: right; }
.ligne .suppr { border: 0; background: none; color: var(--doux); font-size: 14px; text-decoration: underline; padding: 6px 0 0; }
.tiroir-pied { padding: 16px 26px 24px; border-top: 1px solid var(--ligne); background: var(--creme); }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.total b { font-size: 26px; color: var(--brun); font-variant-numeric: tabular-nums; }
.tiroir-pied .btn-principal { margin-top: 14px; }

.merci { text-align: center; max-width: 640px; }
.merci-ico { width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 50%; background: var(--vert); color: #fff; font-size: 52px; display: flex; align-items: center; justify-content: center; }
.merci h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 58px; }
.merci .btn-principal { max-width: 360px; margin: 28px auto 0; }

.carte-mini { width: min(460px, 100%); padding: 30px; border-radius: 22px; background: #fff; text-align: center; box-shadow: var(--ombre); }
.carte-mini p { color: var(--doux); line-height: 1.5; }
.attente { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(251, 246, 242, .9); font-size: 20px; color: var(--brun); }
.attente .anneau { border-color: var(--rose); border-top-color: var(--terre); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; padding: 14px 22px; border-radius: 14px; background: var(--encre); color: #fff; font-size: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

@media (max-width: 900px), (orientation: portrait) {
  .photo-zone { grid-template-columns: 1fr; }
  .viseur { min-height: 52vh; }
  .fiche { grid-template-columns: 1fr; overflow-y: auto; }
  .fiche-media { min-height: 52vh; }
  .essai { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; height: 94vh; }
  .etapes { grid-template-columns: 1fr; }
  .recherche { width: 200px; }
}
@media (prefers-reduced-motion: reduce) { .anneau { animation-duration: 3s; } .btn-panier.bouge { animation: none; } }
