/* ==========================================================================
   Confirmación de reserva: desliza para enviar
   Adaptación del componente «Swipe to send» de UImaxxing al lenguaje de OXO.
   ========================================================================== */

.send-cta {
  --sct-fg: #ffffff;
  --sct-muted: rgb(255 255 255 / 0.45);
  --sct-soft: rgb(255 255 255 / 0.64);
  --sct-line: rgb(255 255 255 / 0.1);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #050505;
  color: var(--sct-fg);
  overflow: hidden;
  overscroll-behavior: contain;
  font-family: var(--font-b);
  -webkit-tap-highlight-color: transparent;
}

.send-cta[open] {
  display: grid;
  place-items: center;
}

.send-cta::backdrop {
  background: #000;
  overflow: hidden;
  overscroll-behavior: contain;
}

.send-cta-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  container-type: inline-size;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.send-cta-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- La confirmación ---------- */

.send-cta-pill {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(9cqw, env(safe-area-inset-top)) 6cqw max(6.5cqw, env(safe-area-inset-bottom));
  transform-origin: 50% 50%;
  will-change: opacity, transform;
}

.send-cta-kicker {
  margin: 0;
  padding: 0 46px;
  color: var(--sct-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  line-height: 1.4;
  text-align: center;
}

.send-cta-hero {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.send-cta-avatar {
  position: relative;
  display: block;
  width: clamp(48px, 14cqw, 64px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 50%;
  background: #0a0a0a;
  box-shadow: 0 0 0 6px rgb(255 255 255 / 0.03);
}

.send-cta-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.send-cta-to {
  margin: 12px 0 0;
  color: var(--sct-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.5;
  text-transform: uppercase;
}

.send-cta-to [data-name] {
  color: var(--sct-fg);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.send-cta-amount {
  display: flex;
  align-items: baseline;
  gap: 0.07em;
  margin: 4.5cqw 0 0;
  font-size: clamp(58px, 19cqw, 92px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.send-cta-amount small,
.send-cta-receipt-sum small {
  color: var(--sct-muted);
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0;
}

.send-cta-plan {
  margin: 2.2cqw 0 0;
  color: var(--sct-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* ---------- Los datos, como en una ficha ---------- */

.send-cta-rows {
  width: 100%;
  margin: 0;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.4;
}

.send-cta-rows > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--sct-line);
}

.send-cta-rows dt {
  flex: none;
  color: var(--sct-muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.send-cta-rows dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--sct-fg);
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- La pastilla que se desliza ---------- */

.send-cta-control {
  position: relative;
  width: 100%;
  flex: none;
  margin-top: 5cqw;
}

.send-cta-track {
  position: absolute;
  inset: -6px;
  display: block;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 999px;
  pointer-events: none;
}

.send-cta-hint {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  display: block;
  color: var(--sct-soft);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 16px;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}

.send-cta-btn {
  position: relative;
  display: flex;
  width: 100%;
  height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  cursor: grab;
  touch-action: none;
  will-change: transform, filter;
}

.send-cta-btn:active {
  cursor: grabbing;
}

.send-cta-btn:disabled {
  pointer-events: none;
}

.send-cta-btn:focus-visible,
.send-cta-next:focus-visible,
.send-cta-copy:focus-visible,
.send-cta-close:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.send-cta-arrow {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
}

.send-cta-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- La línea que se escribe ---------- */

.send-cta-word {
  position: absolute;
  top: 41.6%;
  left: 50%;
  z-index: 1;
  display: flex;
  color: var(--sct-fg);
  font-size: clamp(18px, 5.2cqw, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.send-cta-word span {
  display: block;
  opacity: 0;
}

/* ---------- El resguardo ---------- */

.send-cta-receipt {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(9cqw, env(safe-area-inset-top)) 6cqw max(9cqw, env(safe-area-inset-bottom));
  text-align: center;
  opacity: 0;
  pointer-events: none;
}

.send-cta[data-phase="sent"] .send-cta-receipt {
  pointer-events: auto;
}

.send-cta-receipt-brand {
  display: block;
  width: clamp(44px, 12cqw, 56px);
  aspect-ratio: 1;
  margin: 0 0 clamp(14px, 4cqw, 20px);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 50%;
  background: #0a0a0a;
  box-shadow: 0 0 0 6px rgb(255 255 255 / 0.03);
}

.send-cta-receipt-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.send-cta-mark {
  display: block;
  width: clamp(48px, 16cqw, 72px);
  height: clamp(48px, 16cqw, 72px);
  color: var(--blue-bright);
}

.send-cta-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.send-cta-receipt-sum {
  display: flex;
  align-items: baseline;
  gap: 0.07em;
  margin: 7cqw 0 0;
  font-size: clamp(46px, 14cqw, 72px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.send-cta-receipt-line {
  margin: 3.2cqw 0 0;
  color: var(--sct-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.6;
  text-transform: uppercase;
}

.send-cta-receipt-line [data-name] {
  display: block;
  margin-top: 2px;
  color: var(--sct-fg);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.send-cta-receipt-meta {
  margin: 8px 0 0;
  color: var(--sct-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.send-cta-receipt-meta + .send-cta-receipt-meta {
  margin-top: 2px;
}

.send-cta-pay {
  width: 100%;
  margin: 5.5cqw 0 0;
  padding: 12px 14px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.04);
  text-align: left;
}

.send-cta-pay-label {
  margin: 0;
  color: var(--sct-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

.send-cta-pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.send-cta-pay-number {
  margin: 0;
  font-size: clamp(24px, 7cqw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.send-cta-copy {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 999px;
  background: transparent;
  color: var(--sct-fg);
  font-family: inherit;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.send-cta-copy:hover {
  background: rgb(255 255 255 / 0.08);
}

.send-cta-pay-meta {
  margin: 8px 0 0;
  color: var(--sct-muted);
  font-size: 11px;
  line-height: 1.4;
}

.send-cta-pay-meta strong {
  color: var(--sct-fg);
}

.send-cta-pay-error {
  display: none;
  margin: 8px 0 0;
  color: #ff9a8a;
  font-size: 10px;
  line-height: 1.4;
}

.send-cta-pay-error:not(:empty) {
  display: block;
}

.send-cta-next {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin: 6cqw 0 0;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}

.send-cta-next:hover {
  filter: brightness(0.94);
}

.send-cta-next:disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* Desktop keeps the old route: the payment page does the Bizum step. */
.send-cta-pay-desktop,
.send-cta-fine-desktop {
  display: none;
}

.send-cta-fine {
  margin: 4.5cqw 0 0;
  color: var(--sct-muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* ---------- Cerrar ---------- */

.send-cta-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  z-index: 3;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.06);
  color: rgb(255 255 255 / 0.82);
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.send-cta-close:hover {
  background: rgb(255 255 255 / 0.12);
}

.send-cta-close svg {
  width: 16px;
  height: 16px;
}

.send-cta[data-phase="running"] .send-cta-close,
.send-cta[data-phase="sent"] .send-cta-close {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Pantallas grandes: la misma pantalla, enmarcada ---------- */

@media (pointer: fine) {
  .send-cta-pay,
  .send-cta-paid,
  .send-cta-fine-mobile {
    display: none;
  }

  .send-cta-pay-desktop {
    display: inline-flex;
    margin-top: 9cqw;
  }

  .send-cta-fine-desktop {
    display: block;
  }
}

@media (min-width: 680px) and (min-height: 680px) {
  .send-cta {
    background: #020202;
  }

  .send-cta-stage {
    width: min(444px, calc(100vw - 48px), calc((100dvh - 48px) * 444 / 784));
    height: auto;
    aspect-ratio: 444 / 784;
    border-radius: 28px;
    box-shadow: 0 40px 140px rgb(0 0 0 / 0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .send-cta-close {
    transition: none;
  }
}
