/* wizard.css - Estilos del checkout wizard de 3 pantallas */

.section-wizard {
  display: flex;
  flex-direction: column;
}

.screen-back-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--pad) 0;
}
.wizard-step-indicator {
  font-family: var(--font-ritual);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wizard-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-3) var(--pad) var(--sp-4); /* compactado para no-scroll */
  display: flex;
  flex-direction: column;
  gap: var(--sp-3); /* compactado para no-scroll (antes sp-4) */
}

.wizard-title {
  font-family: var(--font-ritual);
  font-size: var(--text-2xl);
  color: var(--color-text);
  margin: 0;
  line-height: 1.1;
}

.wizard-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--sp-2) 0;
  line-height: 1.5;
}

.wizard-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: -0.3rem;
  opacity: 0.85;
}

.wizard-hint {
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  font-style: italic;
  margin: 0;
}

.wizard-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-body);
}

/* ─── Map picker (wizard step 3 - pantalla dedicada) ──────────────────── */
.wiz-map {
  height: 280px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #1a0f00;
  overflow: hidden;
  position: relative;
  /* Fix para que Leaflet no muestre el control en blanco antes de cargar */
  z-index: 0;
}
/* Versión grande para pantalla dedicada del mapa */
.wiz-map--big {
  height: calc(100vh - 320px);
  min-height: 320px;
  max-height: 540px;
}

/* ─── Upsell modal (oferta espontánea pre-checkout) ───────────────────── */
.upsell-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: upsellIn 0.3s ease;
}
@keyframes upsellIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.upsell-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.upsell-stack {
  position: relative;
  max-width: 380px; width: 100%;
  display: flex; flex-direction: column; gap: 1rem;
  max-height: 90vh; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem;
}
.upsell-card {
  position: relative;
  background: #0a0510;
  border: 1px solid #f59e0b;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 380px; width: 100%;
  box-shadow: 0 20px 80px rgba(0,0,0,0.7), 0 0 40px rgba(245,158,11,0.15);
  animation: upsellCardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.upsell-card--multi { animation-fill-mode: backwards; }
.upsell-card--multi:nth-child(2) { animation-delay: 0.1s; }
.upsell-card--multi:nth-child(3) { animation-delay: 0.2s; }
.upsell-card--multi:nth-child(4) { animation-delay: 0.3s; }
.upsell-cascade-tag {
  position: absolute; top: -8px; right: 12px;
  background: #f59e0b; color: #0a0500;
  padding: 0.2rem 0.55rem; border-radius: 999px;
  font-size: 0.65rem; font-weight: 900; letter-spacing: 0.1em;
  font-family: Georgia, serif;
}
.upsell-skip-all {
  background: transparent; color: #7a5828;
  border: 1px solid #3a2800; border-radius: 8px;
  padding: 0.7rem; font-family: Georgia, serif;
  font-size: 0.75rem; letter-spacing: 0.15em;
  text-transform: uppercase; font-weight: 600;
  cursor: pointer; margin-top: 0.3rem;
}
.upsell-skip-all:active { opacity: 0.6; }
@keyframes upsellCardIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.upsell-badge {
  font-size: 0.65rem; letter-spacing: 0.2em;
  color: #f59e0b; text-align: center;
  background: rgba(245,158,11,0.1);
  padding: 0.35rem 0.7rem; border-radius: 999px;
  display: inline-block; margin: 0 auto 0.8rem;
  width: 100%; max-width: 100%;
}
.upsell-title {
  margin: 0 0 1rem; font-size: 1.05rem;
  color: #fff; text-align: center; font-weight: 700; line-height: 1.4;
}
.upsell-product {
  display: flex; gap: 1rem; align-items: center;
  background: #03010a; border-radius: 10px;
  padding: 0.9rem; margin-bottom: 1.2rem;
}
.upsell-product img {
  width: 70px; height: 70px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.upsell-emoji {
  width: 70px; height: 70px; border-radius: 8px; background: rgba(245,158,11,0.1);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0;
}
.upsell-info { flex: 1; }
.upsell-name {
  color: #f59e0b; font-weight: 700; font-size: 0.95rem; margin-bottom: 0.3rem;
}
.upsell-prices {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.upsell-original {
  text-decoration: line-through; color: #7a5828; font-size: 0.85rem;
}
.upsell-final {
  color: #2ecc71; font-weight: 900; font-size: 1.15rem;
}
.upsell-discount {
  background: rgba(46,204,113,0.15); color: #2ecc71;
  padding: 0.15rem 0.4rem; border-radius: 4px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
}
.upsell-actions { display: flex; gap: 0.6rem; }
.upsell-actions button {
  flex: 1; padding: 0.9rem; border-radius: 8px;
  font-family: Georgia, serif; font-weight: 900; letter-spacing: 0.15em;
  text-transform: uppercase; font-size: 0.75rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s;
}
.upsell-actions button:active { transform: scale(0.96); }
.upsell-skip {
  background: transparent; color: #7a5828; border: 1px solid #3a2800;
}
.upsell-add {
  background: #f59e0b; color: #0a0500; border: none;
}
/* Body del paso del mapa: menos padding para dar espacio al mapa */
.wizard-body--map {
  padding-bottom: var(--sp-3);
}
.wizard-body--map .wizard-sub {
  margin-bottom: var(--sp-3);
}
.wiz-coords {
  font-size: var(--text-xs);
  color: var(--color-amber);
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-sm);
  text-align: center;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.wiz-coords.has-pin {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
}
/* Override de algunos estilos de Leaflet que chocan con el tema */
.leaflet-container {
  background: #1a0f00 !important;
  font-family: var(--font-body) !important;
}
.leaflet-bar a,
.leaflet-bar a:hover {
  background: #0a0510 !important;
  color: #f59e0b !important;
  border-color: #2a1808 !important;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0a0510 !important;
  color: #f59e0b !important;
}

.wizard-error {
  margin: 0;
  padding: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-danger);
  background: rgba(204, 64, 48, 0.1);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  text-align: center;
}

/* Summary */
.wizard-summary {
  margin-top: var(--sp-2);
  padding: var(--sp-4);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.wizard-summary.final {
  border-color: var(--color-amber);
  background: linear-gradient(135deg, var(--color-card), rgba(240, 168, 85, 0.04));
}
.wizard-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.wizard-summary-row strong {
  color: var(--color-text);
  font-weight: 600;
}
.wizard-summary-row.total {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-md);
  color: var(--color-text);
}
.wizard-summary-row.total strong {
  font-family: var(--font-ritual);
  font-size: var(--text-lg);
  color: var(--color-amber);
}

/* Footer con CTA */
.wizard-footer {
  flex-shrink: 0;
  padding: var(--sp-3) var(--pad) var(--sp-4);
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  position: relative;
}
.wizard-footer::before {
  content: '';
  position: absolute;
  top: -36px; left: 0; right: 0;
  height: 36px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
}

/* Payment options */
.wizard-payment-options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.wizard-pay-option {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3); /* compactado para no-scroll (antes sp-4) */
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.wizard-pay-option:has(input:checked) {
  border-color: var(--color-amber);
  background: rgba(240, 168, 85, 0.06);
}
.wizard-pay-option:active { transform: scale(0.99); }
.wizard-pay-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--color-amber);
  margin: 0;
  flex-shrink: 0;
}
.wizard-pay-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}
.wizard-pay-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.wizard-pay-text strong {
  font-family: var(--font-body);
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: 600;
}
.wizard-pay-text small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* Bosque compact card (paso final "Confirmar y pagar") */
.wizard-bosque-compact {
  padding: var(--sp-3);
  background: linear-gradient(135deg, rgba(74,144,96,0.10), rgba(74,144,96,0.03));
  border: 1px solid rgba(74,144,96,0.30);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.wizard-bosque-compact-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.wizard-bosque-compact-header > span { font-size: 1.6rem; flex-shrink: 0; }
.wizard-bosque-compact-header strong { display: block; font-size: var(--text-sm); color: var(--color-success); font-weight: 700; }
.wizard-bosque-compact-header small  { font-size: var(--text-xs); color: var(--color-text-muted); }

/* Bosque sección */
.wizard-bosque {
  padding: var(--sp-5);
  background: linear-gradient(135deg, rgba(74, 144, 96, 0.08), rgba(74, 144, 96, 0.02));
  border: 1px solid rgba(74, 144, 96, 0.35);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
  margin-top: var(--sp-2);
}
.wizard-bosque-rune {
  font-size: 2.5rem;
  line-height: 1;
}
.wizard-bosque-title {
  font-family: var(--font-ritual);
  font-size: var(--text-lg);
  color: var(--color-success);
  margin: 0;
}
.wizard-bosque-msg {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}
.wizard-bosque-msg strong { color: var(--color-success); font-weight: 700; }
.wizard-bosque-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-4);
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-md);
}
.wizard-bosque-num {
  font-family: var(--font-ritual);
  font-size: var(--text-xl);
  color: var(--color-success);
  font-weight: 700;
  line-height: 1;
}
.wizard-bosque-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.wizard-bosque-amounts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
  width: 100%;
}
@media (min-width: 380px) {
  .wizard-bosque-amounts { grid-template-columns: repeat(4, 1fr); }
}
.wizard-donation-btn {
  padding: var(--sp-2) var(--sp-3);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  min-height: 40px;
}
.wizard-donation-btn:hover {
  border-color: var(--color-success);
  color: var(--color-success);
}
.wizard-donation-btn.selected {
  background: rgba(74, 144, 96, 0.2);
  border-color: var(--color-success);
  color: var(--color-success);
  font-weight: 700;
}
.wizard-donation-btn:active { transform: scale(0.96); }
