.client-allergen-checkout,
.client-cart-next {
  --checkout-text: #f6ecff;
  --checkout-muted: #e1cde9;
  --checkout-surface: #21132c;
  --checkout-panel: #30203e;
  --checkout-inset: #3a254a;
  --checkout-border: #806292;
  --checkout-accent: #eed9ff;
  --checkout-primary: #eed9ff;
  --checkout-primary-text: #29153a;
  --checkout-focus: #f7b9fc;
}

body[data-client-theme="day"] .client-allergen-checkout,
body[data-client-theme="day"] .client-cart-next {
  --checkout-text: #281437;
  --checkout-muted: #50385f;
  --checkout-surface: #fbf5ff;
  --checkout-panel: #fff;
  --checkout-inset: #f1e4fa;
  --checkout-border: #906ca5;
  --checkout-accent: #60257d;
  --checkout-primary: #6f228d;
  --checkout-primary-text: #fff;
  --checkout-focus: #63217b;
}

.client-allergen-checkout {
  box-sizing: border-box;
  width: min(100%, 68rem);
  min-width: 0;
  margin-inline: auto;
  padding: clamp(16px, 4vw, 44px);
  border: 1px solid var(--checkout-border);
  border-radius: clamp(16px, 3vw, 26px);
  background: var(--checkout-surface);
  color: var(--checkout-text);
  text-align: start;
  overflow-wrap: anywhere;
}

/* La coque réserve habituellement la place du bandeau, absent sur cette étape. */
html body[data-client-theme] #app#app#app#app#app .mockup[data-page="panier"]:has(> .client-allergen-checkout) {
  padding-block: clamp(16px, 3vw, 36px) clamp(20px, 3vw, 42px) !important;
}

html body[data-client-theme] #app#app#app#app#app .mockup[data-page="panier"]:has(> .client-allergen-checkout) > .site-legal-footer.client-service-footer {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  justify-content: center !important;
  inline-size: calc(100% - 24px) !important;
  min-block-size: 0 !important;
  margin: 16px auto 0 !important;
  padding: 0 !important;
}

.client-allergen-checkout :where(h1, h2, h3, p, ul),
.client-cart-next :where(p) {
  margin: 0;
}

.client-allergen-checkout .client-allergen-checkout-heading {
  display: grid;
  gap: 8px;
  margin-bottom: clamp(16px, 4vw, 28px);
}

.client-allergen-checkout .client-allergen-checkout-heading h1 {
  color: var(--checkout-text);
  font-size: clamp(1.8rem, 6vw, 3.1rem);
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-shadow: none;
  text-transform: none;
}

.client-allergen-checkout :is(h2, h3) {
  color: var(--checkout-text);
  font-weight: 800;
  line-height: 1.25;
  text-shadow: none;
  text-transform: none;
}

.client-allergen-checkout h2 {
  font-size: clamp(1.15rem, 3.6vw, 1.4rem);
}

.client-allergen-checkout h3 {
  font-size: 1.05rem;
}

.client-allergen-checkout p,
.client-allergen-checkout small,
.client-cart-next p {
  color: var(--checkout-text);
  font-size: 1rem;
  line-height: 1.55;
}

.client-allergen-checkout .client-allergen-checkout-kicker {
  color: var(--checkout-accent);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.client-allergen-checkout .client-allergen-checkout-summary,
.client-allergen-checkout .client-allergen-checkout-card,
.client-allergen-checkout .client-allergen-checkout-traces,
.client-allergen-checkout .client-allergen-checkout-diet {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: clamp(12px, 3vw, 22px);
  border: 1px solid var(--checkout-border);
  border-radius: 14px;
  background: var(--checkout-panel);
}

.client-allergen-checkout .client-allergen-checkout-lists {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-block: 16px;
}

.client-allergen-checkout :is(.client-allergen-checkout-traces, .client-allergen-checkout-diet) {
  margin-block: 14px;
}

.client-allergen-checkout .client-allergen-checkout-traces {
  border-inline-start-width: 4px;
  background: var(--checkout-inset);
}

.client-allergen-checkout .client-allergen-checkout-lines {
  display: grid;
  gap: 0;
  padding: 0;
  list-style: none;
}

.client-allergen-checkout .client-allergen-checkout-lines > li {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--checkout-border);
}

.client-allergen-checkout .client-allergen-checkout-lines > li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.client-allergen-checkout .client-allergen-checkout-source {
  color: var(--checkout-muted);
  line-height: 1.5;
}

.client-allergen-checkout .client-allergen-checkout-diet .field {
  color: var(--checkout-text);
}

.client-allergen-checkout .client-allergen-checkout-diet textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--checkout-border);
  background: var(--checkout-surface);
  color: var(--checkout-text);
  font-size: 1rem;
  line-height: 1.45;
}

.client-allergen-checkout .client-allergen-checkout-diet textarea::placeholder {
  color: var(--checkout-muted);
  opacity: 1;
}

.client-allergen-checkout .client-allergen-checkout-confirm {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  box-sizing: border-box;
  margin: 0;
  padding: clamp(12px, 3vw, 20px);
  border: 1px solid var(--checkout-border);
  border-radius: 14px;
  background: var(--checkout-inset);
  color: var(--checkout-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.client-allergen-checkout .client-allergen-checkout-confirm input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--checkout-accent);
}

.client-allergen-checkout .client-allergen-checkout-status {
  margin-block-start: 8px;
  color: var(--checkout-muted);
  font-size: 0.92rem;
}

.client-allergen-checkout .client-allergen-checkout-status:empty {
  display: none;
}

.client-allergen-checkout .client-allergen-checkout-actions,
.client-cart-next .client-cart-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block: 14px 0;
}

/* Le lanceur reste accessible dans le flux de la page de lecture. */
body:has(#app .client-allergen-checkout) > .pb-client-help {
  position: static;
  margin: 0 clamp(12px, 4vw, 56px) clamp(20px, 4vw, 44px) auto;
}

/* Les boutons de la caisse prennent le dessus sur les styles globaux jour/nuit. */
#app .client-allergen-checkout .client-allergen-checkout-actions :is(.primary, .secondary),
#app .client-allergen-checkout .client-allergen-checkout-back,
#app .client-cart-next .client-cart-next-actions :is(.primary, .secondary) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px !important;
  padding: 10px 16px;
  border: 1px solid var(--checkout-border) !important;
  border-radius: 12px !important;
  background: var(--checkout-panel) !important;
  color: var(--checkout-text) !important;
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  text-transform: none !important;
  text-decoration: none;
  text-shadow: none !important;
  box-shadow: none !important;
}

#app .client-allergen-checkout .client-allergen-checkout-actions .primary,
#app .client-cart-next .client-cart-next-actions .primary {
  border-color: var(--checkout-primary) !important;
  background: var(--checkout-primary) !important;
  color: var(--checkout-primary-text) !important;
}

#app .client-allergen-checkout .client-allergen-checkout-actions .primary:disabled,
#app .client-cart-next .client-cart-next-actions .primary:disabled {
  border-color: var(--checkout-border) !important;
  background: var(--checkout-panel) !important;
  color: var(--checkout-muted) !important;
  opacity: 1 !important;
  cursor: not-allowed;
}

.client-allergen-checkout :is(a, button, input, textarea):focus-visible,
.client-cart-next .client-cart-next-actions :is(a, button):focus-visible {
  outline: 3px solid var(--checkout-focus);
  outline-offset: 3px;
}

.client-cart-next {
  min-width: 0;
  padding: 12px 0;
}

@media (max-width: 420px) {
  .client-allergen-checkout .client-allergen-checkout-actions > :is(.primary, .secondary),
  .client-cart-next .client-cart-next-actions > :is(.primary, .secondary) {
    flex: 1 1 120px;
  }
}
