/* fx-commande.css — passe « forward design » du 24/11. Périmètre : « Ma commande », dialogue du nom, avis d'ajout.
   Feuille de l'expert « commande » : chargée après toutes les feuilles de base (style.css, cart.css, type.css…), qui restent
   gelées ; tout ce qui change dans ce périmètre s'écrit ici. Le balisage de la feuille vient de cart.js, la pastille qui
   glisse de case-feedback.js ; l'avis et le dialogue du nom gardent le balisage d'index.html et d'app.js.

   Le parti : tout ce qui flotte est une feuille de verre (cadrage § 4) — le papier à 70 %, flou de 20 px, saturation 1,6,
   un filet clair. Quand « Ma commande » ou le dialogue du nom s'ouvre, la page entière se floute derrière (voile 18 %,
   flou de 14 px). Boutons, puces, champs, liens et anneau de focus : la recette du chantier système (--sys-*), avec une
   valeur de repli si sa feuille manque. À plat : des filets, pas de relief. Mouvement : jetons --mm-* de transitions.css,
   seuls transform et opacity bougent ; mouvement réduit : les états finaux, immobiles.
   1. jetons · 2. verre et page floutée · 3. la feuille · 4. son en-tête · 5. les lignes · 6. coordonnées · 7. pied
   8. commande vide · 9. avis d'ajout · 10. pastille qui glisse · 11. dialogue du nom · 12. téléphone · 13. au doigt */

/* ── 1. Jetons du chantier ──────────────────────────────────────────────── */
dialog.cart-dialog, #profile-dialog, .notice, .case-flight {
  --mc-ink: #181714;                    /* sur le verre, le fond varie : l'encre forte de la maison (celle du logo) */
  --mc-ink-2: rgb(24 23 20 / 88%);      /* texte secondaire : 4,5:1 au moins, même quand le verre passe sur une image sombre */
  --mc-line: rgb(24 23 20 / 11%);       /* filets entre les lignes */
  --mc-tint: rgb(24 23 20 / 7%);        /* survol d'une commande ronde */
  --mc-r: var(--sys-arrondi, clamp(12px, 1.2vw, 18px));   /* arrondi commun des cartes et des panneaux */
  --mc-filet: inset 0 0 0 1px rgb(255 255 255 / 46%), 0 0 0 1px rgb(24 19 15 / 8%);   /* le bord du verre : un filet clair, un filet d'encre */
  --mc-plein: var(--sys-encre, var(--ink));   /* le bouton plein : celui du système, le même sur tout le site (#4e4945) */
}

/* ── 2. Le verre, et la page floutée derrière ───────────────────────────── */
/* sans backdrop-filter : un aplat papier et un voile plus dense, toujours lisibles */
dialog.cart-dialog, #profile-dialog, .notice { background: var(--paper); color: var(--mc-ink); }
dialog.cart-dialog::backdrop, #profile-dialog::backdrop { background: rgb(24 19 15 / 42%); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  /* tour 2 : une feuille qui porte du texte est aussi dense que celle des menus (86 %) ; l'avis, posé sur le texte de la page, 92 % */
  dialog.cart-dialog, #profile-dialog, .notice {
    background: rgb(249 247 245 / 86%);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
  }
  .notice { background: rgb(249 247 245 / 92%); }
  /* le même voile que derrière les menus (fx-entete.css) */
  dialog.cart-dialog::backdrop, #profile-dialog::backdrop {
    background: rgb(24 19 15 / 18%);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    backdrop-filter: blur(14px) saturate(1.1);
  }
}

/* Derrière la feuille, la page ne bouge pas. cart.css fige la page (html.cart-active) et style.css fige aussi body : body
   devenait alors la zone de défilement de l'en-tête collant, qui quittait l'écran à l'ouverture. On rend body à la page :
   l'en-tête reste à sa place, flouté comme le reste. Barre de défilement classique (Windows) : sa place est rendue à la
   page le temps de l'ouverture (--mc-barre, mesurée par cart.js) — le voile et le flou vont jusqu'au bord, rien ne se décale. */
html.cart-active { scrollbar-gutter: auto; }
html.cart-active body { overflow: visible; padding-right: var(--mc-barre, 0px); }
/* La porte de « Ma commande » : le bouton de l'en-tête. style.css réserve le haut de l'écran aux ancres (scroll-padding-top,
   la hauteur de l'en-tête) ; or ce bouton vit dans cette bande : dès qu'il prenait le focus au clavier, le navigateur
   faisait remonter la page d'un demi-écran pour l'en sortir — on perdait sa place dans la cave avant même d'ouvrir la
   feuille. Sa marge de défilement annule la bande : il est déjà à l'écran, rien ne bouge. (À étendre à tout l'en-tête :
   demande au chantier entete, voir le rapport.) */
#cart-trigger { scroll-margin-top: calc(-1 * var(--nav-height)); }

/* ── 3. « Ma commande » : une feuille de verre qui flotte à droite ──────── */
dialog.cart-dialog {
  --cart-x: 24px;                       /* marge intérieure (cart.css s'en sert pour ses blocs) */
  --mc-gap: 12px;                       /* la feuille flotte à 12 px des bords */
  inset: var(--mc-gap) var(--mc-gap) var(--mc-gap) auto;
  width: min(27.5rem, calc(100% - 2 * var(--mc-gap)));
  height: auto;
  margin: 0;
  border: 0;
  border-radius: var(--mc-r);
  box-shadow: var(--mc-filet);
  font: 400 var(--fs-0)/var(--lh-texte) var(--sans);
}
.cart-dialog :focus-visible { outline: 2px solid var(--mc-ink); outline-offset: 3px; }
.cart-dialog .cart-button:focus-visible { outline-color: var(--mc-ink); }

/* elle glisse depuis la droite (420 ms, courbe signature) et repart en 150 ms ; durées et courbes : transitions.css */
@media (prefers-reduced-motion: no-preference) {
  dialog.cart-dialog { translate: calc(100% + var(--mc-gap) + 8px) 0; }
  dialog.cart-dialog[open] { translate: 0 0; }
  @starting-style { dialog.cart-dialog[open] { translate: calc(100% + var(--mc-gap) + 8px) 0; } }

  /* à l'ouverture seulement (cart.js pose data-ouvre), le contenu se pose en cascade : 14 px, 50 ms d'écart, 6 pas au plus */
  .cart-dialog[data-ouvre] :is(.cart-top > *, .cart-item, .cart-details, .cart-foot > *, .cart-empty > *) {
    animation: mc-entre var(--mm-t-panel) var(--mm-ease) backwards;
    animation-delay: calc(60ms + var(--i, 0) * var(--mm-stagger));
  }
  .cart-dialog[data-ouvre] .cart-details { --i: 5; }
  .cart-dialog[data-ouvre] .cart-foot > * { --i: 3; }
  .cart-dialog[data-ouvre] .cart-foot > :nth-child(n+3) { --i: 4; }
  .cart-dialog[data-ouvre] .cart-foot > :nth-child(n+5) { --i: 5; }
  .cart-dialog[data-ouvre] .cart-empty > :nth-child(2) { --i: 2; }
}
@keyframes mc-entre { from { opacity: 0; translate: var(--mm-d-s) 0; } }

/* ── 4. En-tête de la feuille : le titre et la croix ────────────────────── */
.cart-dialog .cart-top {
  min-height: 56px;                     /* la hauteur de l'en-tête du site */
  padding: 0 calc(var(--cart-x) - 9px) 0 var(--cart-x);
  border-bottom: 0;
}
.cart-dialog .cart-title { font-size: var(--fs-1); color: var(--mc-ink); }
.cart-dialog .cart-close {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--mc-ink);
  font-size: 0;
}
.cart-dialog .cart-close .icon { width: 18px; height: 18px; }
.cart-dialog .cart-close:hover { background: transparent; }
.cart-dialog .cart-close:focus-visible { outline-offset: 0; }

/* ── 5. Les lignes : photo arrondie · nom, format · montant HT / pilule (− 1 +) · retirer ── */
.cart-dialog .cart-scroll {
  padding: 0 var(--cart-x) 8px;
  scrollbar-width: thin;
  scrollbar-color: rgb(24 23 20 / 26%) transparent;
  /* les lignes se fondent dans le verre en passant sous le titre */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12px);
  mask-image: linear-gradient(to bottom, transparent, #000 12px);
}
.cart-dialog .cart-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "photo main amount"
    "photo main remove"
    "photo quantity quantity";
  column-gap: 14px;
  row-gap: 0;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--mc-line);
}
.cart-dialog .cart-item:first-child { padding-top: 12px; }
.cart-dialog .cart-image {
  grid-area: photo;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bottle-backdrop);
}
.cart-dialog .cart-image img { object-fit: cover; }
/* référence sans photographie : le pictogramme de la bouteille, discret */
.cart-dialog .cart-image.is-empty { display: grid; place-items: center; color: var(--mc-ink-2); }
.cart-dialog .cart-image.is-empty .icon { width: 24px; height: 24px; stroke-width: 1; }
.cart-dialog .cart-item-main { grid-area: main; align-self: baseline; min-width: 0; }
.cart-dialog .cart-item-name { color: var(--mc-ink); overflow-wrap: anywhere; text-wrap: balance; }
.cart-dialog .cart-item-name a {
  display: inline;                      /* en ligne : le montant s'aligne sur la première ligne du nom, même s'il en fait deux */
  padding: 0;
  margin: 0;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
}
.cart-dialog .cart-item-name a:hover { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; }
.cart-dialog .cart-item-meta { margin-top: 2px; overflow-wrap: anywhere; text-wrap: balance; }
.cart-dialog :is(.cart-item-meta, .cart-unit, .cart-count-label, .cart-foot-note, .cart-status) { color: var(--mc-ink-2); }
.cart-dialog .cart-line-amount {
  grid-area: amount;
  align-self: baseline;
  justify-self: end;
  color: var(--mc-ink);
  white-space: nowrap;
}
.cart-dialog .cart-line-amount small { font: 400 var(--fs-n2)/1 var(--sans); color: var(--mc-ink-2); }
/* « Retirer », sous le montant : un lien du système (trait fin à 40 % de l'encre, plein au survol) */
.cart-dialog .cart-remove {
  grid-area: remove;
  justify-self: end;
  position: relative;
  min-height: 0;
  margin-top: 3px;
  padding: 0;
  color: var(--mc-ink-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
.cart-dialog .cart-remove:focus-visible { color: var(--mc-ink); text-decoration-color: currentColor; }

/* la quantité : une pilule (− 1 +), puis l'unité du compteur et le prix à la bouteille */
.cart-dialog .cart-quantity {
  grid-area: quantity;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;
}
.cart-dialog .cart-stepper {
  flex: none;
  grid-template-columns: 30px minmax(28px, auto) 30px;   /* le champ s'élargit pour une quantité à trois ou quatre chiffres */
  height: 32px;                         /* la hauteur d'une puce */
  border: 1px solid var(--sys-bord-champ, color-mix(in srgb, currentColor 64%, transparent));
  border-radius: 999px;
}
.cart-dialog .cart-step {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--mc-ink);
  font-size: var(--fs-0);
}
.cart-dialog .cart-step:hover:not(:disabled) { background: transparent; }
.cart-dialog .cart-step:disabled { color: rgb(24 23 20 / 30%); opacity: 1; }
.cart-dialog .cart-qty-input {
  width: 28px;
  min-width: 28px;
  max-width: 3.5rem;
  height: 30px;
  border-radius: 6px;
  color: var(--mc-ink);
  font: 500 var(--fs-n1)/1 var(--sans);
  font-variant-numeric: tabular-nums lining-nums;
}
/* là où le navigateur le permet, le champ prend la largeur de son nombre (120, 1 200…) */
@supports (field-sizing: content) {
  .cart-dialog .cart-qty-input { field-sizing: content; width: auto; padding-inline: 3px; }
}
.cart-dialog :is(.cart-step, .cart-qty-input):focus-visible { outline-offset: -2px; }   /* l'anneau reste dans la pilule */
.cart-dialog .cart-quantity-info {
  display: grid;
  min-width: 0;
  font: 400 var(--fs-n1)/var(--lh-petit) var(--sans);
  font-variant-numeric: tabular-nums lining-nums;
}
.cart-dialog .cart-case { color: var(--mc-ink); }

/* ── 6. Coordonnées du bon (facultatives), repliées sous les lignes ─────── */
/* les champs eux-mêmes (pilule pour une ligne, arrondi des cartes pour plusieurs) : chantier système */
.cart-dialog .cart-details { margin-top: 0; border: 0; }
.cart-dialog .cart-details-summary { min-height: 48px; padding: 0; color: var(--mc-ink); }
.cart-dialog .cart-details-summary::after { font: 400 var(--fs-0)/1 var(--sans); }
.cart-dialog .cart-details-summary small { color: var(--mc-ink-2); }
.cart-dialog .cart-fields { gap: 14px 10px; padding: 6px 0 16px; }
.cart-dialog .cart-buyer { color: var(--mc-ink); }
.cart-dialog .cart-buyer textarea { resize: none; }

/* ── 7. Pied : le total HT, le bon de commande (pilule pleine), l'e-mail (pilule au contour) ── */
.cart-dialog .cart-foot {
  gap: 0;
  padding: 14px var(--cart-x) max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--mc-line);
  background: transparent;
  color: var(--mc-ink);
}
.cart-dialog .cart-total { align-items: baseline; gap: 12px; color: var(--mc-ink); }
.cart-dialog .cart-total > span { font: 400 var(--fs-0)/var(--lh-ligne) var(--sans); }
.cart-dialog .cart-total strong { color: var(--mc-ink); white-space: nowrap; }
.cart-dialog .cart-count-label { margin-top: 1px; }
/* la pilule du système : 40 px à la souris, 44 au doigt, 14 px en casse normale ; au survol elle s'inverse */
.cart-dialog .cart-button {
  position: relative;
  gap: .4em;
  min-height: var(--sys-h-bouton, 44px);
  margin-top: 14px;
  padding: 0 var(--sys-px-bouton, 22px);
  border: 1px solid var(--mc-plein);
  border-radius: 999px;
  background: var(--mc-plein);
  color: var(--paper);
  font: 400 var(--sys-fs-bouton, .875rem)/1.2 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.cart-dialog .cart-button + .cart-button { margin-top: 8px; }
.cart-dialog .cart-button::after { content: none; }              /* un seul effet au survol : plus de trait sous le libellé */
.cart-dialog .cart-button:hover:not(:disabled) { filter: none; }
.cart-dialog .cart-button:disabled { opacity: .55; }
.cart-dialog .cart-button-kind { opacity: .7; }
.cart-dialog .cart-button-outline { border-color: var(--mc-ink); background: transparent; color: var(--mc-ink); }
.cart-dialog .cart-button-outline:hover { background: transparent; }
.cart-dialog .cart-foot-note, .cart-dialog .cart-status { margin-top: 10px; text-align: center; text-wrap: balance; }
.cart-dialog .cart-foot-note a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .24em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
/* survols : à la souris seulement (au doigt, un survol resterait collé après le toucher) */
@media (hover: hover) and (pointer: fine) {
  .cart-dialog .cart-close:hover, .cart-dialog .cart-step:hover:not(:disabled) { background: var(--mc-tint); }
  .cart-dialog .cart-item-name a:hover { text-decoration-color: currentColor; }
  .cart-dialog .cart-remove:hover { color: var(--mc-ink); text-decoration-color: currentColor; }
  .cart-dialog .cart-foot-note a:hover { color: var(--mc-ink); text-decoration-color: currentColor; }
  .cart-dialog .cart-button:not(.cart-button-outline):hover:not(:disabled) { background: transparent; border-color: var(--mc-ink); color: var(--mc-ink); }
  .cart-dialog .cart-button-outline:hover { background: var(--mc-plein); border-color: var(--mc-plein); color: var(--paper); }
}

/* ── 8. Commande vide : une phrase, un bouton ───────────────────────────── */
.cart-dialog .cart-empty {
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 24px var(--cart-x) 14vh;
  color: var(--mc-ink);
}
.cart-dialog .cart-empty > .cart-button { width: auto; min-width: 0; margin-top: 0; }
.cart-dialog .cart-empty-suggest:empty { display: none; }
/* les trois vins (éteints : SUGGEST_EMPTY dans cart.js) — prêts dans le langage de la feuille */
.cart-dialog .cart-empty-suggest { align-self: stretch; }
.cart-dialog .cart-suggest li { border: 0; border-top: 1px solid var(--mc-line); padding: 12px 0; }
.cart-dialog .cart-suggest-photo { border-radius: 12px; overflow: hidden; }
.cart-dialog .cart-suggest-add { min-height: var(--sys-h-puce, 32px); border: 1px solid var(--mc-ink); border-radius: 999px; font: 500 var(--sys-fs-puce, var(--fs-n1))/1 var(--sans); letter-spacing: 0; text-transform: none; }

/* ── 9. Avis d'ajout : une pastille de verre qui glisse de l'en-tête ────── */
.notice {
  --mm-avis-sens: -1;                   /* elle vient d'en haut (motion.js lit ce sens) */
  top: calc(var(--avis-haut, var(--nav-height)) + 10px);   /* --avis-haut : le bas de l'en-tête, mesuré par case-feedback.js */
  max-width: min(46rem, calc(100vw - 2 * var(--gutter)));   /* une ligne, même pour le plus long nom de vin de la cave */
  gap: 14px;
  padding: 5px 6px 5px 18px;
  border-radius: 26px;                  /* une vraie pilule jusqu'à 52 px de haut */
  box-shadow: var(--mc-filet), 0 14px 30px -18px rgb(24 19 15 / 34%);
  transform-origin: 100% 0;
}
.notice:has(#notice-cart[hidden]) { padding: 9px 18px; }
.notice-copy { gap: 0; padding-block: 4px; min-width: 0; }
.notice-copy strong { font-weight: 500; }
#notice-text { text-wrap: pretty; }
#notice-total { color: var(--mc-ink-2); font-variant-numeric: tabular-nums lining-nums; }
/* « Voir ma commande » : une puce pleine (32 px, 12–12,5 px) */
.notice button {
  position: relative;
  flex: none;
  min-height: 0;
  height: var(--sys-h-puce, 32px);
  padding: 0 var(--sys-px-puce, 14px);
  border: 1px solid var(--mc-plein);
  border-radius: 999px;
  background: var(--mc-plein);
  color: var(--paper);
  font: 500 var(--sys-fs-puce, var(--fs-n1))/1 var(--sans);
  text-decoration: none;
}
.notice :focus-visible { outline: 2px solid var(--mc-ink); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .notice button:hover { background: transparent; border-color: var(--mc-ink); color: var(--mc-ink); }
}
@media (prefers-reduced-motion: no-preference) {
  .notice button { transition: background-color var(--mm-t-hover) var(--mm-ease), color var(--mm-t-hover) var(--mm-ease), scale var(--mm-t-press) var(--mm-ease); }
  .notice button:active { scale: .97; }
  /* elle glisse : 14 px et une légère mise au point d'échelle, par-dessus le fondu de motion.js ; départ en 150 ms */
  .notice { animation: mc-avis-arrive var(--mm-t-panel) var(--mm-ease) backwards; }
  .notice.is-leaving { animation: mc-avis-part var(--mm-t-leave) var(--mm-ease-out) forwards; pointer-events: none; }
}
@keyframes mc-avis-arrive { from { opacity: 0; transform: translateY(calc(var(--mm-avis-sens, -1) * var(--mm-d-s))) scale(.96); } }
@keyframes mc-avis-part { to { opacity: 0; transform: translateY(calc(var(--mm-avis-sens, -1) * var(--mm-d-xs))) scale(.98); } }

/* ── 10. Le retour du bouton d'ajout : une pastille de verre glisse jusqu'au compteur (case-feedback.js) ── */
.case-flight { z-index: 11; width: 40px; height: 40px; }   /* au-dessus de l'en-tête, sous l'avis : elle passe derrière son verre */
.case-chip {
  display: block;
  width: 100%;
  height: 100%;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--mc-filet);
  transform-origin: center;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .case-chip {
    background: rgb(249 247 245 / 70%);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    backdrop-filter: blur(20px) saturate(1.6);
  }
}
.case-chip > img { display: block; width: 100%; height: 100%; border-radius: 999px; object-fit: cover; object-position: 50% 62%; }

/* ── 11. Dialogue du nom : la même feuille de verre, au centre ──────────── */
/* son champ et son bouton « Enregistrer » : la recette du chantier système (pilules), avec l'encre de cette surface */
#profile-dialog {
  width: min(23.5rem, calc(100% - 24px));
  padding: 20px 24px 24px;
  border-radius: var(--mc-r);
  box-shadow: var(--mc-filet);
}
#profile-dialog :focus-visible { outline: 2px solid var(--mc-ink); outline-offset: 3px; }
#profile-dialog h2 { padding-right: 36px; font-size: var(--fs-1); color: var(--mc-ink); }
#profile-dialog p { margin: 6px 0 0; color: var(--mc-ink-2); text-wrap: pretty; }
#profile-dialog label { gap: 6px; margin: 18px 0 0; color: var(--mc-ink); }
#profile-dialog .button { width: 100%; margin-top: 12px; }
#profile-dialog .button.dark:hover { color: var(--mc-ink); border-color: var(--mc-ink); }
@media (hover: none), (pointer: coarse) { #profile-dialog .button.dark:hover { color: var(--paper); border-color: var(--mc-plein); } }
#profile-dialog .close-profile {
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  color: var(--mc-ink);
}
#profile-dialog .close-profile .icon { width: 18px; height: 18px; }
#profile-dialog .close-profile:focus-visible { outline-offset: 0; }
@media (hover: hover) and (pointer: fine) {
  #profile-dialog .close-profile:hover { background: var(--mc-tint); }
}
@media (prefers-reduced-motion: no-preference) {
  #profile-dialog .close-profile, .cart-dialog .cart-remove, .cart-dialog .cart-item-name a, .cart-dialog .cart-foot-note a {
    transition: background-color var(--mm-t-hover) var(--mm-ease), color var(--mm-t-hover) var(--mm-ease),
      text-decoration-color var(--mm-t-hover) var(--mm-ease);
  }
}

/* ── 12. Tablette et téléphone ──────────────────────────────────────────── */
/* avis : sous l'en-tête comme à l'ordinateur ; sur la fiche, au-dessus de l'île d'achat (style.css, fx-fiche.css) */
@media (max-width: 1023px) {
  .notice { --mm-avis-sens: -1; top: calc(var(--avis-haut, var(--nav-height)) + 8px); left: auto; right: var(--gutter); width: max-content; max-width: calc(100vw - 2 * var(--gutter)); }
  body[data-view="product"] .notice { --mm-avis-sens: 1; transform-origin: 50% 100%; }
}
@media (max-width: 767px) {
  /* la feuille garde 8 px d'air : on voit la page floutée tout autour */
  dialog.cart-dialog {
    --cart-x: 16px;
    --mc-gap: 8px;
    inset: var(--mc-gap);
    bottom: max(var(--mc-gap), env(safe-area-inset-bottom));
    width: auto;
    border-radius: 18px;
  }
  .cart-dialog .cart-top { min-height: 56px; padding-right: calc(var(--cart-x) - 4px); }
  /* la même ligne qu'à l'ordinateur (cart.css rangeait ses blocs autrement) */
  .cart-dialog .cart-item {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr auto;
    column-gap: 12px;
    row-gap: 0;
    padding: 14px 0;
  }
  .cart-dialog .cart-image { grid-column: auto; grid-row: auto; grid-area: photo; }
  .cart-dialog .cart-item-meta { grid-column: auto; grid-row: auto; }
  .cart-dialog .cart-unit { grid-column: auto; grid-row: auto; }
  .cart-dialog .cart-foot { gap: 0; padding-top: 12px; }
  .cart-dialog .cart-button { min-height: var(--sys-h-bouton, 44px); }
  .cart-dialog .cart-empty { padding-top: 24px; gap: 20px; }
  /* coordonnées ouvertes (cart.css : toute la feuille défile) : le titre reste en haut, en verre */
  .cart-dialog .cart-shell:has(.cart-details[open]) .cart-top {
    background: rgb(249 247 245 / 82%);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }
  .cart-dialog .cart-shell:has(.cart-details[open]) .cart-scroll { -webkit-mask-image: none; mask-image: none; }
  #profile-dialog { border-radius: 18px; }
  /* l'avis : une pastille sur toute la largeur ; « Voir ma commande » devient un rond fléché (le libellé reste lu) */
  .notice { left: 12px; right: 12px; width: auto; max-width: none; gap: 10px; padding: 6px 6px 6px 18px; justify-content: space-between; }
  .notice button { width: 36px; height: 36px; padding: 0; font-size: 0; }
  .notice button::after { content: "→"; font: 400 var(--fs-0)/1 var(--sans); }
  /* un avis sans bouton (« Nom enregistré. ») : une petite pastille à droite, pas une barre */
  .notice:has(#notice-cart[hidden]) { left: auto; width: max-content; max-width: calc(100vw - 24px); }
}

/* ── 13. Au doigt : des cibles de 44 px (les champs à 16 px : chantier système) ── */
@media (max-width: 1023px), (pointer: coarse) {
  .cart-dialog .cart-close, #profile-dialog .close-profile { width: 44px; height: 44px; }
  .cart-dialog .cart-top { padding-right: calc(var(--cart-x) - 13px); }
  #profile-dialog .close-profile { top: 6px; right: 6px; }
  .cart-dialog .cart-stepper { grid-template-columns: 44px minmax(44px, auto) 44px; height: 46px; }   /* tour 2 : −, champ et + font 44 px chacun */
  .cart-dialog .cart-step { width: 44px; height: 44px; }
  .cart-dialog .cart-step::before { content: ""; position: absolute; inset: -4px -2px; }       /* 44 × 44 au doigt */
  .cart-dialog .cart-qty-input { width: 44px; min-width: 44px; max-width: 4.5rem; height: 44px; font-size: 1rem; }
  @supports (field-sizing: content) { .cart-dialog .cart-qty-input { width: auto; } }
  .cart-dialog .cart-remove::before { content: ""; position: absolute; inset: -14px -10px; }             /* 44 px de haut au moins */
  /* le nom (lien vers la fiche) : une bande de 44 px, calée sur le titre même quand il fait deux lignes */
  .cart-dialog .cart-item-name { position: relative; }
  .cart-dialog .cart-item-name a::before { content: ""; position: absolute; inset: -13px 0; }
  .cart-dialog .cart-foot-note a { position: relative; }
  .cart-dialog .cart-foot-note a::before { content: ""; position: absolute; inset: -14px 0; }
  .notice button::before { content: ""; position: absolute; inset: -6px; }
}

/* ── 14. Écran bas (téléphone couché) : la feuille défile d'un bloc (cart.css) ── */
@media (max-height: 34rem) {
  .cart-dialog .cart-scroll { -webkit-mask-image: none; mask-image: none; }
  .cart-dialog .cart-empty { padding-bottom: 24px; }
}
