/* ------------------------------------------------------------------
   Grass Motion — direction visuelle tirée de l'affiche :
   bitume, soleil jaune, panneaux de rue verts, contours noirs épais.
------------------------------------------------------------------- */
:root {
  --asphalt: #201f1b;
  --asphalt-2: #2b2924;
  --sun: #f5b00a;
  --cream: #f7edd2;
  --sky: #319ea5;
  --sign: #063a22;
  --ink: #0e0d0b;

  --display: "Anton", system-ui, sans-serif;
  --hand: "Permanent Marker", cursive;
  --body: "Karla", system-ui, sans-serif;

  --pad: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--asphalt);
  color: var(--cream);
  font-family: var(--body);
  font-size: 16px;
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  width: 100%;
}

img, video { display: block; width: 100%; height: 100%; object-fit: cover; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* --- En-tête compact ---------------------------------------------- */
.masthead {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) var(--pad) 12px;
  overflow: hidden;
  isolation: isolate;
}

/* L'affiche, floutée et assombrie, sert de fond */
.masthead::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  background: url("assets/hero.jpg") center 45% / cover;
  filter: blur(3px) brightness(0.4) saturate(1.1);
}

.mark {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.titles { min-width: 0; }

.name {
  margin: 0;
  font-family: var(--display);
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--ink);
}

.tagline {
  margin: 5px 0 0;
  font-family: var(--hand);
  font-size: 13px;
  line-height: 1.2;
  color: var(--sun);
  text-shadow: 1.5px 1.5px 0 var(--ink);
}

/* --- Bandeau d'annonce défilant ------------------------------------ */
.ticker {
  overflow: hidden;
  background: var(--sun);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 6px 0;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: slide-left var(--speed, 22s) linear infinite;
}

.ticker-track span {
  padding-right: 42px;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

@keyframes slide-left {
  to { transform: translateX(-50%); }
}

/* Ligne médiane de la route, reprise de l'affiche */
.road {
  height: 12px;
  background:
    repeating-linear-gradient(to right,
      var(--sun) 0 34px, transparent 34px 62px) center / auto 4px no-repeat,
    var(--asphalt-2);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

/* --- Filtres : panneaux de rue ------------------------------------ */
.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding: 10px var(--pad);
  background: var(--asphalt);
  box-shadow: 0 6px 12px -6px rgba(0, 0, 0, 0.9);
}

.filters::-webkit-scrollbar { display: none; }

.filters button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 12px;
  background: var(--sign);
  border: 2px solid var(--ink);
  box-shadow: inset 0 0 0 1px rgba(247, 237, 210, 0.55);
  border-radius: 3px;
  font-family: var(--display);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.55;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.filters button b {
  font-weight: 400;
  opacity: 0.6;
  margin-left: 5px;
}

.filters button[aria-pressed="true"] {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(247, 237, 210, 0.8), 3px 3px 0 var(--ink);
}

.filters button:active { transform: translateY(1px); }

/* --- Grille ------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 12px;
  padding: 18px var(--pad) 4px;
}

@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--cream);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
  animation: rise 0.4s var(--ease) backwards;
}

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.card:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--sun);
  border-bottom: 2.5px solid var(--ink);
}

/* Les images apparaissent en fondu une fois chargées */
.thumb img, .carousel img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.thumb img.ready, .carousel img.ready { opacity: 1; }

.thumb .empty {
  display: grid;
  place-items: center;
  height: 100%;
  background: var(--sun);
}

.thumb .empty img { width: 76%; height: auto; opacity: 0.9; }

/* Pastille de lecture sur les vignettes vidéo */
.play {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--cream);
}

.play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-left: 8px solid var(--cream);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.card h2 {
  margin: 4px 10px 0;
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.card .ref {
  margin: 9px 10px 0;
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: rgba(14, 13, 11, 0.5);
}

.card .from {
  margin: 4px 10px 0;
  font-size: 11px;
  color: rgba(14, 13, 11, 0.62);
}

/* Étiquette de prix peinte à la main */
.card .price {
  align-self: flex-start;
  margin: 9px 10px 12px;
  padding: 3px 9px 4px;
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 3px;
  transform: rotate(-1.8deg);
  font-family: var(--hand);
  font-size: 14px;
  line-height: 1.3;
}

/* --- États -------------------------------------------------------- */
.state {
  grid-column: 1 / -1;
  padding: 48px var(--pad);
  text-align: center;
}

.state strong {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--sun);
}

.state span { opacity: 0.7; font-size: 14px; }

.skeleton {
  border: 2.5px solid rgba(247, 237, 210, 0.14);
  border-radius: 4px;
  overflow: hidden;
}

.skeleton .bar { background: var(--asphalt-2); animation: pulse 1.3s ease-in-out infinite; }
.skeleton .bar.media { aspect-ratio: 1; }
.skeleton .bar.line { height: 13px; margin: 12px 10px 0; }
.skeleton .bar.line.short { width: 45%; margin-bottom: 14px; }

@keyframes pulse { 50% { opacity: 0.45; } }

.legal {
  padding: 26px var(--pad) 0;
  font-size: 11px;
  line-height: 1.7;
  opacity: 0.55;
}

/* --- Fiche produit ------------------------------------------------ */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--cream);
  color: var(--ink);
  animation: sheet-in 0.26s var(--ease);
}

.sheet.closing { animation: sheet-out 0.18s ease forwards; }

@keyframes sheet-in { from { transform: translateY(22px); opacity: 0; } }
@keyframes sheet-out { to { transform: translateY(16px); opacity: 0; } }

.sheet-scroll {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

.sheet-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 15px;
  color: var(--ink);
}

.sheet-close:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  background: var(--sun);
  border-bottom: 3px solid var(--ink);
}

.carousel::-webkit-scrollbar { display: none; }
.carousel > * { flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: center; }

.dots { display: flex; justify-content: center; gap: 7px; padding: 12px 0 0; }

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  transition: background 0.2s ease;
}

.dots i.on { background: var(--ink); }

.sheet-body { padding: 18px var(--pad) 0; }

.sheet-body .ref {
  margin: 0;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(14, 13, 11, 0.55);
}

.sheet-body h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(32px, 10vw, 44px);
  line-height: 0.98;
  text-transform: uppercase;
}

/* Provenance, juste sous le nom */
.origin {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  font-size: 13.5px;
  color: rgba(14, 13, 11, 0.75);
}

.origin::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--sign);
  border: 2px solid var(--ink);
}

.sheet-body .price {
  display: inline-block;
  margin: 14px 0 0;
  padding: 5px 13px 6px;
  background: var(--sun);
  border: 2.5px solid var(--ink);
  border-radius: 3px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-1.5deg);
  font-family: var(--hand);
  font-size: 20px;
}

/* Grille tarifaire : un palier par ligne */
.tiers {
  margin: 16px 0 0;
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
}

.tiers div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 2px dashed rgba(14, 13, 11, 0.3);
}

.tiers div:last-child { border-bottom: 0; }
.tiers div:nth-child(odd) { background: rgba(245, 176, 10, 0.16); }

.tiers .tl {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tiers .tp {
  flex: 0 0 auto;
  padding: 3px 10px 4px;
  background: var(--sun);
  border: 2px solid var(--ink);
  border-radius: 3px;
  transform: rotate(-1.5deg);
  font-family: var(--hand);
  font-size: 15px;
}

.sheet-body .desc {
  margin: 20px 0 0;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.specs { margin: 24px 0 0; border-top: 2px dashed rgba(14, 13, 11, 0.35); }

.specs div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 2px dashed rgba(14, 13, 11, 0.35);
  font-size: 13px;
}

.specs .k {
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(14, 13, 11, 0.6);
  align-self: center;
}

.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--cream) 68%, rgba(247, 237, 210, 0));
}

.cta {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--sun);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease);
}

.cta:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.cta[disabled] { background: rgba(14, 13, 11, 0.08); box-shadow: none; opacity: 0.7; }


/* --- Contrôle d'âge ------------------------------------------------ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px var(--pad);
  overflow-y: auto;
  background: var(--asphalt);
  isolation: isolate;
}

.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/hero.jpg") center 45% / cover;
  filter: blur(5px) brightness(0.32) saturate(1.1);
}

.gate-box {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.gate-mark {
  width: 108px;
  height: 108px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}

.gate-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 11vw, 46px);
  line-height: 0.95;
  text-transform: uppercase;
  color: var(--cream);
  text-shadow: 3px 3px 0 var(--ink);
}

.gate-text {
  margin: 16px 0 26px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--cream);
  opacity: 0.85;
}

.gate-no {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  font-size: 13.5px;
  color: var(--cream);
  opacity: 0.7;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gate.blocked::before { filter: blur(9px) brightness(0.2) grayscale(1); }

/* --- Sélection du format et de la quantité ------------------------- */
.picker { margin: 22px 0 0; }

.picker-label {
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(14, 13, 11, 0.6);
}

.formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.formats button {
  flex: 1 1 auto;
  min-width: 92px;
  min-height: 46px;
  padding: 8px 12px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  text-align: center;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.formats button .fl {
  display: block;
  font-family: var(--display);
  font-size: 14px;
  text-transform: uppercase;
}

.formats button .fp {
  display: block;
  margin-top: 2px;
  font-family: var(--hand);
  font-size: 13px;
}

.formats button[aria-pressed="true"] {
  background: var(--sun);
  box-shadow: 3px 3px 0 var(--ink);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 0;
}

.stepper button {
  width: 46px;
  height: 46px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
}

.stepper button:active { background: var(--sun); }

.stepper output {
  min-width: 46px;
  text-align: center;
  font-family: var(--display);
  font-size: 24px;
}

.stepper .sum {
  margin-left: auto;
  font-family: var(--hand);
  font-size: 17px;
}

/* --- Barre de panier flottante ------------------------------------- */
.cartbar {
  position: fixed;
  left: var(--pad);
  right: var(--pad);
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--sun);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
  animation: pop 0.25s var(--ease);
}

@keyframes pop { from { transform: translateY(14px); opacity: 0; } }

.cartbar:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.cartbar-count {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--sun);
  font-family: var(--display);
  font-size: 14px;
}

.cartbar-label {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cartbar-total {
  margin-left: auto;
  font-family: var(--hand);
  font-size: 16px;
}

/* --- Contenu du panier --------------------------------------------- */
.cart-head {
  padding: 22px var(--pad) 0;
  font-family: var(--display);
  font-size: clamp(30px, 9vw, 40px);
  line-height: 1;
  text-transform: uppercase;
}

.cart-lines { padding: 18px var(--pad) 0; }

.cart-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 2px dashed rgba(14, 13, 11, 0.3);
}

.cart-line:first-child { border-top: 2px dashed rgba(14, 13, 11, 0.3); }

.cart-thumb {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  overflow: hidden;
  background: var(--sun);
}

.cart-thumb .empty { display: grid; place-items: center; height: 100%; }
.cart-thumb .empty img { width: 84%; height: auto; }

.cart-info { flex: 1 1 auto; min-width: 0; }

.cart-info h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.05;
  text-transform: uppercase;
}

.cart-info .fmt {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: rgba(14, 13, 11, 0.65);
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
}

.cart-qty button {
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--cream);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
}

.cart-qty output {
  min-width: 26px;
  text-align: center;
  font-family: var(--display);
  font-size: 17px;
}

.cart-qty .line-total {
  margin-left: auto;
  font-family: var(--hand);
  font-size: 15px;
}

.cart-drop {
  align-self: center;
  padding: 8px;
  font-size: 13px;
  color: rgba(14, 13, 11, 0.5);
  text-decoration: underline;
}

.cart-note { padding: 22px var(--pad) 0; }

.cart-note label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(14, 13, 11, 0.6);
}

.cart-note textarea {
  width: 100%;
  min-height: 76px;
  padding: 11px;
  background: var(--cream);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  font-family: var(--body);
  font-size: 14.5px;
  resize: vertical;
}

.cart-note textarea::placeholder { color: rgba(14, 13, 11, 0.4); }

.cart-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px var(--pad) 0;
  padding: 14px 16px;
  background: var(--sun);
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
}

.cart-sum .k {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cart-sum .v { font-family: var(--hand); font-size: 22px; }

.cart-hint {
  margin: 14px var(--pad) 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(14, 13, 11, 0.65);
}

/* --- Confirmation de commande -------------------------------------- */
.done {
  padding: 60px var(--pad) 0;
  text-align: center;
}

.done .stamp {
  display: inline-block;
  padding: 10px 20px;
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 5px;
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-2.5deg);
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: 0.06em;
}

.done h2 {
  margin: 26px 0 0;
  font-family: var(--display);
  font-size: 30px;
  text-transform: uppercase;
}

.done p {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(14, 13, 11, 0.75);
}

.error-box {
  margin: 16px var(--pad) 0;
  padding: 12px 14px;
  background: rgba(196, 60, 30, 0.12);
  border: 2px solid #8c2d16;
  border-radius: 4px;
  font-size: 13.5px;
  color: #6d240f;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .thumb img, .carousel img { opacity: 1; }
}
[hidden] { display: none !important; }
