/* NutriLoPets — panel de pago (asistente de 3 pasos) y página de pasos tras el pago.
   Se carga después de styles.css: lo que está aquí afina o reemplaza reglas del
   panel (barra fija abajo en los tres pasos, cantidad en una fila, resumen de
   errores sobre la barra, estado "¿ya pagaste?"). */

/* ---------- Entrada: sin toques mientras el panel abre ---------- */
.drawer.is-opening .drawer-panel,
.drawer.is-opening .drawer-backdrop { pointer-events: none; }

/* ---------- Estructura: el cuerpo es una columna, la barra queda pegada abajo ---------- */
.drawer-body {
  --dpad: 1.25rem;
  display: flex;
  flex-direction: column;
  padding: 1.25rem var(--dpad) 0;
  /* La barra fija no tapa el campo que recibe el foco ni el que se lleva al centro. */
  scroll-padding-top: 1rem;
  scroll-padding-bottom: calc(var(--bar-h, 6.5rem) + 1rem);
}
.drawer-body .wizard { flex: 1 0 auto; display: flex; flex-direction: column; }
.drawer-body .wizard-step:not([hidden]) { flex: 1 0 auto; display: flex; flex-direction: column; }
/* El espacio sobre la barra va como margen del elemento anterior: una barra sticky no puede entrar en el relleno de su contenedor. */
.drawer-body .wizard-step > :nth-last-child(2) { margin-bottom: 1.25rem; }
.wizard-step h3:focus { outline: none; }

.drawer-body .wizard-bar {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: auto calc(var(--dpad) * -1) 0;
  padding: 0.75rem var(--dpad) calc(0.75rem + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--cloud);
}
.drawer-body .wizard-bar .wizard-nav { position: static; margin: 0; padding: 0; border: 0; background: none; }
.wizard-bar .wizard-error { margin: 0 0 0.65rem; }
.wizard-bar #btn-pagar { margin-top: 0; }
.drawer-body .wizard-nav-end { margin: 0.75rem 0 0; padding: 0; }

/* ---------- Botón de cerrar: se ve de 36 a 44 px, pero el área táctil es siempre de 44 px (R-RSP-004) ---------- */
.drawer-x { position: relative; }
.drawer-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }

/* ---------- Progreso: texto oculto para lectores en vez de display:none ---------- */
.wizard-progress li { position: relative; }
@media (max-width: 560px) {
  .wizard-progress li:not(.is-active) em {
    display: inline;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* ---------- Pasos: títulos y líneas de apoyo ---------- */
.step-lead { margin-top: 0.25rem; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.field-hint { font-size: 0.875rem; line-height: 1.35; color: var(--muted); }
.pet-head .field-error { flex-basis: 100%; }

/* ---------- Paso 1: la cantidad es una fila que se abre ---------- */
.drawer-body .pets { margin-top: 0.9rem; gap: 0.75rem; }
.drawer-body .pets:empty { display: none; }
.more-pets, .incluye-det { margin-top: 0.75rem; border-radius: var(--r-lg); background: var(--page); }
.more-pets > summary, .incluye-det > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  min-height: 52px;
  padding: 0.6rem 1rem;
  list-style: none;
  cursor: pointer;
  border-radius: var(--r-lg);
  font-weight: 700;
  color: var(--green-800);
}
.more-pets > summary::-webkit-details-marker, .incluye-det > summary::-webkit-details-marker { display: none; }
.mp-q { grid-column: 1; }
.mp-now { grid-column: 1; font-size: 0.875rem; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-caret { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; grid-column: 2; grid-row: 1 / span 2; width: 1.1rem; height: 1.1rem; transition: transform 0.2s var(--ease); }
.incluye-det > summary .mp-caret { grid-row: 1; }
details[open] > summary .mp-caret { transform: rotate(180deg); }
.mp-body { padding: 0 1rem 1rem; }
.mp-body .choice { margin-top: 0; }
.mp-body .qty-precio { background: #fff; }
.incluye-det .incluye { padding: 0 1rem 1rem; }

/* ---------- Paso 3: ¿ya pagaste? y pago no disponible ---------- */
.pay-return { margin-top: 0.75rem; padding: 0.9rem 1rem; border-radius: var(--r-lg); background: var(--sol); color: var(--green-800); font-size: 0.93rem; line-height: 1.45; }
.pay-return-t { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; }
.pay-unavailable { margin-top: 0.9rem; padding: 0.75rem 1rem; border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-size: 0.93rem; font-weight: 600; }
.pay-unavailable a { color: inherit; }

/* ---------- Celular: encabezado y progreso más bajos para que los campos se vean ---------- */
@media (max-width: 700px) {
  .drawer-body { --dpad: 1rem; padding-top: 0.75rem; }
  .drawer-head { padding: 1rem 1rem 0.55rem; }
  .drawer-title { font-size: 1.05rem; line-height: 1.2; }
  .drawer-sub { line-height: 1.2; }
  .drawer-sub strong { font-size: 1.05rem; }
  .drawer-x { width: 2.5rem; height: 2.5rem; }
  .drawer-body .wizard-progress { margin-bottom: 0.7rem; }
  .wizard-progress .wp-dot { width: 1.75rem; height: 1.75rem; font-size: 0.8125rem; }
  .wizard-progress li { font-size: 0.875rem; gap: 0.45rem; }
  .drawer-body .wizard-step h3 { font-size: 1.25rem; line-height: 1.2; }
  .drawer-body .pets { margin-top: 0.7rem; }
  .pet-card { padding: 0.85rem 0.9rem 1rem; }
  .pet-head { gap: 0.4rem; }
  .drawer-body .field { margin-top: 0.75rem; gap: 0.3rem; }
  .drawer-body .field > span { font-size: 0.9rem; }
  .more-pets, .incluye-det { margin-top: 0.6rem; }
  .drawer-body .qty-cards { gap: 0.4rem; }
  .drawer-body .wizard-bar { padding-top: 0.6rem; }
  .drawer-body .consent { margin-top: 0.9rem; padding: 0.75rem 0.85rem; }
}
@media (max-width: 380px) {
  .drawer-body { --dpad: 0.85rem; }
  .pet-card { padding: 0.75rem 0.75rem 0.9rem; }
}

/* ---------- Página de pasos (gracias.html) ---------- */
.steps h2 { margin-bottom: 0.45rem; color: var(--green-800); font-size: 1.3rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.link-sutil { display: inline-block; margin-top: 0.15rem; color: var(--green-700); font-weight: 600; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0.6rem 0; min-height: 44px; }
.link-sutil:hover { color: var(--green-900); }
.wa-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 0.9rem; font-size: 0.95rem; color: var(--muted); }
.wa-copy strong { color: var(--green-800); font-size: 1.1rem; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.thanks-save { margin-top: 1.25rem; padding: 1rem 1.15rem; border-radius: var(--r-lg); background: var(--page); font-size: 0.95rem; color: var(--muted); }
.thanks-save .step-actions { margin-top: 0.6rem; }

/* Celular horizontal (poca altura): encabezado y progreso compactos para ver los campos. */
@media (max-height: 520px) {
  .drawer-head { padding: 0.45rem 1rem; }
  .drawer-title { display: none; }
  .drawer-x { width: 2.25rem; height: 2.25rem; }
  .drawer-body { padding-top: 0.5rem; }
  .drawer-body .wizard-progress { margin-bottom: 0.4rem; }
  .drawer-body .wizard-step h3 { font-size: 1.15rem; }
  .drawer-body .wizard-bar { padding-top: 0.45rem; padding-bottom: 0.45rem; }
  .drawer-body .wizard-bar .btn-lg { --h: 44px; }
}
