/* ============================================================
   gift-pay.css — Gift payment flow (3 steps)
   ============================================================ */

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background: var(--paper);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 60px;
  overflow-x: hidden;
}

/* ── Top bar ───────────────────────────────────── */
.gp-topbar {
  width: 100%;
  max-width: 480px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}
.gp-back {
  font-size: 12px;
  color: var(--terracotta);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.04em;
}
.gp-back:hover { text-decoration: underline; }
.gp-topbar-mark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 13px;
  color: var(--ink-mute);
  flex: 1;
  text-align: right;
  letter-spacing: 0.01em;
}

/* ── Contenedor principal ──────────────────────── */
.gp-container {
  width: 100%;
  max-width: 480px;
  padding: 0 20px;
}

/* ── Resumen del regalo ────────────────────────── */
.gp-gift-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--hairline);
}
.gp-gift-swatch {
  width: 46px;
  height: 46px;
  border-radius: 5px;
  flex-shrink: 0;
  background: var(--terracotta);
  color: white;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 18px;
}
.gp-gift-summary-copy {
  min-width: 0;
}
.gp-gift-swatch.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gp-gift-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 16px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.gp-gift-price {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 3px;
  letter-spacing: 0.03em;
}

/* ── Step indicator ────────────────────────────── */
.gp-steps {
  display: flex;
  align-items: center;
  padding: 14px 0 2px;
}
.gp-step-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
  font-family: var(--sans);
}
.gp-step-dot.done    { background: var(--terracotta); color: white; }
.gp-step-dot.active  { background: var(--ink); color: white; }
.gp-step-dot.pending { background: var(--line); color: var(--ink-mute); }
.gp-step-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.gp-step-line.done { background: var(--terracotta); }

/* ── Cuerpo de cada paso ───────────────────────── */
.gp-step-body {
  padding: 22px 0 8px;
}

/* Paso 1 — código */
.gp-step-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 7px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.gp-step-sub {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.55;
  margin-bottom: 18px;
}
.gp-code-wrap {
  background: white;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.gp-code-wrap:focus-within { border-color: var(--terracotta); }
.gp-code-wrap.error { border-color: #c0392b; }
.gp-code-input {
  flex: 1;
  padding: 13px 16px;
  font-size: 18px;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--sans);
  text-transform: uppercase;
}
.gp-code-paste {
  padding: 10px 14px;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  background: var(--bone);
  border: none;
  border-left: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s;
}
.gp-code-paste:hover { background: var(--cream); }
.gp-code-error {
  font-size: 11px;
  color: #c0392b;
  margin-bottom: 14px;
  display: none;
}
.gp-code-error.visible { display: block; }
.gp-code-hint {
  font-size: 10px;
  color: var(--ink-mute);
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.gp-code-hint::before {
  content: "";
  display: block;
  width: 16px;
  height: 1px;
  background: var(--line);
  flex-shrink: 0;
}

/* Paso 2 — datos */
.gp-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.gp-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink);
  background: white;
  font-family: var(--sans);
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.gp-input:focus { border-color: var(--terracotta); }
.gp-input.error { border-color: #c0392b; }
.gp-field-error {
  font-size: 11px;
  color: #c0392b;
  line-height: 1.45;
  margin: -8px 0 14px;
  display: none;
}
.gp-field-error.visible { display: block; }
.gp-fixed-amount {
  font-family: "Fraunces", serif;
  font-size: 28px;
  letter-spacing: 0.01em;
  margin: 4px 0 12px;
}
.gp-fee-note {
  font-size: 11px;
  color: var(--ink-mute);
  margin-bottom: 18px;
  padding: 10px 14px;
  background: var(--bone);
  border-radius: 6px;
  line-height: 1.5;
  min-height: 0;
}
.gp-fee-note:empty { display: none; }

/* Resumen del carrito */
.gp-cart-summary {
  width: 100%;
  min-width: 0;
  margin-bottom: 20px;
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}
.gp-cart-lines {
  min-width: 0;
}
.gp-cart-line {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}
.gp-cart-line-copy {
  min-width: 0;
}
.gp-cart-line-title {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.gp-cart-line-meta {
  color: var(--ink-mute);
  font-size: 10px;
  margin-top: 3px;
}
.gp-cart-line-subtotal {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}
.gp-cart-breakdown {
  min-width: 0;
  padding: 11px 14px 13px;
  background: var(--bone);
}
.gp-cart-breakdown-row,
.gp-cart-total {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 1.45;
}
.gp-cart-breakdown-row span:last-child {
  color: var(--ink);
  flex-shrink: 0;
}
.gp-cart-total {
  overflow-wrap: anywhere;
  color: var(--ink);
  border-top: 1px solid var(--line);
  margin-top: 9px;
  padding-top: 10px;
  font-family: var(--serif);
  font-size: 16px;
}
.gp-cart-total .gp-fixed-amount {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Resumen de pago */
.gp-bank-box {
  background: white;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.gp-bank-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 13px;
  gap: 12px;
}
.gp-bank-row:last-child { border-bottom: none; }
.gp-bank-key { color: var(--ink-mute); flex-shrink: 0; }
.gp-bank-val { color: var(--ink); font-weight: 500; text-align: right; }
.gp-cart-line-compact {
  margin: 0;
  padding: 9px 0;
}
.gp-thanks {
  text-align: center;
  padding: 8px 0 20px;
}
.gp-thanks-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  margin: 0 auto 12px;
}
.gp-thanks-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 6px;
}
.gp-thanks-sub {
  font-size: 12px;
  color: var(--ink-mute);
  line-height: 1.6;
}

/* ── CTA principal ─────────────────────────────── */
.gp-cta {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s;
  margin-top: 8px;
}
.gp-cta:hover   { background: var(--terracotta); }
.gp-cta:disabled { opacity: 0.5; cursor: not-allowed; }
.gp-cta.terracotta { background: var(--terracotta); }
.gp-cta.terracotta:hover { background: var(--sage-deep); }
.gp-link-cta {
  text-align: center;
  text-decoration: none;
}

/* ── Mobile: one-handed checkout layout ───────── */
@media (max-width: 430px) {
  body {
    padding-bottom: max(34px, env(safe-area-inset-bottom));
  }

  .gp-topbar {
    padding: 12px 16px 10px;
  }

  .gp-container {
    padding: 0 16px;
  }

  .gp-gift-summary {
    gap: 12px;
    padding: 14px 0;
  }

  .gp-gift-swatch {
    width: 42px;
    height: 42px;
  }

  .gp-gift-name {
    font-size: 15px;
    line-height: 1.15;
  }

  .gp-gift-price {
    font-size: 11px;
  }

  .gp-steps {
    padding: 12px 0 0;
  }

  .gp-step-body {
    padding: 18px 0 6px;
  }

  .gp-step-title {
    font-size: 21px;
  }

  .gp-step-sub {
    margin-bottom: 16px;
  }

  .gp-code-input {
    min-width: 0;
    padding: 12px 13px;
    font-size: 16px;
    letter-spacing: 0.16em;
  }

  .gp-code-paste {
    padding: 10px;
    font-size: 8px;
  }

  .gp-input {
    padding: 11px 13px;
  }

  .gp-fee-note {
    padding: 9px 12px;
  }

  .gp-cart-line {
    gap: 9px;
    padding: 11px 12px;
  }

  .gp-cart-breakdown {
    padding: 10px 12px 12px;
  }

  .gp-cart-total .gp-fixed-amount {
    font-size: 22px;
  }

  .gp-bank-box {
    padding: 15px 16px;
  }

  .gp-bank-row {
    font-size: 12px;
    gap: 10px;
  }

  .gp-bank-key {
    min-width: 0;
  }

  .gp-bank-val {
    max-width: 52%;
    overflow-wrap: anywhere;
  }

  .gp-thanks-icon {
    width: 44px;
    height: 44px;
  }

  .gp-thanks-title {
    font-size: 21px;
  }

  .gp-cta {
    padding: 14px 12px;
    font-size: 10px;
    letter-spacing: 0.14em;
  }
}

@media (max-width: 350px) {
  .gp-topbar,
  .gp-container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .gp-cart-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .gp-cart-line-subtotal {
    text-align: left;
  }

  .gp-cart-breakdown-row,
  .gp-cart-total {
    gap: 8px;
  }

  .gp-cart-total .gp-fixed-amount {
    font-size: 20px;
  }
}
