:root {
  --cmd-bg: #f7faf6;
  --cmd-surface: #ffffff;
  --cmd-ink: #111611;
  --cmd-muted: #59635a;
  --cmd-line: #dfe7de;
  --cmd-accent: #5f7f58;
  --cmd-accent-strong: #3f684e;
  --cmd-signal: #d65f4c;
  --cmd-shadow: 0 18px 60px rgba(20, 32, 22, 0.14);
  --cmd-header-h: 64px;
}

html {
  scroll-behavior: smooth;
}

body.commande-page {
  background: var(--cmd-bg);
  color: var(--cmd-ink);
  min-height: 100svh;
  padding-bottom: 78px;
}

body.commande-modal-open {
  overflow: hidden;
}

.commande-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--cmd-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: rgba(247, 250, 246, 0.92);
  border-bottom: 1px solid rgba(17, 22, 17, 0.08);
  backdrop-filter: blur(18px);
}

.commande-brand {
  display: inline-flex;
  align-items: center;
  min-width: 118px;
}

.commande-brand img {
  width: 118px;
  height: auto;
}

.commande-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--cmd-line);
  border-radius: 8px;
  background: var(--cmd-surface);
}

.commande-lang a {
  min-width: 40px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--cmd-muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

.commande-lang a.is-active {
  background: var(--cmd-ink);
  color: #fff;
}

.commande-main {
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
}

.commande-hero {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px 0 22px;
  animation: commande-rise 520ms ease both;
}

.commande-hero__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.45;
  min-height: 0;
  border-radius: 8px;
  background: #e7eee5;
}

.commande-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 22, 17, 0.02), rgba(17, 22, 17, 0.28));
}

.commande-hero__media img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
}

.commande-hero__body {
  display: grid;
  gap: 10px;
}

.commande-eyebrow {
  color: var(--cmd-accent-strong);
  font-family: "Quicksand", system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.commande-hero h1,
.commande-shop h2,
.commande-cart h2,
.commande-success h2 {
  font-family: "Quicksand", system-ui, sans-serif;
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--cmd-ink);
}

.commande-hero h1 {
  max-width: 11em;
  font-size: 2.15rem;
}

.commande-hero p {
  max-width: 34rem;
  color: var(--cmd-muted);
  line-height: 1.55;
}

.commande-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.commande-hero__cta,
.commande-submit,
.commande-add,
.commande-bar {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font-family: "Quicksand", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.commande-hero__cta {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: var(--cmd-ink);
  color: #fff;
}

.commande-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
  padding: 2px 0;
  scrollbar-width: none;
}

.commande-proof::-webkit-scrollbar {
  display: none;
}

.commande-proof span {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--cmd-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--cmd-accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
}

.commande-shop {
  display: grid;
  gap: 18px;
  padding: 8px 0 36px;
}

.commande-shop__header {
  display: grid;
  gap: 6px;
}

.commande-shop h2 {
  font-size: 1.65rem;
}

.commande-shop__header p {
  color: var(--cmd-muted);
}

.commande-products {
  display: grid;
  gap: 12px;
}

.commande-product {
  display: grid;
  grid-template-columns: 102px minmax(0, 1fr);
  gap: 13px;
  padding: 12px;
  background: var(--cmd-surface);
  border: 1px solid var(--cmd-line);
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(20, 32, 22, 0.05);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.commande-product:hover {
  transform: translateY(-2px);
  border-color: rgba(95, 127, 88, 0.54);
  box-shadow: 0 12px 28px rgba(20, 32, 22, 0.08);
}

.commande-product.is-added {
  animation: commande-pop 360ms ease both;
}

.commande-product__media {
  align-self: start;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: #edf3eb;
}

.commande-product__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.commande-product__body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.commande-product__head {
  display: grid;
  gap: 4px;
}

.commande-product__head h3 {
  font-family: "Quicksand", system-ui, sans-serif;
  font-size: 1.08rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.commande-product__head p {
  color: var(--cmd-muted);
  font-size: 0.92rem;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.commande-product__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.commande-product__tags span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(95, 127, 88, 0.2);
  border-radius: 8px;
  background: #f3f7f1;
  color: var(--cmd-accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.commande-details-btn {
  width: fit-content;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cmd-accent-strong);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.commande-product__price {
  color: var(--cmd-accent-strong);
  font-weight: 900;
}

.commande-options {
  display: grid;
  gap: 8px;
}

.commande-weight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.commande-weight button,
.commande-qty button,
.commande-cart__remove,
.commande-icon-btn {
  border: 1px solid var(--cmd-line);
  background: var(--cmd-surface);
  color: var(--cmd-ink);
  border-radius: 8px;
  cursor: pointer;
}

.commande-weight button {
  min-height: 38px;
  font-weight: 800;
}

.commande-weight button.is-active {
  background: var(--cmd-accent);
  border-color: var(--cmd-accent);
  color: #fff;
}

.commande-select,
.commande-form input:not([type="radio"]),
.commande-form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--cmd-line);
  border-radius: 8px;
  background: var(--cmd-surface);
  color: var(--cmd-ink);
  padding: 0 12px;
  font: inherit;
}

.commande-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--cmd-muted) 50%),
    linear-gradient(135deg, var(--cmd-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.commande-actions {
  display: grid;
  grid-template-columns: minmax(108px, 1fr);
  gap: 8px;
}

.commande-qty {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  min-height: 44px;
}

.commande-qty button {
  font-size: 1.1rem;
  font-weight: 900;
}

.commande-qty input {
  min-width: 0;
  border: 0;
  border-block: 1px solid var(--cmd-line);
  text-align: center;
  font-weight: 800;
  background: var(--cmd-surface);
}

.commande-add {
  background: var(--cmd-ink);
  color: #fff;
  padding: 0 12px;
}

.commande-confidence {
  display: grid;
  gap: 14px;
  padding: 4px 0 40px;
}

.commande-confidence h2 {
  max-width: 14em;
  font-family: "Quicksand", system-ui, sans-serif;
  font-size: 1.45rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.commande-confidence__grid {
  display: grid;
  gap: 10px;
}

.commande-confidence__grid p {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--cmd-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--cmd-muted);
  line-height: 1.35;
}

.commande-confidence__grid span {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--cmd-accent);
  color: #fff;
  font-weight: 900;
}

.commande-cart {
  position: fixed;
  z-index: 60;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  max-height: none;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--cmd-surface);
  border-radius: 0;
  box-shadow: var(--cmd-shadow);
  visibility: hidden;
  pointer-events: none;
  transform: translateY(calc(100% + 32px));
  transition: transform 240ms ease, visibility 0s linear 240ms;
  overflow: hidden;
}

.commande-cart.is-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.commande-cart__handle {
  width: 44px;
  height: 4px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--cmd-line);
}

.commande-cart__header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: start;
  gap: 10px;
}

.commande-cart__header h2 {
  font-size: 1.35rem;
}

.commande-cart__back[hidden] {
  visibility: hidden;
  display: inline-flex;
}

.commande-icon-btn {
  width: 38px;
  height: 38px;
  font-size: 1.25rem;
}

.commande-cart__items {
  display: grid;
  gap: 10px;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.commande-cart__empty {
  color: var(--cmd-muted);
}

.commande-cart__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--cmd-line);
}

.commande-cart__item strong {
  display: block;
  line-height: 1.2;
}

.commande-cart__item small {
  color: var(--cmd-muted);
  line-height: 1.35;
}

.commande-cart__remove {
  width: 34px;
  height: 34px;
  font-weight: 900;
}

.commande-cart__totals {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--cmd-line);
  border-bottom: 1px solid var(--cmd-line);
}

.commande-cart__step {
  min-height: 0;
  display: grid;
  gap: 14px;
}

.commande-cart__step[hidden] {
  display: none;
}

.commande-cart__step[data-commande-step="cart_review"] {
  grid-template-rows: minmax(0, 1fr) auto auto;
}

.commande-cart__compact-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--cmd-line);
  border-bottom: 1px solid var(--cmd-line);
}

.commande-cart__compact-total span {
  color: var(--cmd-muted);
}

.commande-cart__compact-total strong {
  font-size: 1.08rem;
}

.commande-cart__totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.commande-cart__totals span {
  color: var(--cmd-muted);
}

.commande-cart__totals strong {
  font-size: 1.15rem;
}

.commande-form {
  display: grid;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.commande-form h3 {
  font-family: "Quicksand", system-ui, sans-serif;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.commande-form label {
  display: grid;
  gap: 6px;
  color: var(--cmd-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.commande-form textarea {
  padding-top: 10px;
  resize: vertical;
}

.commande-hp {
  position: absolute;
  left: -9999px;
}

.commande-fulfillment {
  display: none;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.commande-email {
  display: none;
}

.commande-fulfillment legend {
  margin-bottom: 2px;
  color: var(--cmd-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.commande-fulfillment label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--cmd-line);
  border-radius: 8px;
  color: var(--cmd-ink);
}

.commande-fulfillment input[type="radio"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--cmd-accent);
}

.commande-fulfillment span {
  min-width: 0;
  line-height: 1.25;
}

.commande-address {
  display: grid;
  gap: 12px;
}

.commande-form__hint,
.commande-feedback {
  color: var(--cmd-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.commande-feedback.is-error {
  color: #b43f31;
}

.commande-feedback.is-success {
  color: var(--cmd-accent-strong);
}

.commande-submit {
  background: var(--cmd-accent);
  color: #fff;
  font-size: 1rem;
}

.commande-submit:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.commande-bar {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: calc(48px + env(safe-area-inset-bottom));
  padding: 8px 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-radius: 0;
  background: var(--cmd-accent);
  color: #fff;
  box-shadow: var(--cmd-shadow);
}

.commande-whatsapp {
  position: fixed;
  z-index: 51;
  right: 12px;
  bottom: calc(60px + env(safe-area-inset-bottom));
  width: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--cmd-accent-strong);
  border: 1px solid rgba(95, 127, 88, 0.26);
  box-shadow: 0 12px 32px rgba(20, 32, 22, 0.14);
  font-family: "Quicksand", system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 900;
}

.commande-modal-open .commande-whatsapp {
  display: none;
}

.commande-whatsapp svg {
  width: 24px;
  height: 24px;
}

.commande-whatsapp span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.commande-bar span:first-child {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f3f7f1;
  color: var(--cmd-accent-strong);
  font-weight: 900;
}

.commande-bar strong {
  text-align: left;
}

.commande-success {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 22, 17, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.commande-success.is-open {
  opacity: 1;
  pointer-events: auto;
}

.commande-success__panel {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 8px;
  background: var(--cmd-surface);
  box-shadow: var(--cmd-shadow);
}

.commande-success__panel .commande-icon-btn {
  justify-self: end;
}

.commande-success h2 {
  font-size: 1.45rem;
}

.commande-success p {
  color: var(--cmd-muted);
}

.commande-detail {
  position: fixed;
  z-index: 82;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 0;
  background: rgba(17, 22, 17, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.commande-detail.is-open {
  opacity: 1;
  pointer-events: auto;
}

.commande-detail__panel {
  width: 100%;
  max-height: calc(92svh - env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 12px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 8px 8px 0 0;
  background: var(--cmd-surface);
  box-shadow: var(--cmd-shadow);
  transform: translateY(24px);
  transition: transform 220ms ease;
}

.commande-detail.is-open .commande-detail__panel {
  transform: translateY(0);
}

.commande-detail__panel .commande-icon-btn {
  justify-self: end;
}

.commande-detail__media {
  min-height: 190px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #edf3eb;
}

.commande-detail__media img {
  width: min(260px, 80%);
  max-height: 240px;
  object-fit: contain;
  padding: 10px;
}

.commande-detail__body {
  min-height: 0;
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.commande-detail h2 {
  font-family: "Quicksand", system-ui, sans-serif;
  font-size: 1.65rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.commande-detail__price {
  color: var(--cmd-accent-strong);
  font-weight: 900;
}

.commande-detail__text {
  display: grid;
  gap: 12px;
  color: var(--cmd-muted);
  line-height: 1.55;
}

.commande-footer {
  width: min(760px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 96px;
  color: var(--cmd-muted);
  text-align: center;
  font-size: 0.9rem;
}

@media (min-width: 720px) {
  .commande-hero {
    grid-template-columns: minmax(0, 1fr) 250px;
    align-items: center;
  }

  .commande-hero__media {
    order: 2;
    aspect-ratio: auto;
    min-height: 260px;
  }

  .commande-hero__body {
    order: 1;
  }

  .commande-proof {
    grid-column: 1 / -1;
  }

  .commande-confidence__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .commande-confidence__grid p {
    align-content: start;
    min-height: 112px;
  }

  .commande-products {
    grid-template-columns: 1fr 1fr;
  }

  .commande-product {
    grid-template-columns: 1fr;
  }

  .commande-product__media {
    max-height: 170px;
  }
}

@media (min-width: 1040px) {
  body.commande-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    grid-template-rows: auto 1fr auto;
    column-gap: 28px;
    padding-bottom: 0;
  }

  .commande-topbar {
    grid-column: 1 / -1;
    padding-inline: 28px;
  }

  .commande-main {
    width: min(920px, calc(100% - 40px));
    margin-right: 0;
  }

  .commande-hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    padding-top: 24px;
    padding-bottom: 18px;
  }

  .commande-hero h1 {
    font-size: 3rem;
  }

  .commande-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .commande-shop {
    padding-bottom: 28px;
  }

  .commande-cart {
    position: sticky;
    inset: auto;
    top: calc(var(--cmd-header-h) + 18px);
    right: 18px;
    bottom: auto;
    width: auto;
    height: auto;
    align-self: start;
    max-height: calc(100svh - var(--cmd-header-h) - 36px);
    margin: 18px 18px 18px 0;
    border: 1px solid var(--cmd-line);
    border-radius: 8px;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: none;
    overflow: hidden;
  }

  .commande-cart__handle,
  .commande-cart__header .commande-icon-btn {
    display: none;
  }

  .commande-cart__items {
    max-height: 18svh;
  }

  .commande-detail {
    place-items: center;
    padding: 24px;
  }

  .commande-detail__panel {
    width: min(720px, 100%);
    max-height: min(760px, calc(100svh - 48px));
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: start;
    padding: 18px;
    border-radius: 8px;
  }

  .commande-detail__panel .commande-icon-btn {
    grid-column: 1 / -1;
  }

  .commande-detail__media {
    min-height: 300px;
  }

  .commande-bar {
    display: none;
  }

  .commande-whatsapp {
    right: 18px;
    bottom: 18px;
    width: auto;
    padding: 0 13px;
    display: inline-flex;
  }

  .commande-whatsapp span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    margin-left: 8px;
  }

  .commande-footer {
    grid-column: 1 / -1;
    padding-bottom: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

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

@keyframes commande-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}
