/* =============================================================================
 * ZIC Landing — Achat d'un billet NATIF (modal ztk-)
 * Accent billetterie #E11D48. Thème clair/sombre hérité du profil via --pp-*
 * (aucune media-query de thème dans ce fichier, comme le reste de la face shop).
 * ============================================================================= */

/* ---------- overlay + carte ---------- */
body.ztk-lock { overflow: hidden; }
.ztk-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: var(--pp-scrim, rgba(8, 4, 20, .62));
  display: flex; align-items: flex-start; justify-content: center;
  overflow: auto; padding: 7vh 16px 40px;
  backdrop-filter: blur(3px);
}
.ztk-card {
  width: 520px; max-width: 100%;
  background: var(--pp-card, #fff); color: var(--pp-text, #1F1340);
  border-radius: 18px;
  box-shadow: 0 24px 70px var(--pp-shadow, rgba(8, 4, 20, .45));
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* ---------- en-tête ---------- */
.ztk-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--pp-border, #f3f4f6);
}
.ztk-cover {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #be123c, #e11d48);
}
.ztk-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ztk-head-main { flex: 1; min-width: 0; }
.ztk-title {
  margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ztk-sub {
  margin: 3px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 12px; color: var(--pp-text-muted, #6b7280);
}
.ztk-close {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 9px; border: 1px solid var(--pp-border, #e9e7f3);
  background: var(--pp-bg-soft, #faf9ff); color: var(--pp-text-muted, #6b7280);
  font-size: 15px; cursor: pointer;
}

/* ---------- corps ---------- */
.ztk-body { padding: 18px 20px; }
.ztk-label {
  margin: 0 0 8px; font-size: 11px; font-weight: 700;
  letter-spacing: .4px; text-transform: uppercase;
  color: var(--pp-text-muted, #9ca3af);
}
.ztk-error {
  margin: 0 0 14px; padding: 10px 13px; border-radius: 10px;
  background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b;
  font-size: 13px;
}
.ztk-loading { margin: 0; font-size: 13px; color: var(--pp-text-muted, #6b7280); }

/* ---------- catégories ---------- */
.ztk-tiers { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 18px; }
.ztk-tier {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  min-height: 56px; padding: 12px 14px;
  border-radius: 12px; border: 1.5px solid var(--pp-border, #e9e7f3);
  background: var(--pp-bg-soft, #faf9ff); color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.ztk-tier.is-active { border-color: #e11d48; background: rgba(225, 29, 72, .06); }
.ztk-tier.is-soldout { opacity: .55; cursor: not-allowed; }
.ztk-tier.is-soldout .ztk-tier-label { text-decoration: line-through; }
.ztk-tier-label { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.ztk-tier-price {
  font-size: 14.5px; font-weight: 800;
  font-family: "Space Grotesk", inherit; font-variant-numeric: tabular-nums;
}
.ztk-tier-left {
  flex-basis: 100%; font-size: 11.5px; color: var(--pp-text-muted, #6b7280);
}
.ztk-tier-left.is-low { color: #e11d48; font-weight: 700; }

/* ---------- quantité ---------- */
.ztk-qty { display: flex; align-items: center; gap: 10px; }
.ztk-qty-btn {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--pp-border, #e9e7f3);
  background: var(--pp-card, #fff); color: inherit;
  font-size: 18px; cursor: pointer;
}
.ztk-qty-btn:disabled { opacity: .4; cursor: not-allowed; }
.ztk-qty-val {
  min-width: 38px; text-align: center;
  font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.ztk-qty-max { font-size: 11.5px; color: var(--pp-text-muted, #9ca3af); }

/* ---------- paiement ---------- */
.ztk-pay {
  padding: 14px 20px 18px; border-top: 1px solid var(--pp-border, #f3f4f6);
  background: var(--pp-card, #fff);
}
.ztk-pay-btn {
  width: 100%; padding: 14px 18px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #be123c, #e11d48); color: #fff;
  font-size: 14.5px; font-weight: 800; cursor: pointer;
}
.ztk-pay-btn:disabled {
  background: var(--pp-border, #e5e7eb); color: var(--pp-text-muted, #9ca3af);
  cursor: not-allowed;
}
.ztk-secure {
  margin: 8px 0 0; text-align: center;
  font-size: 11.5px; color: var(--pp-text-muted, #9ca3af);
}

/* ---------- attente / succès ---------- */
.ztk-status { text-align: center; padding: 30px 22px; }
.ztk-status h3, .ztk-status h4 { margin: 12px 0 6px; font-size: 18px; font-weight: 800; }
.ztk-status p { margin: 0 0 6px; font-size: 13px; color: var(--pp-text-muted, #6b7280); }
.ztk-spinner {
  display: inline-block; width: 26px; height: 26px;
  border: 3px solid rgba(225, 29, 72, .2); border-top-color: #e11d48;
  border-radius: 50%; animation: ztk-spin .8s linear infinite;
}
@keyframes ztk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ztk-spinner { animation: none; } }
.ztk-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: #e11d48; color: #fff; font-size: 28px; font-weight: 800;
}
.ztk-success-ev { font-weight: 700; color: var(--pp-text, #1F1340) !important; }

/* ---------- billets (QR) ---------- */
.ztk-seats {
  list-style: none; margin: 16px 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
  max-height: 46vh; overflow: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ztk-seat {
  padding: 12px; border-radius: 12px;
  border: 1px solid var(--pp-border, #e9e7f3); background: var(--pp-bg-soft, #faf9ff);
}
/* Deux lignes réservées : « Place 1/2 · Standard » tient parfois sur une ligne et
   « Place 2/2 · … » sur deux (le chiffre change la largeur au sous-pixel), ce qui
   décalait les QR d'une carte à l'autre. */
.ztk-seat-no {
  margin: 0 0 8px; font-size: 12px; font-weight: 700; line-height: 1.35;
  min-height: 2.7em; color: var(--pp-text, #1F1340) !important;
}
/* Fond blanc explicite : un QR sur fond sombre serait illisible au scan. */
.ztk-qr {
  width: 100%; max-width: 160px; height: auto; aspect-ratio: 1;
  background: #fff; border-radius: 8px; padding: 6px; box-sizing: border-box;
}
.ztk-seat-code {
  margin: 8px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap;
}
.ztk-seat-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; letter-spacing: .5px; user-select: all;
}
.ztk-copy {
  padding: 3px 9px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--pp-border, #e9e7f3);
  background: var(--pp-card, #fff); color: var(--pp-text-muted, #6b7280);
  font-size: 11px; font-weight: 700;
}

/* ---------- responsive ---------- */
@media (min-width: 600px) {
  .ztk-tiers { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 599.98px) {
  /* Plein écran mobile : 100dvh (la barre d'URL iOS fausse 100vh). */
  .ztk-overlay { padding: 0; }
  .ztk-card { width: 100%; min-height: 100dvh; border-radius: 0; }
  .ztk-head { position: sticky; top: 0; z-index: 2; background: var(--pp-card, #fff); }
  /* Le corps prend la place restante : sans ça la barre de paiement flotte au
     milieu de l'écran quand le contenu est court (sticky ne colle que si ça
     déborde), avec un grand vide en dessous. */
  .ztk-body { flex: 1 1 auto; }
  .ztk-pay {
    position: sticky; bottom: 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
  .ztk-seats { max-height: none; grid-template-columns: 1fr; }
  .ztk-qr { max-width: 200px; margin: 0 auto; display: block; }
}
