/*
 * Boutique de cartes cadeaux ([luds_table_gift], public/gift.js), inspirée de Gift Up : vitrine, personnalisation avec
 * aperçu, paiement, confirmation. Hérite de la police du thème ; couleurs du restaurant par --lt-brand et --lt-on-brand
 * (Identité visuelle).
 *
 * Variables à surcharger dans le thème (sur .ltable-gift) :
 *   --ltg-radius        angles des boutons, champs et cadres (0 : angles droits) ;
 *   --ltg-accent        boutons et choix (couleur du restaurant), --ltg-on-accent : texte posé dessus ;
 *   --ltg-accent-ink    la même couleur écrite sur fond clair (liens, boutons clairs, focus) ;
 *   --ltg-ink, --ltg-muted, --ltg-line, --ltg-surface, --ltg-surface-2, --ltg-field-bg, --ltg-field-line ;
 *   --ltg-font, --ltg-heading-font, --ltg-heading-weight, --ltg-text (taille du texte) ;
 *   --ltg-max-width, --ltg-shadow, --ltg-hero-ratio (proportions de l'image d'en-tête), --ltg-focus.
 * Les boutons et champs sont redéfinis entièrement : beaucoup de thèmes stylent <button> et <input> de façon agressive.
 */

.ltable-gift {
  --ltg-accent: var(--lt-brand, #1f3a34);
  /* La même couleur écrite sur fond clair (liens, boutons clairs, focus) : assombrie par Brand::css_vars() quand elle est
     trop pâle pour se lire sur blanc ; sinon c'est elle, comme avant. */
  --ltg-accent-ink: var(--lt-brand-ink, var(--ltg-accent));
  --ltg-on-accent: var(--lt-on-brand, #ffffff);
  --ltg-ink: #1d1b18;
  --ltg-muted: #5c5852;
  --ltg-line: #e4e0d9;
  --ltg-surface: #ffffff;
  --ltg-surface-2: #f7f5f1;
  --ltg-field-bg: #ffffff;
  --ltg-field-line: #8f897f;
  --ltg-error: #b3261e;
  --ltg-success: #1f6b45;
  --ltg-radius: 10px;
  --ltg-font: inherit;
  --ltg-heading-font: inherit;
  --ltg-heading-weight: 600;
  --ltg-text: 17px;
  --ltg-max-width: 880px;
  --ltg-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 14px 36px rgb(0 0 0 / 0.08);
  --ltg-focus: var(--ltg-accent-ink);
  --ltg-hero-ratio: 16 / 7;
  --ltg-shell-radius: calc(var(--ltg-radius) * 1.6);
  --ltg-card-radius: calc(var(--ltg-radius) * 1.4);
  container-type: inline-size;
  max-width: var(--ltg-max-width);
  margin: 0 auto;
  color: var(--ltg-ink);
  font-family: var(--ltg-font);
  font-size: var(--ltg-text);
  line-height: 1.55;
  text-align: left;
}

.ltable-gift *,
.ltable-gift *::before,
.ltable-gift *::after {
  box-sizing: border-box;
}

.ltable-gift [hidden] {
  display: none !important;
}

.ltable-gift p {
  margin: 0;
}

.ltable-gift .ltg-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.ltable-gift .ltg-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ Cadre */

.ltg {
  overflow: hidden;
  border: 1px solid var(--ltg-line);
  border-radius: var(--ltg-shell-radius);
  background: var(--ltg-surface);
  box-shadow: var(--ltg-shadow);
}

.ltg-loading {
  padding: 48px 24px;
  text-align: center;
}

.ltg-body {
  padding: 30px 34px 32px;
}

.ltg-pad {
  padding: 24px 30px;
}

/* Seulement à l'arrivée sur une étape (gift.js, render) : pas à chaque choix dans l'étape. */
.ltg-body.ltg-enter > * {
  animation: ltg-in 0.28s ease both;
}

@keyframes ltg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* En-tête : photo du restaurant et logo sur une plaque claire, ou bandeau à ses couleurs. */
.ltg-hero {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: var(--ltg-hero-ratio);
  max-height: 300px;
  overflow: hidden;
  background: var(--ltg-accent);
  color: var(--ltg-on-accent);
}

.ltg-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.05) 0%, rgb(0 0 0 / 0) 45%, rgb(0 0 0 / 0.28) 100%);
  pointer-events: none;
}

.ltg-hero-plain {
  aspect-ratio: auto;
  padding: 30px 24px;
}

/* Après la vitrine, l'en-tête se fait discret : le formulaire remonte. */
.ltg:not(.ltg-at-shop) .ltg-hero:not(.ltg-hero-plain) {
  aspect-ratio: auto;
  height: 112px;
}

.ltg:not(.ltg-at-shop) .ltg-hero-plain {
  padding: 18px 24px;
}

.ltable-gift .ltg:not(.ltg-at-shop) .ltg-logo {
  max-height: 44px;
}

.ltg:not(.ltg-at-shop) .ltg-hero-brand {
  padding: 8px 16px;
}

.ltg-hero-plain::after {
  content: none;
}

.ltable-gift .ltg-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.ltg-hero-brand {
  position: relative;
  z-index: 1;
  padding: 12px 22px;
  border-radius: var(--ltg-radius);
  background: rgb(255 255 255 / 0.94);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.16);
}

.ltable-gift .ltg-logo {
  display: block;
  width: auto;
  max-width: 200px;
  height: auto;
  max-height: 56px;
  margin: 0;
  object-fit: contain;
}

/* Un SVG sans largeur ni hauteur n'a pas de taille propre : on lui donne la hauteur maximale. */
.ltable-gift .ltg-logo[src*=".svg" i] {
  height: 56px;
}

.ltg-venue {
  color: var(--ltg-ink);
  font-family: var(--ltg-heading-font);
  font-size: 22px;
  font-weight: var(--ltg-heading-weight);
}

/* ------------------------------------------------------------------ Textes */

.ltable-gift .ltg-title {
  margin: 0;
  color: var(--ltg-ink);
  font-family: var(--ltg-heading-font);
  font-size: 27px;
  font-weight: var(--ltg-heading-weight);
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-transform: none;
}

.ltable-gift .ltg-title:focus {
  outline: none;
}

.ltg-lead {
  margin-top: 6px !important;
  color: var(--ltg-muted);
  font-size: 16px;
}

.ltg-muted {
  color: var(--ltg-muted);
}

.ltable-gift .ltg-error,
.ltable-gift .ltg-field-error {
  color: var(--ltg-error);
  font-size: 16px;
  font-weight: 600;
}

.ltable-gift .ltg-field-error {
  margin-top: 6px;
}

.ltg-hint {
  margin-top: 6px !important;
  color: var(--ltg-muted);
  font-size: 15px;
}

.ltable-gift .ltg-icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------------ Boutons, liens, champs */

.ltable-gift .ltg-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  padding: 0 22px;
  border: 1px solid var(--ltg-accent);
  border-radius: var(--ltg-radius);
  background: var(--ltg-surface);
  box-shadow: none;
  color: var(--ltg-accent-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}

.ltable-gift .ltg-btn:hover {
  background: var(--ltg-surface-2);
}

.ltable-gift .ltg-btn-primary,
.ltable-gift .ltg-btn-offer {
  background: var(--ltg-accent);
  color: var(--ltg-on-accent);
}

.ltable-gift .ltg-btn-primary:hover,
.ltable-gift .ltg-btn-offer:hover {
  background: var(--ltg-accent);
  filter: brightness(0.9);
}

.ltable-gift .ltg-btn-offer {
  min-width: 100px;
  min-height: 44px;
  padding: 0 18px;
}

.ltable-gift .ltg-btn-quiet {
  border-color: var(--ltg-field-line);
  color: var(--ltg-ink);
}

.ltable-gift .ltg-btn-block {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
}

.ltable-gift .ltg-btn:disabled {
  opacity: 0.6;
  cursor: default;
  filter: none;
}

.ltg-btn-amount::before {
  content: '·';
  margin-right: 8px;
  opacity: 0.75;
}

.ltable-gift .ltg-link,
.ltable-gift .ltg-back,
.ltable-gift .ltg-disclose {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ltg-accent-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-transform: none;
  cursor: pointer;
}

.ltable-gift .ltg-back {
  margin: -8px 0 6px;
  color: var(--ltg-muted);
  text-decoration: none;
}

.ltable-gift .ltg-back:hover,
.ltable-gift .ltg-link:hover {
  color: var(--ltg-ink);
}

.ltable-gift :is(button, a, input, textarea, select, summary):focus-visible {
  outline: 2px solid var(--ltg-focus);
  outline-offset: 2px;
}

.ltg-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
  padding: 0;
  color: var(--ltg-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.ltg-optional {
  color: var(--ltg-muted);
  font-size: 15px;
  font-weight: 400;
}

.ltable-gift .ltg-input {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--ltg-field-line);
  border-radius: var(--ltg-radius);
  background: var(--ltg-field-bg);
  box-shadow: none;
  color: var(--ltg-ink);
  font: inherit;
  font-size: 17px;
  line-height: 1.4;
}

.ltable-gift textarea.ltg-input {
  min-height: 100px;
  resize: vertical;
}

.ltable-gift .ltg-input::placeholder {
  color: #77716a;
  opacity: 1;
}

.ltable-gift .ltg-input:focus {
  border-color: var(--ltg-accent);
  outline: 2px solid var(--ltg-focus);
  outline-offset: 0;
}

.ltable-gift .ltg-input[aria-invalid='true'] {
  border-color: var(--ltg-error);
}

.ltg-field {
  min-width: 0;
  margin: 0;
}

.ltg-form {
  display: grid;
  gap: 20px;
  margin: 0;
}

.ltg-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}

/* ------------------------------------------------------------------ Vitrine */

.ltg-intro {
  margin-bottom: 22px;
}

/* Vitrine : la carte offerte, et à côté le montant. */
.ltg-shop-main {
  display: grid;
  gap: 28px;
}

@container (min-width: 700px) {
  .ltg-shop-main {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(36px, 6cqi, 56px);
  }
}

.ltg-shop-main + .ltg-offers {
  margin-top: 30px;
}

.ltg-shop-side .ltg-intro {
  margin-bottom: 18px;
}

.ltg-pick {
  display: grid;
  gap: 16px;
}

.ltg-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 8px;
}

.ltable-gift .ltg-chip {
  min-height: 58px;
  padding: 0 6px;
  border: 1px solid var(--ltg-field-line);
  border-radius: var(--ltg-radius);
  background: var(--ltg-field-bg);
  color: var(--ltg-ink);
  font-family: var(--ltg-heading-font);
  font-size: 20px;
  font-weight: var(--ltg-heading-weight);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, transform 0.18s;
}

.ltable-gift .ltg-chip:hover {
  border-color: var(--ltg-accent);
}

.ltable-gift .ltg-chip:active {
  transform: scale(0.97);
}

.ltable-gift .ltg-chip[aria-pressed='true'] {
  border-color: var(--ltg-accent);
  background: var(--ltg-accent);
  color: var(--ltg-on-accent);
}

.ltable-gift .ltg-chip:focus-visible {
  outline: 2px solid var(--ltg-focus);
  outline-offset: 2px;
}

.ltg-other {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  gap: 0 16px;
}

.ltg-other .ltg-label {
  grid-column: 1;
  margin: 0;
}

.ltg-other .ltg-amount {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.ltg-other .ltg-hint {
  grid-column: 1;
  margin: 0;
}

.ltg-shop-price:empty {
  display: none;
}

.ltable-gift .ltg-offers {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ltg-line);
  list-style: none;
}

.ltable-gift .ltg-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 22px;
  margin: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--ltg-line);
}

.ltable-gift .ltg-offer::before {
  content: none;
}

.ltable-gift .ltg-offer-name {
  display: block;
  margin: 0;
  color: var(--ltg-ink);
  font-family: var(--ltg-heading-font);
  font-size: 19px;
  font-weight: var(--ltg-heading-weight);
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.ltg-offer-desc {
  margin-top: 4px !important;
  color: var(--ltg-muted);
  font-size: 16px;
}

.ltg-offer-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

/* Expérience décrite sur plusieurs lignes : prix et bouton restent à hauteur du nom. */
.ltable-gift .ltg-offer-item {
  align-items: start;
}

.ltg-price {
  white-space: nowrap;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.ltg-price-old {
  margin-right: 2px;
  color: var(--ltg-muted);
  font-size: 16px;
}

.ltg-price-now {
  font-weight: 600;
}

.ltable-gift .ltg-disclose {
  margin: 0 0 -8px;
  font-size: 15px;
}

.ltg-chevron {
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.ltg-disclose[aria-expanded='true'] .ltg-chevron {
  margin-top: 3px;
  transform: rotate(225deg);
}

.ltg-terms {
  margin: 8px 0 0 !important;
  padding: 10px 14px;
  border-left: 2px solid var(--ltg-accent);
  background: var(--ltg-surface-2);
  color: var(--ltg-muted);
  font-size: 15px;
  white-space: pre-line;
}

.ltg-amount {
  position: relative;
  display: block;
  width: 130px;
}

.ltable-gift .ltg-amount .ltg-input {
  padding-right: 34px;
  font-size: 18px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ltg-amount-unit {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--ltg-muted);
  font-weight: 600;
  transform: translateY(-50%);
  pointer-events: none;
}

.ltg-offer-error {
  grid-column: 1 / -1;
  margin: 0 !important;
}

/* Pied : message du restaurant, code promo, solde. */
.ltg-foot {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 24px 34px 22px;
  border-top: 1px solid var(--ltg-line);
  background: var(--ltg-surface-2);
  text-align: center;
}

.ltg-message {
  max-width: 46ch;
  font-size: 16px;
  white-space: pre-line;
}

.ltable-gift .ltg-promo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin: 0;
  text-align: left;
}

.ltg-promo .ltg-field-error {
  grid-column: 1 / -1;
}

.ltg-promo-ok {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
  color: var(--ltg-success);
  font-size: 16px;
}

.ltg-promo-ok p {
  color: var(--ltg-ink);
}

.ltg-promo-reason {
  display: block;
  color: var(--ltg-muted);
  font-size: 15px;
  font-weight: 400;
}

.ltg-promo-ok .ltg-promo-reason {
  display: inline;
  margin-left: 6px;
}

/* ------------------------------------------------------------------ Étapes */

.ltg-step {
  display: grid;
  gap: 22px;
}

/* Personnaliser : la carte reste à côté du formulaire dès que la place le permet. */
@container (min-width: 760px) {
  .ltg-at-personalize .ltg-step {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: start;
    column-gap: clamp(36px, 6cqi, 56px);
  }

  .ltg-at-personalize .ltg-topbar,
  .ltg-at-personalize .ltg-step-head {
    grid-column: 1 / -1;
  }

  .ltg-at-personalize .ltg-preview,
  .ltg-at-personalize .ltg-designs {
    grid-column: 1;
  }

  .ltg-at-personalize .ltg-form {
    grid-column: 2;
    grid-row: 3 / span 3;
  }
}

.ltg-dots ol {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ltg-dots li {
  display: block;
  margin: 0;
  padding: 0;
}

.ltg-dots li::before {
  content: none;
}

.ltg-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: min(50%, calc(var(--ltg-radius) * 100));
  background: var(--ltg-line);
  transition: width 0.25s, background-color 0.25s;
}

.ltg-dots .is-done .ltg-dot {
  background: var(--ltg-accent);
  opacity: 0.45;
}

.ltg-dots .is-current .ltg-dot {
  width: 28px;
  border-radius: min(4px, var(--ltg-radius));
  background: var(--ltg-accent);
}

.ltg-step-head {
  display: grid;
  justify-items: start;
}

/* Haut d'une étape, sur une ligne : « Retour » à gauche, les étapes à droite (à droite aussi quand elles sont seules). */
.ltg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-self: stretch;
  gap: 16px;
}

.ltg-topbar .ltg-dots {
  margin-left: auto;
}

/* Zone de clic de 44 px gardée, sans creuser la barre. */
.ltable-gift .ltg-topbar .ltg-back {
  margin: -8px 0;
}

/* Choix exclusifs : boutons radio natifs présentés en segments. */
.ltg-seg {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ltg-seg-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
  gap: 8px;
}

.ltable-gift .ltg-seg-option {
  position: relative;
  display: block;
  margin: 0;
  padding: 0;
  font-weight: inherit;
  cursor: pointer;
}

.ltable-gift .ltg-seg-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ltg-seg-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--ltg-field-line);
  border-radius: var(--ltg-radius);
  background: var(--ltg-field-bg);
  color: var(--ltg-ink);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.ltg-seg-option:hover span {
  border-color: var(--ltg-accent);
}

.ltg-seg-option input:checked + span {
  border-color: var(--ltg-accent);
  background: var(--ltg-surface-2);
  background: color-mix(in srgb, var(--ltg-accent) 9%, var(--ltg-field-bg));
  box-shadow: inset 0 0 0 1px var(--ltg-accent);
  color: var(--ltg-accent-ink);
}

.ltg-seg-option input:focus-visible + span {
  outline: 2px solid var(--ltg-focus);
  outline-offset: 2px;
}

.ltg-seg-small .ltg-seg-option span {
  min-height: 44px;
  font-size: 15px;
}

/* Aide d'une ligne sous un choix (Livraison : ce que l'on reçoit) : un peu plus petite sur les téléphones les plus
   étroits (320 px), pour rester sur une ligne. */
.ltg-form .ltg-hint.ltg-seg-hint {
  margin-bottom: 0;
  font-size: min(13.5px, 4.3cqi);
}

/* Quantité */
.ltg-qty {
  display: grid;
  justify-items: start;
}

.ltg-stepper {
  display: inline-grid;
  grid-template-columns: 48px 72px 48px;
  overflow: hidden;
  border: 1px solid var(--ltg-field-line);
  border-radius: var(--ltg-radius);
  background: var(--ltg-field-bg);
}

.ltable-gift .ltg-step-btn {
  appearance: none;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ltg-ink);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ltable-gift .ltg-step-btn:hover:not(:disabled) {
  background: var(--ltg-surface-2);
}

.ltable-gift .ltg-step-btn:disabled {
  color: var(--ltg-line);
  cursor: default;
}

.ltable-gift .ltg-stepper .ltg-input {
  min-height: 48px;
  padding: 0 4px;
  border-width: 0 1px;
  border-color: var(--ltg-line);
  border-radius: 0;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.ltg-stepper .ltg-input::-webkit-inner-spin-button,
.ltg-stepper .ltg-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Aides du formulaire en plus petit : elles accompagnent les champs sans leur prendre la vedette. */
.ltg-form .ltg-hint {
  font-size: 13.5px;
  line-height: 1.45;
}

/* Aide placée entre l'étiquette et son champ : l'étiquette a déjà son espace au-dessus. */
.ltg-hint.ltg-hint-above {
  margin: 0 0 8px !important;
}

.ltg-counter {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ltable-gift .ltg-when {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 12px;
}

.ltg-delivery-hint {
  margin-top: -6px !important;
}

/* ------------------------------------------------------------------ Aperçu de la carte */

.ltg-preview {
  position: relative;
  margin: 0;
  container-type: inline-size;
}

.ltg-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1.6;
  padding: 7% 7.5%;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--ltg-card-radius);
  background-color: var(--ltg-card-bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 20px 44px -16px rgb(0 0 0 / 0.42), 0 2px 6px rgb(0 0 0 / 0.12);
  color: var(--ltg-card-ink);
  transition: background-color 0.3s;
}

.ltg-card-photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(0 0 0 / 0.42) 0%, rgb(0 0 0 / 0.04) 28%, rgb(0 0 0 / 0.2) 48%, rgb(0 0 0 / 0.82) 100%);
}

/* Texte sur photo : toujours lisible, quelle que soit l'image. */
.ltg-card-photo .ltg-card-top,
.ltg-card-photo .ltg-card-bottom {
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 2px 18px rgb(0 0 0 / 0.35);
}

.ltg-card-frame {
  position: absolute;
  inset: 3.2cqi;
  border: 1px solid rgb(255 255 255 / 0.32);
  border: 1px solid color-mix(in srgb, var(--ltg-card-ink) 34%, transparent);
  border-radius: calc(var(--ltg-card-radius) * 0.6);
  pointer-events: none;
}

.ltg-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(11px, 2.9cqi, 14px);
  font-weight: 600;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.ltg-card-venue {
  font-weight: 600;
  text-align: right;
}

.ltg-card-bottom {
  display: grid;
  gap: 2px;
  max-width: 84%;
}

.ltg-card-value {
  color: var(--ltg-card-accent);
  font-family: var(--ltg-heading-font);
  font-size: clamp(34px, 11.5cqi, 60px);
  font-weight: var(--ltg-card-weight, 500);
  line-height: 1.05;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.ltg-card-value.is-item {
  font-size: clamp(22px, 6.6cqi, 36px);
  line-height: 1.15;
}

.ltg-card-for {
  margin-top: 8px;
  font-size: clamp(15px, 4.2cqi, 20px);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ltg-card-from {
  font-size: clamp(13px, 3.5cqi, 17px);
  opacity: 0.88;
  overflow-wrap: anywhere;
}

/* Phrase sous le montant (réglage du restaurant). */
.ltg-card-tagline {
  font-family: var(--ltg-heading-font);
  font-size: clamp(15px, 4.6cqi, 24px);
  font-style: italic;
  font-weight: var(--ltg-heading-weight, 400);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Fond de carte : l'image couvre la carte, sans voile ni cadre. Le texte tient à gauche,
   l'emblème du fond reste dégagé à droite ; le nom du restaurant passe en pied. */
.ltg-card-art .ltg-card-frame,
.ltg-card-art .ltg-card-venue {
  display: none;
}

.ltg-card-art .ltg-card-top {
  justify-content: flex-start;
}

.ltg-card-art .ltg-card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.ltg-card-art .ltg-card-eyebrow::before {
  content: '';
  width: 2.2em;
  height: 1px;
  background: currentColor;
}

.ltg-card-art .ltg-card-bottom {
  max-width: 58%;
}

/* Le pied passe sous l'emblème : il peut s'étendre. */
.ltg-card-place {
  max-width: 84%;
}

.ltg-card-art .ltg-card-value {
  font-weight: var(--ltg-heading-weight, 400);
}

.ltg-card-art .ltg-card-for {
  margin-top: 10px;
  font-size: clamp(13px, 3.6cqi, 17px);
}

.ltg-card-place {
  font-size: clamp(10px, 2.6cqi, 13px);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ltg-card-qty {
  position: absolute;
  right: 7.5%;
  bottom: 7%;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: var(--ltg-radius);
  font-size: clamp(13px, 3.4cqi, 16px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ltg-note {
  position: relative;
  margin: -16px 5% 0;
  padding: 30px 22px 16px;
  border: 1px solid var(--ltg-line);
  border-top: 0;
  border-radius: 0 0 var(--ltg-radius) var(--ltg-radius);
  background: var(--ltg-surface-2);
  color: var(--ltg-ink);
  font-size: 17px;
  font-style: italic;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.ltg-note::before {
  content: '«\00a0';
}

.ltg-note::after {
  content: '\00a0»';
}

/* Designs : carrousel d'une rangée. Sur téléphone, environ trois designs et demi : celui qui dépasse montre qu'il y en a
   d'autres. Vignettes au format d'une carte bancaire. Flèches seulement quand la rangée déborde (classe posée par le script). */
.ltg-designs {
  min-width: 0;
  margin: -6px 0 0;
  padding: 0;
  border: 0;
}

.ltg-designs-list {
  position: relative;
  display: flex;
  gap: 12px;
  margin: 0 -6px;
  padding: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6px;
  scrollbar-width: none;
}

.ltg-designs-list::-webkit-scrollbar {
  display: none;
}

.ltable-gift .ltg-design {
  position: relative;
  display: grid;
  flex: 0 0 clamp(78px, calc((100% - 36px) / 3.4), 128px);
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  font-weight: inherit;
  cursor: pointer;
  scroll-snap-align: start;
}

.ltable-gift .ltg-design input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ltg-design .ltg-swatch {
  width: 100%;
  height: auto;
  aspect-ratio: 85.6 / 54;
}

/* Sur deux colonnes, les vignettes gardent leur taille d'avant : quatre designs tiennent sans défiler. */
@container (min-width: 760px) {
  .ltable-gift .ltg-at-personalize .ltg-design {
    flex-basis: 78px;
  }
}

/* Titre « Design » et flèches sur la même ligne ; les marges négatives gardent la hauteur de la ligne, avec ou sans flèches. */
.ltg-designs-head {
  width: 100%;
}

.ltg-designs-nav {
  display: none;
  gap: 8px;
  margin: -8px 0;
}

.ltg-designs.has-more .ltg-designs-nav {
  display: flex;
}

.ltable-gift .ltg-designs-arrow {
  appearance: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ltg-field-line);
  border-radius: 50%;
  background: var(--ltg-field-bg);
  box-shadow: none;
  color: var(--ltg-ink);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, opacity 0.15s;
}

.ltable-gift .ltg-designs-arrow:hover:not(:disabled) {
  border-color: var(--ltg-accent);
  color: var(--ltg-accent-ink);
}

.ltable-gift .ltg-designs-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.ltable-gift .ltg-designs-arrow .ltg-icon {
  width: 18px;
  height: 18px;
}

.ltg-swatch {
  position: relative;
  display: block;
  width: 78px;
  height: 50px;
  border-radius: calc(var(--ltg-radius) * 0.8);
  background-color: var(--ltg-card-bg);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
}

.ltg-swatch:not(.is-photo)::after {
  content: '';
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 18px;
  height: 4px;
  border-radius: min(2px, var(--ltg-radius));
  background: var(--ltg-card-accent);
}

.ltg-design input:checked + .ltg-swatch {
  outline: 2px solid var(--ltg-accent-ink);
  outline-offset: 3px;
}

.ltg-design input:focus-visible + .ltg-swatch {
  outline: 3px solid var(--ltg-focus);
  outline-offset: 3px;
}

.ltg-design-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--ltg-muted);
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ltg-design input:checked ~ .ltg-design-name {
  color: var(--ltg-ink);
  font-weight: 600;
}

/* Code promo à la personnalisation */
.ltg-promo-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--ltg-radius);
  background: var(--ltg-surface-2);
  color: var(--ltg-success);
  font-size: 16px;
}

.ltg-promo-line p {
  color: var(--ltg-ink);
}

.ltg-promo-line s,
.ltg-totals s {
  color: var(--ltg-muted);
  font-weight: 400;
}

.ltg-promo-line:not(:has(.ltg-icon)) {
  padding: 0;
  background: none;
}

/* ------------------------------------------------------------------ Paiement */

.ltg-summary {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--ltg-line);
  border-radius: var(--ltg-radius);
  background: var(--ltg-surface-2);
}

.ltg-summary-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.ltg-swatch-sm {
  width: 64px;
  height: 40px;
}

.ltg-summary-title {
  font-weight: 600;
  line-height: 1.3;
}

.ltg-summary-meta {
  color: var(--ltg-muted);
  font-size: 15px;
}

.ltable-gift .ltg-totals {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--ltg-line);
}

.ltg-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.ltable-gift .ltg-totals dt,
.ltable-gift .ltg-totals dd {
  margin: 0;
  padding: 0;
  font-weight: inherit;
}

.ltg-totals dd {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ltg-total-discount {
  color: var(--ltg-success);
}

.ltg-total {
  font-size: 19px;
  font-weight: 600;
}

.ltg-total s {
  font-size: 16px;
}

.ltg-summary .ltg-promo {
  max-width: none;
}

.ltg-stripe {
  display: grid;
  gap: 14px;
}

.ltg-element {
  min-height: 120px;
}

.ltg-element-loading {
  padding: 40px 0;
  text-align: center;
}

.ltg-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ltg-muted);
  font-size: 15px;
}

.ltg-or::before,
.ltg-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ltg-line);
}

.ltg-pay-status:empty {
  display: none;
}

.ltg-secure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--ltg-muted);
  font-size: 15px;
  text-align: center;
}

.ltg-secure a {
  color: inherit;
}

/* Paiement en ligne pas encore ouvert (pas de clé Stripe) : un encadré clair, puis l'appel au restaurant. */
.ltg-notice {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-left: 3px solid var(--ltg-accent);
  border-radius: var(--ltg-radius);
  background: var(--ltg-surface-2);
}

.ltg-notice-title {
  font-family: var(--ltg-heading-font);
  font-weight: var(--ltg-heading-weight);
  font-size: 1.05em;
}

.ltable-gift .ltg-pay-off-back {
  justify-self: center;
}

/* Bouton « Appeler le … » : peut passer sur deux lignes (beaucoup de thèmes interdisent la coupure des liens tel:). */
.ltable-gift .ltg-pay-off .ltg-btn {
  padding-block: 10px;
  line-height: 1.35;
  white-space: normal;
}

.ltg-test {
  padding: 8px 12px;
  border: 1px dashed #b7791f;
  border-radius: var(--ltg-radius);
  color: #7a4b0b;
  font-size: 15px;
  text-align: center;
}

.ltg-cgv {
  color: var(--ltg-muted);
  font-size: 15px;
}

.ltg-cgv summary {
  min-height: 44px;
  padding: 10px 0;
  color: var(--ltg-ink);
  font-weight: 600;
  cursor: pointer;
}

.ltg-cgv p {
  white-space: pre-line;
}

/* ------------------------------------------------------------------ Confirmation */

.ltg-done {
  justify-items: center;
  text-align: center;
}

.ltg-done-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: min(50%, calc(var(--ltg-radius) * 100));
  background: var(--ltg-accent);
  color: var(--ltg-on-accent);
}

.ltable-gift .ltg-done-mark .ltg-icon {
  width: 30px;
  height: 30px;
  stroke-width: 2;
}

.ltg-done-text {
  max-width: 46ch;
}

.ltable-gift .ltg-tickets {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.ltable-gift .ltg-ticket {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--ltg-field-line);
  border-radius: var(--ltg-radius);
  background: var(--ltg-surface);
}

.ltable-gift .ltg-ticket::before {
  content: none;
}

.ltable-gift .ltg-ticket-qr {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0;
  background: #fff;
  image-rendering: pixelated;
}

.ltg-ticket-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ltg-ticket-value {
  font-family: var(--ltg-heading-font);
  font-size: 20px;
  font-weight: var(--ltg-heading-weight);
  line-height: 1.25;
}

.ltg-ticket-label {
  margin-top: 6px;
  color: var(--ltg-muted);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ltg-ticket-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.ltg-ticket-meta {
  color: var(--ltg-muted);
  font-size: 15px;
}

.ltg-ticket .ltg-link {
  justify-self: start;
  min-height: 36px;
  font-size: 15px;
}

.ltg-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ltg-order {
  font-size: 15px;
}

/* Solde */
.ltable-gift .ltg-input-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ltg-balance-result {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px;
  border-radius: var(--ltg-radius);
  background: var(--ltg-surface-2);
  text-align: center;
}

.ltg-balance-value {
  font-family: var(--ltg-heading-font);
  font-size: 34px;
  font-weight: var(--ltg-heading-weight);
  line-height: 1.1;
}

/* ------------------------------------------------------------------ Téléphone */

@media (max-width: 560px) {
  .ltg-body {
    padding: 24px 18px 26px;
  }

  .ltg-pad {
    padding: 20px 18px;
  }

  .ltg-foot {
    padding: 22px 18px 20px;
  }

  .ltable-gift .ltg-title {
    font-size: 24px;
  }

  .ltg-hero {
    aspect-ratio: 16 / 9;
  }

  .ltable-gift .ltg-logo {
    max-width: 160px;
    max-height: 46px;
  }

  .ltable-gift .ltg-offer {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .ltg-offer-side {
    justify-content: space-between;
  }

  .ltg-amount {
    flex: 1;
    width: auto;
  }

  .ltg-summary-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ltg-summary-head .ltg-link {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 36px;
  }

  .ltable-gift .ltg-ticket {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 14px;
  }

  .ltable-gift .ltg-ticket-qr {
    width: 80px;
    height: 80px;
  }

  .ltg-actions {
    display: grid;
    justify-content: stretch;
    width: 100%;
  }

  .ltable-gift .ltg-actions .ltg-btn {
    width: 100%;
  }

  .ltg-ticket-code {
    font-size: 17px;
    letter-spacing: 0.03em;
  }

  /* Deux choix côte à côte sur téléphone : le texte suffit. */
  .ltg-seg-option .ltg-icon {
    display: none;
  }

  .ltg-seg-option span {
    padding: 8px 10px;
    font-size: 15px;
  }

  .ltable-gift .ltg-when .ltg-input {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ltable-gift *,
  .ltable-gift *::before,
  .ltable-gift *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .ltg-hero,
  .ltg-foot {
    display: none;
  }
}
