.page-commande { color: var(--ink); }
body.page-commande {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.page-commande .order,
.page-commande .pay {
  flex: 1;
  background: #f6f0e6;
}
.page-commande .site-footer { background: #f6f0e6; }

.order { padding-bottom: 48px; }

.cat-stage {
  position: sticky;
  top: calc(78px + env(safe-area-inset-top, 0px));
  z-index: 28;
  background: #e4d6c0;
  border-bottom: 1px solid rgba(16, 14, 12, 0.08);
}
.cat-stage::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 56px;
  background: linear-gradient(90deg, transparent, #e4d6c0);
  pointer-events: none;
  z-index: 2;
}

.cat-rail {
  --cat-on: clamp(36px, 5.2vw, 64px);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  overflow-anchor: none;
  min-height: calc(var(--cat-on) + 34px);
  padding: 10px 0 14px;
  scroll-padding-inline: var(--page-x);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.cat-rail::before,
.cat-rail::after {
  content: "";
  flex: 0 0 var(--page-x);
  pointer-events: none;
}
.cat-rail::-webkit-scrollbar { display: none; }

.cat-glider {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  background: var(--orange);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.35s ease;
}

.cat-rail button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--cat-on) + 20px);
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: color 0.25s ease;
}
.cat-rail button:not(:last-child)::after {
  content: "·";
  position: absolute;
  right: -7px;
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}
.cat-rail button .cat-label {
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700;
  font-synthesis: none;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}
.cat-rail button.is-on {
  color: #e4d6c0;
  padding: 10px 16px;
}
.cat-rail button.is-on .cat-label {
  font-size: var(--cat-on);
}
.cat-rail button:not(.is-on):hover { color: #080706; }

.order-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 28px;
  align-items: start;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 28px var(--page-x) 0;
}

.menu-stage { overflow-anchor: none; }
.menu-head {
  margin-bottom: 22px;
  text-align: left;
}
.menu-head h1 {
  font-size: clamp(40px, 6vw, 72px);
  color: var(--ink);
}
.diet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 10px 0 0;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  color: #6d655c;
}
.diet-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.diet-dots {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 4px;
}
.diet-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(16, 14, 12, 0.18);
}
.diet-dot-vegan { background: #1f8a3b; }
.diet-dot-veggie { background: #7cb342; }
.diet-dot-spicy {
  background: #d62828;
  font-size: 13px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.menu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 12px 14px 14px;
  background: #fff;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 1px 0 rgba(16, 14, 12, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(16, 14, 12, 0.08);
}
.menu-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: multiply;
  margin: 0 0 10px;
}
.menu-card h3 {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
  min-height: 2.4em;
  color: var(--ink);
  margin: 0;
  text-align: center;
}
.menu-copy {
  text-align: center;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.menu-price {
  margin: 4px 0 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  color: #6d655c;
  text-align: center;
}
.menu-card .plus {
  margin-top: auto;
  padding-top: 0;
  align-self: center;
  background: var(--orange);
  color: #fff;
}
.menu-card .plus:hover,
.menu-card .plus:focus-visible,
.menu-card .plus.is-on { background: var(--orange-press); }

.receipt {
  position: sticky;
  top: 176px;
  background: #1a1714;
  color: var(--cream);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  max-height: calc(100svh - 196px);
  min-height: 380px;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(16, 14, 12, 0.28);
  color-scheme: dark;
}
.receipt-mode { margin: 0 0 10px; }
.receipt-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: default;
}
.receipt-handle { display: none; }
.receipt-toggle h2 { margin: 4px 0 6px; }
.receipt-toggle .cart-count {
  display: none;
}
.receipt-toggle [data-cart-total] { display: none; }
.receipt-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.receipt-scrim { display: none; }

@media (min-width: 981px) {
  .receipt-toggle { pointer-events: none; }
}
.receipt-kicker {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
}
.receipt h2 {
  font-size: clamp(36px, 4vw, 48px);
  margin: 4px 0 6px;
  letter-spacing: 0;
}
.receipt-until {
  margin: 0 0 12px;
  font-size: 13px;
  color: rgba(243, 234, 216, 0.55);
}

.receipt .cart-lines {
  flex: 1;
  overflow: auto;
  min-height: 72px;
  scrollbar-width: thin;
}
.receipt-empty {
  margin: 20px 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: rgba(243, 234, 216, 0.5);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}

.ticket-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(243, 234, 216, 0.12);
}
.ticket-name {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  grid-column: 1;
}
.ticket-price {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  grid-column: 2;
  grid-row: 1;
}
.ticket-line .qty {
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: 2px;
}

.receipt-sum {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 0 10px;
  font-family: var(--display);
  font-size: 32px;
  line-height: 0.9;
}
.receipt-sum span:first-child {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.receipt-sum span:last-child { color: var(--orange); }

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 4px;
  background: #efe8dc;
  border-radius: 999px;
}
.mode-chip {
  position: relative;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font);
  font-size: 13px;
}
.mode-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-chip span {
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 999px;
  font-weight: 600;
  color: #6d655c;
  transition: background 0.2s ease, color 0.2s ease;
}
.mode-chip input:checked + span {
  background: var(--ink);
  color: var(--cream);
}
.receipt .mode-switch {
  background: rgba(243, 234, 216, 0.1);
}
.receipt .mode-chip span {
  color: rgba(243, 234, 216, 0.55);
}
.receipt .mode-chip input:checked + span {
  background: var(--cream);
  color: var(--ink);
}
.mode-chip input:focus-visible + span {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.page-commande .checkout {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.page-commande .checkout label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(243, 234, 216, 0.5);
}
.page-commande .checkout input,
.page-commande .checkout select {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1.5px solid rgba(243, 234, 216, 0.22);
  background: transparent;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--cream);
  border-radius: 0;
}
.page-commande .checkout select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--cream) 50%),
    linear-gradient(135deg, var(--cream) 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 7px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 22px;
}
.page-commande .when-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.page-commande .checkout input:focus {
  outline: none;
  border-bottom-color: var(--orange);
}
.page-commande .checkout .btn {
  margin-top: 8px;
  border-radius: 999px;
  width: 100%;
}

.page-commande .qty {
  gap: 6px;
}
.page-commande .qty button {
  width: 28px;
  height: 28px;
  border: 0;
  background: rgba(243, 234, 216, 0.14);
  border-radius: 999px;
  font-size: 16px;
  color: #fff;
}
.page-commande .qty button:hover { background: var(--orange); color: #fff; }
.page-commande .cart-note {
  font-family: var(--font);
  font-size: 12px;
  color: var(--orange);
  margin: 0 0 8px;
}
.page-commande .checkout-ok {
  padding: 14px;
  background: rgba(247, 123, 40, 0.18);
  border-radius: 14px;
  font-family: var(--font);
  font-size: 14px;
}

.receipt.is-pulse {
  animation: receipt-pulse 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes receipt-pulse {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-4px) scale(1.015); }
  100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cat-glider { transition: none; }
  .menu-card { transition: none; }
  .receipt.is-pulse { animation: none; }
}

@media (max-width: 980px) {
  .cat-stage { top: calc(66px + env(safe-area-inset-top, 0px)); }
  .order-board {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 96px;
  }
  .menu-card img { height: 176px; }
  .receipt-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 44;
    margin: 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(16, 14, 12, 0.28);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    backdrop-filter: blur(22px) saturate(1.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }
  .receipt-scrim.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  @media (prefers-reduced-transparency: reduce) {
    .receipt-scrim {
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
      background: rgba(16, 14, 12, 0.62);
    }
  }
  .receipt:not(.has-items) { display: none !important; }
  .receipt {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    z-index: 45;
    margin: 0;
    min-height: 0;
    background: #1a1714;
    border: 0;
    box-shadow: 0 18px 50px rgba(16, 14, 12, 0.45);
  }
  .receipt-toggle {
    cursor: pointer;
    gap: 10px;
  }
  .receipt-toggle::after {
    content: "–";
    margin-left: auto;
    font-size: 22px;
    line-height: 1;
    color: rgba(243, 234, 216, 0.45);
  }
  .receipt-toggle h2 {
    font-size: 22px;
    margin: 0;
  }
  .receipt-toggle .cart-count,
  .receipt-toggle [data-cart-total] {
    display: inline-flex;
  }
  .receipt-toggle [data-cart-total] {
    font-family: var(--display);
    font-size: 20px;
    font-weight: 700;
    color: var(--orange);
  }
  .receipt-handle {
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(243, 234, 216, 0.28);
    transform: translateX(-50%);
  }
  .receipt:not(.is-min) {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 92svh;
    padding: 18px 16px 16px;
    border-radius: 22px;
    overflow: auto;
  }
  .receipt:not(.is-min)::before {
    content: "";
    order: -2;
    align-self: center;
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(243, 234, 216, 0.28);
    margin: 0 0 6px;
  }
  .receipt:not(.is-min) .receipt-handle { display: none; }
  .receipt.is-min .receipt-mode { display: none; }
  .checkout-contact { display: none !important; }
  .receipt.has-items:not(.is-min) .cart-lines {
    flex: none;
    overflow: visible;
    min-height: 0;
    max-height: none;
  }
  .receipt:not(.has-items):not(.is-min) .checkout { display: none; }
  .receipt.is-min {
    left: auto;
    right: 16px;
    width: auto;
    max-width: min(300px, calc(100vw - 32px));
    max-height: none;
    padding: 8px 12px;
    border-radius: 999px;
    border: 0;
    background: var(--orange);
    color: #fff;
    box-shadow: 0 12px 40px rgba(247, 123, 40, 0.45);
  }
  .receipt.is-min .receipt-body { display: none; }
  .receipt.is-min .receipt-handle { display: none; }
  .receipt.is-min .receipt-toggle {
    color: #fff;
    gap: 8px;
  }
  .receipt.is-min .receipt-toggle h2 {
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
  }
  .receipt.is-min .receipt-toggle [data-cart-total] {
    color: #fff;
    font-size: 18px;
  }
  .receipt.is-min .receipt-toggle::after {
    content: "+";
    color: rgba(255, 255, 255, 0.85);
  }
}

@media (max-width: 640px) {
  .cat-rail { --cat-on: 40px; }
  .cat-rail button { padding: 8px 10px; }
  .cat-rail button.is-on { padding: 8px 12px; }
  .cat-rail button .cat-label { font-size: 22px; }
  .menu-card { padding: 10px 10px 12px; border-radius: 14px; }
  .menu-card h3 { font-size: 20px; }
}
