/* TOQUIA Cinematic — Scene 03 · Fidelización (how a visit becomes a reward). */

.loyalty-steps {
  display: grid;
  gap: .25rem;
  margin-top: var(--space-xs);
  counter-reset: step;
}
.loyalty-steps li {
  counter-increment: step;
  position: relative;
  display: grid;
  gap: .15rem;
  padding: .7rem .9rem .7rem 3rem;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background .4s var(--ease-out), border-color .4s, opacity .4s;
}
.loyalty-steps li::before {
  content: counter(step);
  position: absolute;
  left: .9rem;
  top: .72rem;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  color: var(--tq-cream);
  background: var(--tq-emerald);
  box-shadow: 0 0 0 3px rgba(250,247,240,.6);
}
.loyalty-steps b { font-weight: 600; }
.loyalty-steps span { font-size: var(--fs-small); color: var(--ink-muted); }
.is-animated .loyalty-steps li { opacity: .62; }
.is-animated .loyalty-steps li.is-on {
  opacity: 1;
  background: var(--tq-cream);
  border-color: rgba(122,92,42,.22);
  box-shadow: var(--shadow-soft);
}
.fine-print { font-size: .78rem; color: var(--ink-muted); max-width: 36rem; }

/* ── Stage ─────────────────────────────────────────── */
.loyalty-stage {
  aspect-ratio: auto;
  min-height: 520px;
  display: grid;
  place-items: center;
  perspective: 1300px;
}
.loy-card {
  position: relative;
  z-index: 2;
  width: min(380px, 80%);
  margin: 6% 0 0 14%;
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-14deg);
}
.loy-nfc {
  position: absolute;
  left: 0;
  top: 4%;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: .5rem;
  width: min(150px, 32%);
  aspect-ratio: 1 / 1.1;
  padding: 1rem .8rem;
  border-radius: 22px;
  --accent: var(--tq-emerald-glow);
  background: linear-gradient(150deg, #262a26, #111412 70%);
  border: 1px solid rgba(197,164,109,.5);
  box-shadow: 0 24px 40px -20px rgba(0,0,0,.7);
  transform: rotate(-8deg) translateZ(-40px);
  color: var(--tq-gold);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
}
.loy-nfc img { width: 46%; height: auto; border-radius: 12px; }
.loy-waves { position: relative; width: 38px; height: 22px; }
.loy-waves i {
  position: absolute;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  border: 2px solid var(--accent);
  border-bottom: 0;
  border-left-color: transparent;
  border-right-color: transparent;
  border-radius: 50% 50% 0 0;
}
.loy-waves i:nth-child(1) { width: 12px; height: 7px; }
.loy-waves i:nth-child(2) { width: 24px; height: 14px; opacity: .7; }
.loy-waves i:nth-child(3) { width: 36px; height: 21px; opacity: .45; }
.loy-nfc.is-live .loy-waves i { animation: wave 1.4s var(--ease-out) infinite; }
.loy-nfc.is-live .loy-waves i:nth-child(2) { animation-delay: .15s; }
.loy-nfc.is-live .loy-waves i:nth-child(3) { animation-delay: .3s; }
@keyframes wave { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Scan beam: lives inside the pass's code box so it always sits on top of it (step 2) */
.loy-card .pass-code { position: relative; overflow: hidden; }
.loy-scan {
  position: absolute;
  z-index: 3;
  left: 4%;
  right: 4%;
  top: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px 4px rgba(var(--accent-rgb),.55);
  opacity: 0;
  pointer-events: none;
}
.loy-card .pass { box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 34px 50px -24px rgba(0,0,0,.7); }
.loy-card .pass .st-last.glow .st-c { stroke-width: 4; }

@media (max-width: 959px) {
  .loyalty-stage { min-height: 380px; margin-top: var(--space-sm); }
  .loy-card { margin: 12% 0 0 18%; width: min(330px, 76%); }
  .loy-nfc { left: 0; top: 0; width: min(120px, 30%); }
}

/* Phones (pinned): one step at a time, like a caption, so card and story fit one screen. */
@media (max-width: 767px) {
  #fidelizacion .lead { font-size: var(--fs-body); }
  .is-animated .loyalty-stage { min-height: 0; height: clamp(250px, calc(100svh - 500px), 420px); }
  .is-animated .loyalty-steps { position: relative; min-height: 5.4rem; }
  .is-animated .loyalty-steps li { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(8px); transition: opacity .3s var(--ease-out), transform .4s var(--ease-out); }
  .is-animated .loyalty-steps li.is-on { opacity: 1; transform: none; }
  .is-animated .loy-card { margin: 0 0 0 16%; width: min(250px, 66%); }
  .is-animated .loy-nfc { width: min(96px, 26%); }
}
@media (min-width: 960px) and (max-height: 780px) {
  .loyalty-stage { min-height: clamp(360px, calc(100svh - 280px), 520px); }
  .loyalty-steps li { padding-block: .45rem; }
  .loyalty-steps span { font-size: .78rem; }
}
@media (max-width: 767px) and (max-height: 700px) {
  .is-animated .loyalty-stage { height: clamp(170px, calc(100svh - 490px), 420px); }
  .is-animated .loy-card { width: min(140px, 40%); margin-left: 24%; }
  .is-animated .loy-nfc { width: min(76px, 22%); }
  .is-animated .loyalty-steps li span { font-size: .74rem; }
  #fidelizacion .lead { font-size: var(--fs-small); }
}
/* Very short phones (< 660 px): the scene scrolls instead of pinning; card back to a readable size. */
@media (max-width: 767px) {
  .is-unpinned .loy-card { width: min(210px, 58%) !important; }
  .is-unpinned .loy-nfc { width: min(84px, 24%) !important; }
}
