/* ==========================================================================
   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: clamp(230px, 23vw, 280px);
  }
}

.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-top: 24px; padding-bottom: 8px; }
.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: 18px; }
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "media body"
    "media actions";
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-1);
  container-type: inline-size;
  scroll-margin-top: calc(var(--header-h) + 16px);
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .22s cubic-bezier(0.16, 1, 0.3, 1), 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: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r-md);
  background: radial-gradient(circle at center, #FFFFFF 25%, #F1F4F9 100%);
}
.card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  filter: brightness(1.02);
  mix-blend-mode: multiply;
  transition: transform .35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card__placeholder { width: 40px; height: 40px; color: #A3AEBD; }

.tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #F8FAFC;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.tag--out {
  background: rgba(220, 38, 38, 0.9);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.card__body {
  grid-area: body;
  display: flex;
  flex-direction: column;
  min-width: 0;
  justify-content: flex-start;
}
.card__header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.card__title {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--navy);
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  margin: 0;
}
.card__price-inline {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
  line-height: 1.2;
  margin: 0;
}
.card__price-inline strong {
  font-size: 16px;
  font-weight: 800;
  font-stretch: 85%;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.card__price-inline .price__per {
  color: #64748B;
  font-size: 11.5px;
  font-weight: 500;
  margin-left: 2px;
}
.card__ar {
  display: block;
  margin-top: 3px;
  color: #64748B;
  font-family: var(--font-ar);
  font-size: 12.5px;
  line-height: 1.35;
  font-weight: 500;
  width: fit-content;
  text-align: right;
}
.price--tbc {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  color: #475569;
  background: #F1F5F9;
  padding: 2.5px 7px;
  border-radius: 6px;
  margin-top: 6px;
  width: fit-content;
}

.card__actions {
  grid-area: actions;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  min-width: 0;
}

.stepper {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 2px;
  border-radius: 10px;
  background: #F1F4F9;
  border: 1px solid rgba(15, 23, 42, 0.05);
  flex: 1 1 50%;
  min-width: 0;
}
.stepper__btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  flex: 0 0 30px;
  transition: all .15s ease;
}
.stepper__btn:hover:not(:disabled) {
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}
.stepper__btn:active:not(:disabled) { transform: scale(.92); }
.stepper__btn:disabled { background: transparent; box-shadow: none; color: #CBD5E1; cursor: default; }
.stepper__value {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline: 2px;
  color: #64748B;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}
.stepper__unit { font-size: 11px; font-weight: 500; color: #94A3B8; }
.card.has-qty .stepper__value { color: var(--navy); font-weight: 750; }
.card.has-qty .stepper__unit { color: #64748B; }
.is-ticking { animation: tick .2s var(--ease); }
@keyframes tick {
  50% { transform: scale(1.08); }
}

.btn-add {
  display: inline-flex;
  flex: 1 1 50%;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--red);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 3px 10px -2px rgba(215, 25, 32, .38);
  transition: all .18s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
}
.btn-add:hover:not(:disabled) {
  background: var(--red-press);
  box-shadow: 0 5px 14px -2px rgba(215, 25, 32, .5);
  transform: translateY(-1px);
}
.btn-add:active:not(:disabled) { transform: scale(.97); }
.btn-add__idle,
.btn-add__done { display: inline-flex; align-items: center; gap: 6px; }
.btn-add__done { display: none; }
.btn-add .icon { width: 17px; height: 17px; }

.card.is-in-cart {
  border-color: #86EFAC;
  box-shadow: 0 4px 16px -2px rgba(22, 163, 74, 0.1);
}
.card.is-in-cart .btn-add {
  background: #ECFDF5;
  color: #065F46;
  border: 1.5px solid #6EE7B7;
  box-shadow: none;
  cursor: default;
}
.card.is-in-cart .btn-add:hover {
  transform: none;
  background: #ECFDF5;
}
.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; border-color: var(--line-soft); }
.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; }

/* Desktop card UX enhancements */
@media (min-width: 640px) {
  .card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 12px 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: var(--white);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
    transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .22s cubic-bezier(0.16, 1, 0.3, 1), border-color .2s;
  }
  .card:hover {
    transform: translateY(-4px);
    border-color: rgba(203, 213, 225, 0.95);
    box-shadow: 0 14px 28px -6px rgba(15, 23, 42, 0.09), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  }
  .card.is-in-cart:hover {
    border-color: rgba(22, 163, 74, 0.5);
    box-shadow: 0 14px 28px -6px rgba(22, 163, 74, 0.12), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  }
  .card__media {
    aspect-ratio: 16 / 10.5;
    width: 100%;
    border-radius: 12px;
    background: radial-gradient(circle at center, #FFFFFF 30%, #F1F4F9 100%);
    position: relative;
    overflow: hidden;
  }
  .card__media img {
    padding: 2px;
    transform: scale(1.05);
  }
  .card:hover .card__media img {
    transform: scale(1.12);
  }
  .card__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    padding-inline: 0;
    min-width: 0;
  }
  .card__header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  .card__title {
    font-size: 15.5px;
    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.015em;
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
  }
  .card__price-inline {
    flex: 0 0 auto;
    text-align: right;
    white-space: nowrap;
    margin: 0;
  }
  .card__price-inline strong {
    font-size: 17.5px;
    font-weight: 800;
    font-stretch: 85%;
    color: var(--navy);
    letter-spacing: -.02em;
  }
  .card__price-inline .price__per {
    color: #64748B;
    font-size: 12px;
    font-weight: 500;
    margin-left: 2px;
  }
  .card__ar {
    display: block;
    margin-top: 3px;
    font-family: var(--font-ar);
    font-size: 12.5px;
    line-height: 1.35;
    font-weight: 500;
    color: #64748B;
    width: fit-content;
    text-align: right;
  }
  .price--tbc {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 650;
    color: #475569;
    background: #F1F5F9;
    padding: 2.5px 8px;
    border-radius: 6px;
    margin-top: 6px;
    width: fit-content;
  }
  .card__actions {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding-inline: 0;
  }
  .stepper {
    height: 38px;
    border-radius: 10px;
    background: #F1F4F9;
    border: 1px solid rgba(15, 23, 42, 0.05);
    flex: 1 1 50%;
  }
  .stepper__btn {
    width: 30px;
    height: 32px;
    border-radius: 8px;
    flex: 0 0 30px;
  }
  .stepper__value {
    font-size: 13px;
    padding-inline: 2px;
  }
  .stepper__unit {
    font-size: 11px;
  }
  .btn-add {
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    flex: 1 1 50%;
    white-space: nowrap;
  }
  .btn-add .icon {
    width: 16px;
    height: 16px;
  }
}

@media (min-width: 1200px) {
  .card__media { aspect-ratio: 16 / 10.5; }
}

/* 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; }
}

.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);
  overflow-x: hidden;
  -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 14px 20px; overflow-x: hidden; }

.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__lines {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: clip !important;
  scrollbar-width: thin;
}
.ticket__lines::-webkit-scrollbar:horizontal {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}
.ticket__line {
  padding: 9px 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}
.ticket__line + .ticket__line { border-top: 1px solid var(--line-soft); }
.ticket__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.ticket__name {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  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 1 6px;
  min-width: 4px;
  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: 28px;
  height: 28px;
  margin: 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; }

.ticket--compact .ticket__row { gap: 6px; }
.ticket--compact .ticket__name { font-size: 14px; }
.ticket--compact .ticket__qty { font-size: 13.5px; }
.ticket--compact .ticket__remove { width: 26px; height: 26px; margin: 0; }

/* ---------- 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;
  overflow-x: clip !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.cart-panel .ticket__lines::-webkit-scrollbar {
  width: 5px;
}
.cart-panel .ticket__lines::-webkit-scrollbar:horizontal {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}
.cart-panel .ticket__lines::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.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; }
}


/* ---------- 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; }

/* ---------- Footer public & Crédit Polpo Studio ---------- */
.site-footer {
  margin-top: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  background: var(--surface, #ffffff);
}

body.has-cartbar .site-footer {
  /* Espace uniquement lorsque la barre panier mobile flottante est active */
  padding-bottom: calc(12px + var(--cartbar-space, 72px));
}

@media (min-width: 640px) {
  .site-footer {
    padding: 12px 0;
  }
  body.has-cartbar .site-footer {
    padding-bottom: 12px;
  }
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.site-footer__credit {
  margin: 0;
  padding: 0;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.025em;
  color: #94a3b8;
  line-height: 1.4;
  opacity: 0.85;
}

.site-footer__credit a {
  color: #64748b;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(100, 116, 139, 0.2);
  padding-bottom: 1px;
  transition: all 0.2s ease;
}

.site-footer__credit a:hover,
.site-footer__credit a:focus-visible {
  color: var(--brand, #b91c1c);
  border-bottom-color: var(--brand, #b91c1c);
  opacity: 1;
}

/* ---------- 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;
  }
}
