/* ==========================================================================
   Butcher Shop Hammamet — vitrine publique
   Palette imposée : navy / rouge boucherie / blanc / gris clair.
   Typo : Archivo étroit (enseigne) + Archivo normal (texte) + IBM Plex Mono (poids).
   Signature : le récapitulatif imprimé comme un ticket de balance.
   ========================================================================== */

:root {
  --navy: #0F172A;
  --navy-2: #172033;
  --red: #D71920;
  --red-press: #B8141A;
  --white: #FFFFFF;
  --bg: #F7F8FA;
  --muted: #64748B;
  --success: #16A34A;
  --success-ink: #15803D;
  --success-tint: #EEFBF2;

  --ink: var(--navy);
  --ink-2: #334155;
  --on-navy: #CBD5E1;
  --on-navy-muted: #94A3B8;
  --line: #E2E6EB;
  --line-soft: #ECEFF3;
  --tile: #F1F3F6;
  --paper-rule: #CBD5E1;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-ar: "Noto Naskh Arabic", "Geeza Pro", "Arial", sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow-2: 0 1px 2px rgba(15, 23, 42, .06), 0 12px 28px -12px rgba(15, 23, 42, .16);
  --shadow-3: 0 18px 40px -14px rgba(15, 23, 42, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --gutter: 16px;
  --header-h: 64px;
  --cartbar-space: 0px;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; --header-h: 72px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--white); color: var(--ink); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; }
.icon--lg { width: 24px; height: 24px; }

.wrap {
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn .icon { width: 18px; height: 18px; }

.btn--primary {
  background: var(--red);
  color: var(--white);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px -10px rgba(215, 25, 32, .8);
}
.btn--primary:hover { background: var(--red-press); }

.btn--ghost {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: #C9D0D9; }

.btn--lg { min-height: 54px; font-size: 16px; padding-inline: 24px; }
.btn--block { width: 100%; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: var(--white);
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 10px 30px -18px rgba(2, 6, 23, .9); }

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-right: auto;
  color: var(--white);
  text-decoration: none;
}
.brand__logo { width: 40px; height: 40px; flex: none; }
.brand__text { display: grid; min-width: 0; line-height: 1.15; }
.brand__name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  font-stretch: 78%;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand__owner { font-size: 12px; color: var(--on-navy-muted); letter-spacing: .01em; }

.nav { display: none; }
.nav a {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--on-navy);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--white); background: rgba(255, 255, 255, .06); }
.nav a[aria-current="page"] { color: var(--white); box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--white);
  transition: background-color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); }

.cart-badge {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: var(--white);
  font: 600 11.5px/20px var(--font-mono);
  text-align: center;
  box-shadow: 0 0 0 2px var(--navy);
}

.is-bumping { animation: bump .32s var(--ease); }
@keyframes bump {
  40% { transform: scale(1.28); }
}

.menu-btn__close { display: none; }
.menu-btn[aria-expanded="true"] .menu-btn__open { display: none; }
.menu-btn[aria-expanded="true"] .menu-btn__close { display: block; }

/* ---------- Tiroir de navigation mobile (glisse depuis la gauche) ---------- */

/* Fond assombri : ferme le tiroir au clic, indique qu'une couche modale est ouverte. */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(2, 6, 23, .55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease-out, visibility 0s linear .35s;
}
.nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease-out;
}

.mobile-nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 210;
  display: flex;
  flex-direction: column;
  width: min(84vw, 340px);
  background: var(--navy);
  box-shadow: 0 24px 50px -16px rgba(2, 6, 23, .6);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear .45s;
}
.mobile-nav.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .45s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: var(--header-h);
  flex: none;
  padding: 0 12px 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.mobile-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  font-stretch: 78%;
  letter-spacing: .06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--white);
}
.mobile-nav__brand img { width: 32px; height: 32px; flex: none; }

.mobile-nav__links {
  overflow-y: auto;
  padding: 4px var(--gutter) calc(16px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  color: var(--on-navy);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a[aria-current="page"] { color: var(--white); }
.mobile-nav__count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: var(--white);
  font: 600 12px/22px var(--font-mono);
  text-align: center;
}

/* Le tiroir recouvre tout l'écran en largeur réduite : pas de scroll horizontal pendant la transition. */
body.nav-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .nav-backdrop, .mobile-nav { transition-duration: .01ms; }
}

@media (min-width: 900px) {
  .nav { display: flex; gap: 2px; margin-right: 12px; }
  .menu-btn, .mobile-nav, .nav-backdrop { display: none !important; }
  .brand__name { font-size: 16px; }
}

/* ---------- Bandeau d'accueil ---------- */
.hero--new {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: #0B1728;
  color: var(--white);
  background-size: cover;
  background-position: center right;
  margin: 12px var(--gutter) 24px;
  border-radius: var(--r-lg);
  min-height: 140px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-2);
}

@media (min-width: 768px) {
  .hero--new {
    margin: 24px auto 32px;
    max-width: calc(1200px); /* keeping it contained */
    min-height: 180px;
  }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(11, 23, 40, 0.95) 0%, rgba(11, 23, 40, 0.7) 50%, rgba(11, 23, 40, 0.1) 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  padding: 20px 20px;
  width: 100%;
}

@media (min-width: 768px) {
  .hero__inner {
    padding: 32px 40px;
  }
}

.hero__copy {
  display: flex;
  flex-direction: column;
}

.hero__eyebrow {
  color: rgba(255, 255, 255, 0.75);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hero__title {
  color: var(--white);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 4px;
  max-width: 250px;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .hero__title {
    font-size: 32px;
    max-width: 400px;
  }
}

.hero__lede {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  line-height: 1.35;
  max-width: 230px;
  font-weight: 400;
}

@media (min-width: 768px) {
  .hero__lede {
    font-size: 14.5px;
    max-width: 300px;
  }
}

/* ---------- Bandeau de confiance ---------- */
.trust {
  background: var(--white);
  padding-bottom: 8px;
}
.trust__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-block: 16px;
}
.trust__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  letter-spacing: -0.01em;
}
.trust__item .icon {
  width: 24px;
  height: 24px;
  color: var(--navy);
}

@media (min-width: 640px) {
  .trust__list { display: flex; justify-content: center; gap: 24px 48px; padding-block: 20px; }
  .trust__item { flex-direction: row; gap: 10px; font-size: 14px; text-align: left; }
  .trust__item .icon { width: 22px; height: 22px; }
}

/* ---------- Catalogue ---------- */
.catalogue { padding-block: 32px 56px; }
.page-products .catalogue { padding-top: 28px; }

.section-head { margin-bottom: 18px; }
.section-title,
.page-title,
.about__title {
  font-weight: 800;
  font-stretch: 76%;
  line-height: 1.02;
  letter-spacing: -.01em;
}
.section-title { font-size: clamp(2rem, 1.55rem + 1.8vw, 2.875rem); }
.section-lede { margin-top: 8px; color: var(--muted); font-size: 15.5px; }

.layout { display: grid; gap: 28px; align-items: start; }
.layout__main { min-width: 0; }

@media (min-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; }
}

.toolbar { display: grid; gap: 12px; margin-bottom: 16px; }

.search { position: relative; }
.search__icon {
  position: absolute;
  top: 50%;
  left: 16px;
  translate: 0 -50%;
  color: var(--muted);
  pointer-events: none;
}
.search__input {
  width: 100%;
  height: 52px;
  padding: 0 52px 0 46px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-1);
  font-size: 16px; /* évite le zoom automatique sur iOS */
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.search__input::placeholder { color: #8A96A8; }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search__input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(15, 23, 42, .08); }
.search__clear {
  position: absolute;
  top: 50%;
  right: 4px;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.search__clear:hover { color: var(--ink); }

.chips {
  display: flex;
  gap: 8px;
  margin-inline: calc(-1 * var(--gutter));
  padding: 2px var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--gutter);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: #C9D0D9; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

@media (min-width: 768px) {
  .chips { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; overflow: visible; }
}

.toolbar__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-count { color: var(--muted); font-size: 14px; }
.sort { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; }
.sort select {
  height: 44px;
  padding: 0 28px 0 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F172A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center / 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  appearance: none;
  cursor: pointer;
}
.sort select:hover { background-color: rgba(15, 23, 42, .04); }

/* ---------- Grille & cartes produit ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr); /* 140px = taille native des photos */
  grid-template-areas:
    "media body"
    "actions actions";
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--white);
  box-shadow: var(--shadow-1);
  container-type: inline-size;
  scroll-margin-top: calc(var(--header-h) + 16px);
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-2); }
.card:target { animation: target-ring 2s var(--ease); }
@keyframes target-ring {
  0%, 45% { border-color: var(--red); box-shadow: 0 0 0 3px rgba(215, 25, 32, .18), var(--shadow-2); }
}

.card__media {
  grid-area: media;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--tile);
}
/* La photo occupe toute la tuile, quelle que soit sa forme (carrée ou 4:3). */
.card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(1.03);
  mix-blend-mode: multiply; /* fond blanc des photos fondu dans la tuile */
}
.card__placeholder { width: 40px; height: 40px; color: #A3AEBD; }

.tag {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--navy);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card__body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card__title {
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.003em;
  text-wrap: balance; /* évite un mot seul sur la 2e ligne */
}
.card__ar {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-ar);
  font-size: 14px;
  line-height: 1.5;
  text-align: left; /* aligné sous le nom français, même en écriture RTL */
}
.card__cat { margin-top: 2px; color: var(--muted); font-size: 13px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--success-ink);
  font-size: 13px;
  font-weight: 600;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
}
.status--out { color: #B42318; }
.status--out::before { background: #D92D20; box-shadow: 0 0 0 3px rgba(217, 45, 32, .12); }

.card__price { margin-top: auto; padding-top: 8px; }
.price { color: var(--ink); font-size: 15px; line-height: 1.3; }
.price strong { font-size: 19px; font-weight: 750; font-stretch: 85%; }
.price span { color: var(--muted); font-size: 13.5px; }
.price--tbc { color: var(--ink-2); font-weight: 600; }
.card__unit { color: var(--muted); font-size: 13px; }

.card__actions { grid-area: actions; display: flex; gap: 8px; }

.stepper {
  display: flex;
  flex: none;
  align-items: center;
  height: 48px;
  padding: 2px;
  border-radius: var(--r-md);
  background: var(--tile);
}
.stepper__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--ink);
  transition: background-color .15s, box-shadow .15s, transform .1s;
}
.stepper__btn:hover:not(:disabled) { background: var(--white); box-shadow: var(--shadow-1); }
.stepper__btn:active:not(:disabled) { transform: scale(.92); }
.stepper__btn:disabled { color: #B3BCC8; cursor: default; }
.stepper__value {
  flex: 1;
  min-width: 70px;
  padding-inline: 2px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.stepper__unit { font-size: 12.5px; }
.card.has-qty .stepper__value { color: var(--ink); font-weight: 600; }
.is-ticking { animation: tick .2s var(--ease); }
@keyframes tick {
  50% { transform: scale(1.08); }
}

.btn-add {
  display: inline-flex;
  flex: 1 1 auto; /* base auto : garde ses 48px quand les actions s'empilent */
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border-radius: var(--r-md);
  background: var(--red);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 16px -10px rgba(215, 25, 32, .8);
  transition: background-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn-add:hover:not(:disabled) { background: var(--red-press); }
.btn-add:active:not(:disabled) { transform: scale(.97); }
.btn-add__idle,
.btn-add__done { display: inline-flex; align-items: center; gap: 8px; }
.btn-add__done { display: none; }
.btn-add .icon { width: 18px; height: 18px; }

.card.is-in-cart .btn-add {
  background: var(--success-tint);
  color: var(--success-ink);
  box-shadow: inset 0 0 0 1px #BBEBC9;
  cursor: default;
}
.card.is-in-cart .btn-add__idle { display: none; }
.card.is-in-cart .btn-add__done { display: inline-flex; animation: pop .28s var(--ease); }
@keyframes pop {
  from { transform: scale(.85); opacity: 0; }
}

.card.is-out { background: #FCFCFD; box-shadow: none; }
.card.is-out .card__media,
.card.is-out .card__title,
.card.is-out .card__ar,
.card.is-out .card__cat,
.card.is-out .card__price,
.card.is-out .stepper { opacity: .5; }
.card.is-out .card__media img { filter: grayscale(.7); }
.card.is-out .btn-add { background: #EEF0F3; color: #8A96A8; box-shadow: none; cursor: not-allowed; }

@media (min-width: 640px) {
  .card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "media"
      "body"
      "actions";
    gap: 14px;
    padding: 12px 12px 16px;
  }
  .card__media { aspect-ratio: 4 / 3; }
  .card__body,
  .card__actions { padding-inline: 4px; }
  .card__actions { flex-direction: column; }
}

/* 3 colonnes : cartes plus étroites, tuile carrée pour agrandir le produit */
@media (min-width: 1200px) {
  .card__media { aspect-ratio: 1; }
}

/* Petits téléphones : on garde assez de place pour le nom et le prix */
@media (max-width: 374px) {
  .card { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; }
}

/* Carte assez large : quantité et bouton côte à côte */
@container (min-width: 320px) {
  .card__actions { flex-direction: row; }
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 44px 20px;
  border: 1.5px dashed #D5DAE1;
  border-radius: var(--r-lg);
  text-align: center;
}
.empty__title { font-weight: 650; }
.empty__text { color: var(--muted); font-size: 14.5px; }
.empty .btn { margin-top: 12px; }

/* ---------- Ticket de balance (signature) ---------- */
.ticket-wrap {
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .08)) drop-shadow(0 14px 22px rgba(15, 23, 42, .09));
}
.ticket {
  --tooth: 14px;
  padding: 26px 20px 24px;
  background: var(--white);
  -webkit-mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x;
  mask:
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x;
}
.ticket--compact { padding: 20px 16px 20px; }

.ticket__head {
  margin-bottom: 6px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--paper-rule);
  text-align: center;
}
.ticket__shop {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ticket__meta { margin-top: 4px; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }

.ticket__line { padding: 9px 0; }
.ticket__line + .ticket__line { border-top: 1px solid var(--line-soft); }
.ticket__row { display: flex; align-items: flex-end; gap: 8px; }
.ticket__name {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 550;
  line-height: 1.3;
  text-decoration: none;
}
a.ticket__name { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
a.ticket__name:hover { text-decoration-color: currentColor; }
.ticket__leader {
  flex: 1 0 14px;
  margin-bottom: 5px;
  border-bottom: 2px dotted var(--paper-rule);
}
.ticket__qty {
  flex: none;
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ticket__sub { margin-top: 2px; color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.ticket__remove {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -8px -10px -8px 0;
  border-radius: var(--r-sm);
  color: #8A96A8;
  transition: color .15s, background-color .15s;
}
.ticket__remove:hover { color: var(--red); background: #FDF1F1; }
.ticket__remove:active { transform: scale(.92); }
.ticket__remove .icon { width: 16px; height: 16px; }

/* ---------- Ligne de panier modifiable (cart.php + panneau bureau) ---------- */
.ticket__thumb {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--tile);
  object-fit: cover;
}
.ticket__thumb--sm { width: 32px; height: 32px; }
.ticket__thumb--placeholder { display: block; }

.ticket__line--editable { padding: 11px 0; }
.ticket__row--editable {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.ticket__info { flex: 1 1 120px; min-width: 0; }
.ticket__info .ticket__name { display: block; }

/* Les contrôles passent toujours sur leur propre ligne (pleine largeur) : disposition
   prévisible à toutes les tailles, jamais de débordement horizontal sur petit écran. */
.ticket__controls {
  display: flex;
  flex: 1 1 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ticket__stepper { flex: none; }

/* Sous ~340px de large, le stepper (162px) + le bouton de suppression (44px) ne
   tiennent plus côte à côte avec l'espacement par défaut : on réduit la valeur
   affichée pour ne jamais forcer de défilement horizontal (testé dès 320px). */
@media (max-width: 374px) {
  .ticket__stepper .stepper__value { min-width: 46px; font-size: 13.5px; }
}

.ticket__totals {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--paper-rule);
  font-size: 14px;
}
.ticket__total-row { display: flex; justify-content: space-between; gap: 12px; }
.ticket__total-row dt { color: var(--muted); }
.ticket__total-row dd { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.ticket__grand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 3px double var(--ink);
}
.ticket__grand dt {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ticket__grand dd { font-size: 20px; font-weight: 800; font-stretch: 82%; text-align: right; }
.ticket__note { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* ---------- Panneau panier (bureau) ---------- */
.cart-panel { display: none; }

@media (min-width: 1024px) {
  .cart-panel {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 20px);
  }
}
.cart-panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cart-panel__title { font-size: 24px; font-weight: 800; font-stretch: 78%; line-height: 1.1; }
.cart-panel__title:focus { outline: none; }
.cart-panel__count { color: var(--muted); font-size: 14px; }
.cart-panel__empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 20px;
  border: 1.5px dashed #D5DAE1;
  border-radius: var(--r-lg);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.cart-panel__empty strong { color: var(--ink); }
.cart-panel__empty .icon { width: 28px; height: 28px; margin-bottom: 6px; color: #A3AEBD; }
.cart-panel .ticket__lines { max-height: min(44vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.cart-panel .btn { margin-top: 18px; }
.cart-panel__note { margin-top: 10px; color: var(--muted); font-size: 12.5px; text-align: center; }

/* ---------- Barre panier (mobile & tablette) ---------- */
.cartbar {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin-inline: auto;
  padding: 8px 8px 8px 18px;
  border-radius: 18px;
  background: var(--navy);
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 40px -14px rgba(2, 6, 23, .6);
  transform: translateY(calc(100% + 40px));
  visibility: hidden;
  transition: transform .3s var(--ease), visibility 0s linear .3s;
}
.cartbar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform .3s var(--ease), visibility 0s;
}
.cartbar__summary {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.3;
}
.cartbar__count { font-weight: 700; }
.cartbar__sep { color: var(--on-navy-muted); }
.cartbar__weight { color: var(--on-navy); font-family: var(--font-mono); font-size: 14px; }
.cartbar__cta { flex: none; padding-inline: 16px; box-shadow: none; }

@media (max-width: 399px) {
  .cartbar__summary { flex-direction: column; align-items: flex-start; }
  .cartbar__sep { display: none; }
}

@media (max-width: 1023px) {
  body.has-cartbar { --cartbar-space: calc(84px + env(safe-area-inset-bottom)); }
  body.has-cartbar .site-footer { padding-bottom: calc(24px + var(--cartbar-space)); }
}
@media (min-width: 1024px) {
  .cartbar { display: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: calc(20px + var(--cartbar-space) + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 60;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-3);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .18s, transform .22s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }

/* ---------- À propos ---------- */
.about {
  padding-block: 56px;
  border-top: 1px solid var(--line-soft);
  background: var(--white);
}
.about__grid { display: grid; gap: 36px; }
.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.about__title { margin-top: 10px; font-size: clamp(1.875rem, 1.45rem + 1.6vw, 2.625rem); }
.about__text { max-width: 46ch; margin-top: 14px; color: var(--ink-2); font-size: 16.5px; }

.steps__title { font-size: 18px; font-weight: 700; }
.steps { margin-top: 8px; counter-reset: step; }
.steps li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}
.steps strong { font-weight: 650; }
.steps span { color: var(--muted); font-size: 15px; }

@media (min-width: 900px) {
  .about { padding-block: 80px; }
  .about__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 72px; }
}

/* ---------- Pied de page ---------- */
.site-footer {
  padding-block: 44px 24px;
  background: var(--navy);
  color: var(--on-navy);
}
.site-footer__grid { display: grid; align-items: start; gap: 28px; }
.site-footer__brand { display: flex; align-items: center; gap: 14px; }
.site-footer__brand img { width: 56px; height: 56px; }
.site-footer__name { color: var(--white); font-weight: 750; font-stretch: 78%; letter-spacing: .06em; text-transform: uppercase; }
.site-footer__owner { color: var(--on-navy-muted); font-size: 14px; }
.site-footer__title {
  margin-bottom: 8px;
  color: var(--on-navy-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.contact-list li,
.contact-list a { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.contact-list a { color: var(--white); font-weight: 600; text-decoration: none; }
.contact-list a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.contact-list .icon { color: var(--on-navy-muted); }
.contact-list a .icon { color: #4ADE80; }
.footer-links a { display: inline-flex; align-items: center; min-height: 40px; color: var(--on-navy); text-decoration: none; }
.footer-links a:hover { color: var(--white); }
.site-footer__bottom {
  margin-top: 32px;
  color: var(--on-navy-muted);
  font-size: 13px;
}
.site-footer__bottom p { padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); }

@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: 1.3fr 1fr .8fr; }
}

/* ---------- Pages panier & confirmation ---------- */
.page { padding-block: 28px 56px; }
.checkout { max-width: calc(640px + 2 * var(--gutter)); }
.page-title { font-size: clamp(2rem, 1.5rem + 2vw, 2.875rem); }
.page-lede { margin-top: 10px; color: var(--muted); font-size: 16px; }
.checkout__ticket { margin-top: 24px; }
.hint { margin-top: 12px; color: var(--muted); font-size: 13px; text-align: center; }

.checkout__empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: 24px;
  padding: 44px 20px;
  border: 1.5px dashed #D5DAE1;
  border-radius: var(--r-lg);
  text-align: center;
}
.checkout__empty-icon { width: 32px; height: 32px; margin-bottom: 6px; color: #A3AEBD; }
.checkout__empty-title { font-size: 18px; font-weight: 700; }
.checkout__empty-text { max-width: 34ch; color: var(--muted); }
.checkout__empty .btn,
.checkout__first-action { margin-top: 16px; }

.details { margin-top: 32px; }
.details__title { font-size: 19px; font-weight: 700; }
.details__title span { margin-left: 6px; color: var(--muted); font-size: 14px; font-weight: 500; }
.details__text { margin-top: 4px; color: var(--muted); font-size: 14.5px; }

.field { display: grid; gap: 6px; margin-top: 16px; }
.field label { font-size: 14px; font-weight: 600; }
.field input,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.4; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(15, 23, 42, .08); }
.field__hint { color: var(--muted); font-size: 13px; }

.checkout__cta { margin-top: 28px; }
.checkout__edit { margin-top: 10px; }
.fineprint { margin-top: 12px; color: var(--muted); font-size: 13px; text-align: center; }

@media (max-width: 639px) {
  /* le bouton WhatsApp reste à portée de pouce pendant la saisie */
  .checkout__cta {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-inline: calc(-1 * var(--gutter));
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(247, 248, 250, .94);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

.done-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--success-tint);
  box-shadow: inset 0 0 0 1px #BBEBC9;
  color: var(--success);
}
.order-actions { display: grid; gap: 10px; margin-top: 28px; }
.order-actions__retry { color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
