/*
 * GOOD SMOOTHIE — composants d'interface (boutique et administration).
 * Mobile d'abord ; chaque cible tactile mesure au moins 44 px.
 */

/* ================= En-tête ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease);
}
.site-header[data-scrolled] { border-bottom-color: var(--line); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: var(--header-h);
}
/* Logo secondaire GOOD : la version prévue par la charte pour les espaces compacts */
.site-header__logo img { height: 30px; width: auto; }
@media (min-width: 960px) { .site-header__logo img { height: 34px; } }
.site-nav { display: none; gap: var(--sp-6); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.site-nav a { text-decoration: none; padding-block: var(--sp-2); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--green); box-shadow: inset 0 -2px 0 var(--orange); }
@media (min-width: 960px) { .site-nav { display: flex; } }

/* ================= Boutons ================= */
.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--btn-h);
  padding: 0 1.4rem;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  font-size: 0.9375rem;
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--green); color: var(--white); }
.btn--primary:hover { background: var(--green-deep); }
.btn--secondary { border-color: var(--green); color: var(--green); background: transparent; }
.btn--secondary:hover { background: var(--green-soft); }
.btn--ghost { color: var(--green); background: transparent; }
.btn--ghost:hover { background: var(--green-soft); }
.btn--light { background: var(--white); color: var(--green); }
.btn--light:hover { background: var(--green-soft); }
.btn--danger { border-color: var(--error); color: var(--error); background: transparent; }
.btn--danger:hover { background: var(--error-soft); }
.btn--lg { --btn-h: 56px; padding: 0 1.75rem; font-size: 1.0625rem; }
.btn--sm { --btn-h: 40px; padding: 0 1rem; font-size: var(--fs-small); }
.btn--block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
/* Envoi en cours : le bouton reste lisible et ne peut pas être cliqué deux fois */
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] .btn__icon { display: none; }
.btn .spinner { display: none; }
.btn[aria-busy="true"] .spinner { display: block; }
.spinner {
  width: 1.1em; height: 1.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  color: var(--green);
  transition: background-color var(--dur-1) var(--ease);
}
.icon-btn:hover { background: var(--green-soft); }
.icon-btn--filled { background: var(--green); color: var(--white); }
.icon-btn--filled:hover { background: var(--green-deep); }
.count-badge {
  position: absolute;
  top: 2px; right: 0;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--orange);
  color: var(--white);
  font-size: 11px;
  font-weight: var(--fw-bold);
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--cream);
}

/* ================= Pastilles de format (visuel « Nos 3 formats ») ================= */
.format-tag { display: inline-grid; justify-items: center; gap: 6px; }
.format-tag__name, .format-tag__price {
  border-radius: var(--r-pill);
  color: var(--white);
  font-weight: var(--fw-extrabold);
  line-height: 1;
}
.format-tag__name { padding: 0.5em 1.4em; background: var(--green); font-style: italic; font-size: 1.125rem; }
/* Blanc sur orange : 3,15:1, d'où une taille ≥ 24 px en gras */
.format-tag__price {
  padding: 0.4em 1em;
  background: var(--orange);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.format-tag__price small { font-size: 0.55em; margin-left: 0.25em; vertical-align: 0.4em; }

/* ================= Choix du format (boutons radio) ================= */
.choice-group { border: 0; padding: 0; min-width: 0; }
.choice-group legend { font-weight: var(--fw-semibold); margin-bottom: var(--sp-3); padding: 0; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.segmented__option { position: relative; }
.segmented__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented__option label {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: var(--sp-3) var(--sp-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease);
}
.segmented__name { font-weight: var(--fw-bold); color: var(--green); }
.segmented__price { font-size: var(--fs-small); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.segmented__option input:checked + label { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.segmented__option input:checked + label .segmented__price { color: var(--green); font-weight: var(--fw-semibold); }
.segmented__option input:focus-visible + label { outline: 3px solid var(--green); outline-offset: 3px; }
.segmented__option input:disabled + label { opacity: 0.45; cursor: not-allowed; }

/* ================= Fruits (cases à cocher en pastilles) ================= */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--white);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.chip label .icon { display: none; width: 1rem; height: 1rem; }
.chip input:checked + label { background: var(--green); border-color: var(--green); color: var(--white); }
.chip input:checked + label .icon { display: block; }
.chip input:focus-visible + label { outline: 3px solid var(--green); outline-offset: 3px; }
.chip input:disabled + label { opacity: 0.5; cursor: not-allowed; }
.chip input:disabled + label .chip__state { font-size: var(--fs-xs); color: var(--ink-muted); }

/* ================= Quantité ================= */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--white);
}
.stepper button {
  display: grid; place-items: center;
  width: var(--tap); height: var(--tap);
  border-radius: 50%;
  color: var(--green);
}
.stepper button:hover { background: var(--green-soft); }
.stepper button:disabled { color: var(--ink-faint); background: none; cursor: not-allowed; }
.stepper output { min-width: 2ch; text-align: center; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }

/* ================= Carte produit ================= */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.product-card:hover { box-shadow: var(--sh-2); }
.product-card__media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  margin: var(--sp-2) var(--sp-2) 0;
  border-radius: calc(var(--r-lg) - 6px);
  background: var(--tint, var(--cream));
  overflow: hidden;
}
/* Le gobelet est toujours montré entier (charte §05 : structure conservée) */
.product-card__media img {
  position: absolute;
  inset: 7% 0 5%;
  width: 100%;
  height: 88%;
  object-fit: contain;
  transition: transform var(--dur-3) var(--ease);
}
.product-card:hover .product-card__media img { transform: translateY(-4%) rotate(-2deg); }
.product-card__body { flex: 1; display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) var(--sp-4) var(--sp-5); }
.product-card__title { font-size: 1.1875rem; font-weight: var(--fw-bold); color: var(--green); line-height: 1.25; }
.product-card__title a { text-decoration: none; }
.product-card__title a::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.product-card__fruits { font-size: var(--fs-small); color: var(--ink-muted); }
/* Le pied de carte reste aligné en bas, même si le nom tient sur deux lignes */
.product-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--sp-3); }
.product-card__footer .icon-btn { position: relative; z-index: 1; }
.product-card__badge {
  position: absolute;
  top: var(--sp-3); left: var(--sp-3);
  z-index: 1;
  padding: 0.35rem 0.75rem;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--green);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  box-shadow: var(--sh-1);
}
.product-card[data-unavailable] .product-card__media img { filter: grayscale(0.85); opacity: 0.55; }
.product-card[data-unavailable] .product-card__badge { color: var(--ink-muted); }

/* ================= Champs de formulaire ================= */
.field { display: grid; gap: var(--sp-2); }
.field__label { font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.field__label .optional { font-weight: var(--fw-regular); color: var(--ink-muted); }
.field__hint { font-size: 0.8125rem; color: var(--ink-muted); }
.field__error {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 0.8125rem; font-weight: var(--fw-medium);
  color: var(--error);
}
.field__error .icon { width: 1rem; height: 1rem; margin-top: 2px; }
.field__error:empty { display: none; }
.input, .select, .textarea {
  width: 100%;
  min-height: 52px;
  padding: 0 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--white);
  font-size: var(--fs-body);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.textarea { padding: 0.875rem 1rem; min-height: 104px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
/* Les champs ont leur propre anneau de focus (bordure + halo), sans le contour global */
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 16%, transparent);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--error) 12%, transparent);
}
/* Téléphone : indicatif fixe */
.input-group { display: flex; align-items: stretch; }
.input-group__prefix {
  display: grid; place-items: center;
  padding: 0 0.875rem;
  border: 1.5px solid var(--line-strong);
  border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--cream);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.input-group .input { border-radius: 0 var(--r-md) var(--r-md) 0; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
/* Liste déroulante : flèche dessinée par un SVG voisin (aucune image en data:) */
.select-wrap { position: relative; }
.select { appearance: none; padding-right: 2.75rem; cursor: pointer; }
.select-wrap .icon { position: absolute; right: 1rem; top: 50%; translate: 0 -50%; color: var(--green); pointer-events: none; }
.field__counter { justify-self: end; font-size: var(--fs-xs); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-small); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green); flex: none; cursor: pointer; }

/* ================= Récapitulatif de commande ================= */
.summary {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--sh-1);
}
.summary__lines { display: grid; gap: var(--sp-4); padding-bottom: var(--sp-4); border-bottom: 1px dashed var(--line); }
/* Vignette | nom + total sur une ligne, détails dessous sur toute la largeur */
.cart-line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  grid-template-areas: "thumb name total" "thumb meta meta";
  column-gap: var(--sp-3);
  row-gap: 2px;
  align-items: center;
}
.cart-line__thumb { grid-area: thumb; }
.cart-line__name { grid-area: name; align-self: end; }
.cart-line__total { grid-area: total; align-self: end; }
.cart-line__meta { grid-area: meta; align-self: start; }
.cart-line__thumb { width: 56px; aspect-ratio: 1; border-radius: var(--r-sm); background: var(--tint, var(--cream)); display: grid; place-items: center; overflow: hidden; }
.cart-line__thumb { position: relative; }
.cart-line__thumb img { position: absolute; inset: 8% 0; width: 100%; height: 84%; object-fit: contain; }
.cart-line__name { font-weight: var(--fw-semibold); line-height: 1.3; }
.cart-line__meta { font-size: var(--fs-small); color: var(--ink-muted); }
.summary__rows { display: grid; gap: var(--sp-2); padding-block: var(--sp-4); font-size: var(--fs-small); }
.summary__row { display: flex; justify-content: space-between; gap: var(--sp-4); }
.summary__total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line-soft);
  font-weight: var(--fw-bold);
}
.summary__total .price { font-size: 1.5rem; color: var(--green); font-weight: var(--fw-extrabold); }
.summary__note { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-4); font-size: var(--fs-small); color: var(--ink-muted); }

/* ================= Barre panier (mobile) ================= */
.cart-bar {
  position: fixed;
  left: var(--sp-3); right: var(--sp-3);
  bottom: calc(var(--sp-3) + env(safe-area-inset-bottom));
  z-index: var(--z-cartbar);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  min-height: 60px;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--green);
  color: var(--white);
  box-shadow: 0 16px 36px -14px rgb(0 40 0 / 0.55);
  text-decoration: none;
}
.cart-bar__count { font-size: var(--fs-small); opacity: 0.85; }
.cart-bar__total { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.cart-bar__cta { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 0 1.1rem; min-height: 44px; border-radius: var(--r-pill); background: var(--white); color: var(--green); font-weight: var(--fw-semibold); font-size: var(--fs-small); }
.cart-bar--static { position: static; } /* pour la démonstration */

/* ================= Feuille (dialog) ================= */
.sheet {
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--sh-3);
  overflow: auto;
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgb(0 30 0 / 0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in var(--dur-3) var(--ease); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 720px) {
  .sheet { max-width: 520px; margin: auto; border-radius: var(--r-xl); }
}
.sheet__grip { width: 44px; height: 5px; margin: var(--sp-3) auto 0; border-radius: 3px; background: var(--line); }
.sheet__media { position: relative; display: grid; place-items: center; height: 260px; margin: var(--sp-3) var(--sp-3) 0; border-radius: var(--r-lg); background: var(--tint, var(--white)); overflow: hidden; }
.sheet__media img { position: absolute; inset: 7% 0 5%; width: 100%; height: 88%; object-fit: contain; }
.sheet__close { position: absolute; top: var(--sp-3); right: var(--sp-3); background: var(--white); }
.sheet__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); padding: var(--sp-5) var(--sp-5) 0; }
.sheet__footer {
  position: sticky; bottom: 0;
  display: flex; gap: var(--sp-3); align-items: center;
  padding: var(--sp-4) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom));
  margin-top: var(--sp-5);
  background: linear-gradient(to top, var(--cream) 75%, transparent);
}
.sheet__footer .btn { flex: 1; min-width: 0; justify-content: space-between; padding-inline: 1.15rem; font-size: 1rem; }

/* ================= Alertes et notifications ================= */
.alert {
  display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--fs-small);
}
.alert__title { font-weight: var(--fw-semibold); }
.alert--success { background: var(--success-soft); color: var(--green); }
.alert--info { background: var(--white); border-color: var(--line); color: var(--ink); }
.alert--warning { background: var(--orange-soft); color: #8A3500; }
.alert--error { background: var(--error-soft); color: var(--error); }
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  width: fit-content; max-width: min(92vw, 420px);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--white);
  font-size: var(--fs-small);
  box-shadow: var(--sh-2);
}
.toast .icon { color: #9BE29B; }

/* ================= État vide ================= */
.empty { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-7) var(--sp-5); text-align: center; }
.empty img { width: 96px; }

/* ================= Administration ================= */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--pending { color: var(--st-pending); background: var(--st-pending-bg); }
.badge--confirmed { color: var(--st-confirmed); background: var(--st-confirmed-bg); }
.badge--preparing { color: var(--st-preparing); background: var(--st-preparing-bg); }
.badge--delivering { color: var(--st-delivering); background: var(--st-delivering-bg); }
.badge--delivered { color: var(--st-delivered); background: var(--st-delivered-bg); }
.badge--cancelled { color: var(--st-cancelled); background: var(--st-cancelled-bg); }

.kpi { display: grid; gap: var(--sp-1); padding: var(--sp-5); border-radius: var(--r-lg); background: var(--white); box-shadow: var(--sh-1); }
.kpi__label { font-size: var(--fs-small); color: var(--ink-muted); }
.kpi__value { font-size: clamp(1.625rem, 1.4rem + 1vw, 2.125rem); font-weight: var(--fw-extrabold); color: var(--green); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi__value small { font-size: 0.45em; font-weight: var(--fw-semibold); margin-left: 0.2em; }
.kpi__delta { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--ink-muted); }
.kpi__delta--up { color: var(--green); }
.kpi__delta--down { color: var(--error); }

/* position: relative garde les textes masqués (.visually-hidden) dans la zone de défilement */
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--r-lg); background: var(--white); box-shadow: var(--sh-1); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th { padding: var(--sp-3) var(--sp-4); text-align: left; font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
/* Pas de retour à la ligne : le tableau défile horizontalement sur téléphone */
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FFFBF8; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); letter-spacing: 0.02em; }

/* ================= Pied de page ================= */
/* Fond clair obligatoire : la charte ne fournit pas de version du logo pour fond vert,
   et interdit de le recolorer. */
.site-footer { background: var(--cream-deep); padding-block: var(--sp-8) var(--sp-6); }
.site-footer__grid { display: grid; gap: var(--sp-7); }
@media (min-width: 860px) { .site-footer__grid { grid-template-columns: 1.2fr repeat(2, 1fr); } }
.site-footer__logo { width: 180px; }
.site-footer h3 { font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--green); margin-bottom: var(--sp-3); }
.site-footer ul { display: grid; gap: var(--sp-2); font-size: var(--fs-small); color: var(--ink-muted); }
.site-footer__legal { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--ink-muted); }

/* ================= Points rassurants ================= */
.perks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.perks li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.perks .icon { color: var(--orange-deep); }

/* ================= Grille de la carte ================= */
/* Deux colonnes dès le mobile : les cinq recettes tiennent sur trois rangées. */
.product-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .product-grid { gap: var(--sp-5); grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 719px) {
  .product-grid .product-card__media { margin: 6px 6px 0; }
  .product-grid .product-card__body { padding: var(--sp-3) var(--sp-3) var(--sp-4); }
  .product-grid .product-card__title { font-size: 1rem; }
  .product-grid .eyebrow { font-size: 10.5px; letter-spacing: 0.1em; }
  .product-grid .product-card__footer { padding-top: var(--sp-2); }
  .product-grid .product-card__footer .price { font-size: var(--fs-small); }
  .product-grid .product-card__footer .icon-btn { width: 40px; height: 40px; }
  .product-grid .product-card__badge { top: var(--sp-2); left: var(--sp-2); font-size: 10.5px; padding: 0.3rem 0.6rem; }
}
.price__from { font-weight: var(--fw-regular); color: var(--ink-muted); }
@media (max-width: 719px) {
  .product-grid .product-card__footer { gap: var(--sp-2); }
  .product-grid .price__from { display: block; font-size: 11px; line-height: 1.2; }
}

/* ================= Les 3 formats (visuel « Nos 3 formats ») ================= */
/* Toujours côte à côte, comme sur l'affiche ; gobelets à 60 %, 80 % et 100 %. */
.formats {
  --formats-h: clamp(150px, 40vw, 260px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: var(--sp-2);
  padding: var(--sp-5) 0;
}
.formats__item { display: grid; justify-items: center; gap: var(--sp-3); margin: 0; }
.formats__item img { width: auto; max-width: 100%; height: calc(var(--formats-h) * var(--scale, 1)); object-fit: contain; }
@media (max-width: 599px) {
  .formats { gap: 4px; }
  .formats .format-tag { gap: 5px; }
  .formats .format-tag__name { font-size: 0.875rem; padding: 0.45em 1.1em; }
  /* 19 px en ExtraBold : « grand texte » au sens WCAG, donc blanc sur orange admis */
  .formats .format-tag__price { font-size: 1.1875rem; padding: 0.35em 0.5em; letter-spacing: -0.01em; }
  .formats .format-tag__price small { font-size: 0.45em; margin-left: 0.2em; }
}

/* Indicateurs : 2 colonnes sur téléphone (le gérant pilote depuis son mobile), 4 sur ordinateur */
.kpi-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 960px) { .kpi-grid { gap: var(--sp-5); grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 599px) {
  .kpi-grid .kpi { padding: var(--sp-4); }
  .kpi-grid .kpi__label { font-size: var(--fs-xs); line-height: 1.4; }
  .kpi-grid .kpi__value { font-size: 1.375rem; }
}

/* ================= Navigation de la carte : recettes ou mix ================= */
/* Les deux façons de commander restent visibles en permanence pendant qu'on parcourt la carte. */
.menu-switch {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  display: flex;
  gap: var(--sp-2);
  padding-block: var(--sp-3);
  margin-bottom: var(--sp-3);
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.menu-switch a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--green);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  white-space: nowrap;
}
.menu-switch a[aria-current="true"] { background: var(--green); border-color: var(--green); color: var(--white); }
.menu-switch .icon { width: 1rem; height: 1rem; }

/* ================= Accroche « Compose ton mix » (en tête de la carte) ================= */
.mix-teaser {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: inset 0 0 0 2px var(--orange), var(--sh-1);
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--dur-2) var(--ease);
}
.mix-teaser:hover { box-shadow: inset 0 0 0 2px var(--orange), var(--sh-2); }
.mix-teaser__media {
  position: relative;
  aspect-ratio: 1;
  border-radius: calc(var(--r-lg) - 8px);
  background: var(--tint-corail);
  overflow: hidden;
}
/* Trois gobelets en éventail : les couleurs possibles d'un mix */
.mix-teaser__media img { position: absolute; bottom: 6%; height: 80%; width: auto; left: 50%; }
.mix-teaser__media img:nth-child(1) { translate: -95% 4%; rotate: -10deg; height: 66%; }
.mix-teaser__media img:nth-child(2) { translate: -50% 0; z-index: 1; }
.mix-teaser__media img:nth-child(3) { translate: -5% 4%; rotate: 10deg; height: 66%; }
.mix-teaser__body { display: grid; gap: 2px; }
.mix-teaser__title { font-size: var(--fs-h3); font-weight: var(--fw-extrabold); color: var(--green); line-height: 1.15; letter-spacing: var(--ls-heading); }
.mix-teaser__text { font-size: var(--fs-small); color: var(--ink-muted); line-height: 1.45; }
.mix-teaser__cta { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-1); color: var(--orange-deep); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.mix-teaser__cta .icon { width: 1rem; height: 1rem; transition: translate var(--dur-2) var(--ease); }
.mix-teaser:hover .mix-teaser__cta .icon { translate: 3px 0; }
@media (min-width: 720px) {
  .mix-teaser { grid-template-columns: 220px minmax(0, 1fr) auto; gap: var(--sp-6); padding: var(--sp-4) var(--sp-6) var(--sp-4) var(--sp-4); }
  .mix-teaser__title { font-size: var(--fs-h2); }
  .mix-teaser__text { font-size: var(--fs-body); }
  .mix-teaser__cta { display: none; }
}
.mix-teaser__btn { display: none; }
@media (min-width: 720px) { .mix-teaser__btn { display: inline-flex; } }

/* ================= Atelier « Compose ton mix » ================= */
.mix-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* sinon la colonne prend la largeur du contenu et déborde */
  border-radius: var(--r-xl);
  background: var(--white);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
@media (min-width: 900px) { .mix-builder { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.mix-builder__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: var(--sp-5) var(--sp-4) calc(var(--sp-8) + var(--sp-2));
  background: var(--tint, var(--tint-corail));
  transition: background-color var(--dur-3) var(--ease);
}
.mix-builder__visual img {
  height: 210px;
  width: auto;
  transition: opacity 180ms var(--ease), transform var(--dur-3) var(--ease);
}
.mix-builder__visual img[data-swap] { opacity: 0; transform: translateY(8px) scale(0.97); }
@media (min-width: 900px) { .mix-builder__visual { min-height: 100%; } .mix-builder__visual img { height: 360px; } }
.mix-slots {
  position: absolute;
  left: 50%;
  bottom: var(--sp-5);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.mix-slot {
  display: grid;
  place-items: center;
  min-width: 108px;
  min-height: 40px;
  padding: 0 0.9rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--ink-muted);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.mix-slot[data-filled] { border-style: solid; border-color: var(--green); color: var(--green); }
.mix-slots__plus { font-size: 1.25rem; font-weight: var(--fw-extrabold); color: var(--green); }
.mix-builder__panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); align-content: start; padding: var(--sp-6) var(--sp-5); }
@media (min-width: 900px) { .mix-builder__panel { padding: var(--sp-8) var(--sp-7); } }
.mix-builder__match {
  display: flex; gap: var(--sp-2); align-items: center;
  padding: 0.65rem 0.9rem;
  border-radius: var(--r-md);
  background: var(--green-soft);
  color: var(--green);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}
/* Sur petit écran, le bouton passe sous la quantité plutôt que de rogner le prix */
.mix-builder__footer { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.mix-builder__footer .btn { flex: 1 1 200px; justify-content: space-between; padding-inline: 1.15rem; font-size: 1rem; }
/* Tant que les deux fruits ne sont pas choisis : bouton lisible mais inactif (vert sur vert doux, 8,2:1) */
.mix-builder__footer .btn:disabled { opacity: 1; background: var(--green-soft); color: var(--green); justify-content: center; }
.mix-builder__footer .btn:disabled .price { display: none; }

/* ================= Fonds de recette (classes, pour respecter la CSP sans style intégré) ================= */
.tint-pale { --tint: var(--tint-pale); }
.tint-jaune { --tint: var(--tint-jaune); }
.tint-orange { --tint: var(--tint-orange); }
.tint-rose { --tint: var(--tint-rose); }
.tint-corail { --tint: var(--tint-corail); }

/* ================= En-tête : actions et menu mobile ================= */
.site-header__actions { display: flex; align-items: center; gap: var(--sp-1); }
.site-header__menu { display: inline-grid; }
@media (min-width: 960px) { .site-header__menu { display: none; } }
@media (max-width: 359px) { .site-header__cta { display: none; } }

.menu-sheet {
  width: min(100%, 420px);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--sh-3);
}
.menu-sheet::backdrop { background: rgb(0 30 0 / 0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.menu-sheet[open] { animation: menu-in var(--dur-3) var(--ease); }
@keyframes menu-in { from { transform: translateX(24px); opacity: 0; } }
.menu-sheet__head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 var(--gutter); border-bottom: 1px solid var(--line); }
.menu-sheet__head img { height: 30px; width: auto; }
.menu-sheet__nav { display: grid; padding: var(--sp-3) var(--gutter); }
.menu-sheet__nav a {
  display: flex; align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  color: var(--green);
  font-size: 1.125rem;
  font-weight: var(--fw-bold);
  text-decoration: none;
}

/* ================= Bandeaux ================= */
.demo-banner {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--gutter);
  background: var(--orange-soft);
  color: #8A3500;
  font-size: var(--fs-small);
  text-align: center;
}
.demo-banner .icon { width: 1rem; height: 1rem; flex: none; }
.pause-banner {
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--orange-soft);
  color: #8A3500;
  font-weight: var(--fw-semibold);
}

/* ================= Notifications ================= */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: var(--z-toast);
  display: grid;
  gap: var(--sp-2);
  justify-items: center;
  width: max-content;
  max-width: 92vw;
  pointer-events: none;
}
.toast { animation: toast-in var(--dur-2) var(--ease); }
.toast--erreur { background: var(--error); }
.toast--erreur .icon { color: #FFD9D6; }
.toast--sortie { opacity: 0; translate: 0 8px; transition: opacity var(--dur-2) var(--ease), translate var(--dur-2) var(--ease); }
@keyframes toast-in { from { opacity: 0; translate: 0 8px; } }

/* ================= Chargement ================= */
.product-card--squelette { min-height: 280px; background: linear-gradient(100deg, var(--white) 30%, var(--cream) 50%, var(--white) 70%); background-size: 300% 100%; animation: squelette 1.4s linear infinite; box-shadow: var(--sh-1); }
@keyframes squelette { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .product-card--squelette { animation: none; } }
.noscript { padding: var(--sp-4); background: var(--orange-soft); text-align: center; font-weight: var(--fw-semibold); }
.mix-builder__indispo { color: var(--ink-muted); font-size: var(--fs-small); }

/* ================= Barre panier : visible seulement sur mobile ================= */
@media (min-width: 960px) { .cart-bar { display: none; } }
