/* Pagar con SERO (/pagar-con-sero/): documentación de SERO Pay, tienda de demostración y
   teléfono simulado. Se apoya en main.css (papel, tinta y rojo SERO). */

.pg-hechos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 40px 0 0; max-width: 980px; }
.pg-hechos div { border-top: 1px solid var(--ink); padding-top: 16px; }
.pg-hechos dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--red-ink); }
.pg-hechos dd { margin: 8px 0 0; font-size: 18px; line-height: 1.5; color: var(--ink-soft); }

.pg-seccion { padding: 112px 0; }
.pg-seccion h2 { font-family: var(--serif-display); font-weight: 500; font-size: clamp(40px, 4.4vw, 64px); line-height: 1.04; letter-spacing: -.01em; margin: 10px 0 22px; max-width: 18em; }
.pg-seccion h2 em { font-style: italic; }
.pg-intro { max-width: 40em; font-size: 20px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 40px; }
.pg-detalle { max-width: 44em; font-size: 17.5px; line-height: 1.6; color: var(--ink-soft); margin: 14px 0 0; }
.pg-subtitulo { font-family: var(--serif-display); font-weight: 600; font-size: 28px; line-height: 1.2; margin: 56px 0 16px; }

code { font-family: var(--mono); font-size: .84em; padding: .08em .32em; border-radius: 4px; background: var(--paper-deep); overflow-wrap: anywhere; }
pre { position: relative; margin: 18px 0 0; padding: 22px 24px; max-width: 880px; overflow-x: auto; border-radius: 14px; background: var(--night); color: var(--night-text); font-size: 14.5px; line-height: 1.65; }
pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; white-space: pre; color: inherit; }
.pg-copiar { position: absolute; top: 10px; right: 10px; padding: 6px 12px; border: 1px solid #3a3a3c; border-radius: 999px; background: var(--night-soft); color: var(--night-muted); font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.pg-copiar:hover { color: var(--night-text); border-color: var(--night-muted); }

/* Pasos numerados */
.pg-pasos { list-style: none; counter-reset: paso; margin: 0; padding: 0; max-width: 920px; }
.pg-pasos > li { counter-increment: paso; position: relative; padding: 0 0 48px 72px; }
.pg-pasos > li::before { content: counter(paso); position: absolute; left: 0; top: -6px; font-family: var(--serif-display); font-size: 52px; line-height: 1; color: var(--red); }
.pg-pasos h3 { font-family: var(--serif-display); font-weight: 600; font-size: 30px; line-height: 1.15; margin: 0 0 10px; }
.pg-pasos p { margin: 0; max-width: 40em; font-size: 18px; color: var(--ink-soft); }
.pg-api { max-width: 920px; margin-top: 8px; padding: 32px 0 0 72px; border-top: 1px solid var(--rule); }
.pg-api h3 { font-family: var(--serif-display); font-weight: 600; font-size: 30px; margin: 0 0 10px; }
.pg-api p { margin: 0; max-width: 40em; font-size: 18px; color: var(--ink-soft); }

.pg-flujo { margin: 0; padding: 0 0 0 1.2em; max-width: 46em; }
.pg-flujo li { margin: 0 0 18px; padding-left: .4em; font-size: 19px; line-height: 1.6; color: var(--ink-soft); }
.pg-flujo li::marker { font-family: var(--serif-display); font-size: 1.3em; color: var(--red); }
.pg-flujo b { color: var(--ink); }
.pg-garantias { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 48px; }
.pg-garantias div { border-top: 1px solid var(--ink); padding-top: 18px; }
.pg-garantias h3 { font-family: var(--serif-display); font-weight: 600; font-size: 26px; margin: 0 0 8px; }
.pg-garantias p { margin: 0; font-size: 17.5px; color: var(--ink-soft); }
.pg-casos { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; }
@media (max-width: 1100px) { .pg-casos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pg-tabla { max-width: 980px; overflow-x: auto; }
.pg-tabla table { width: 100%; border-collapse: collapse; font-size: 16.5px; }
.pg-tabla th, .pg-tabla td { text-align: left; vertical-align: top; padding: 13px 14px; border-bottom: 1px solid var(--rule); }
.pg-tabla thead th { font-family: var(--mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--ink); }
.pg-tabla td:first-child { width: 32%; }
.pg-tabla td:first-child code { white-space: nowrap; }
.pg-lista { margin: 0; padding-left: 1.2em; max-width: 44em; font-size: 17.5px; color: var(--ink-soft); }
.pg-lista li { margin: 0 0 8px; }

/* Tienda de demostración */
.pg-tienda { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 0; max-width: 1040px; border: 1px solid var(--ink); background: #fbfaf6; }
.pg-tienda-cabeza { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 28px 32px; border-bottom: 1px solid var(--rule); }
.pg-tienda-nombre { margin: 0; font-family: var(--serif-display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.pg-tienda-lema { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.pg-tienda-aviso { margin: 0; flex: none; padding: 5px 12px; border: 1px solid var(--rule); border-radius: 999px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pg-productos { list-style: none; margin: 0; padding: 8px 32px; }
.pg-productos li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 18px 0; }
.pg-productos li + li { border-top: 1px solid var(--rule); }
.pg-productos b { display: block; font-size: 18px; }
.pg-productos span { display: block; font-size: 15.5px; color: var(--muted); }
.pg-precio { margin: 0; font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.pg-cantidad { display: inline-flex; align-items: center; border: 1px solid var(--rule); border-radius: 999px; }
.pg-cantidad button { width: 36px; height: 36px; border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--ink); }
.pg-cantidad button:hover { color: var(--red-ink); }
.pg-cantidad output { min-width: 22px; text-align: center; font-family: var(--mono); font-size: 14px; }
.pg-caja { padding: 28px 32px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.pg-total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; }
.pg-total span { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pg-total b { font-family: var(--serif-display); font-size: 38px; font-weight: 600; }
.pg-nota { margin: 0; font-size: 14.5px; color: var(--muted); text-align: center; }
.pg-club { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 32px; border-top: 1px solid var(--rule); background: var(--paper); }
.pg-club-nombre { font-size: 26px; }

/* Teléfono simulado: encima de la ventana de SERO Pay */
.pg-telefono { position: fixed; z-index: 2147483600; top: 50%; left: max(24px, calc(50% - 560px)); transform: translateY(-50%); animation: pg-entrar .36s cubic-bezier(.2, .8, .2, 1); }
.pg-telefono[hidden] { display: none; }
@keyframes pg-entrar { from { opacity: 0; transform: translate(-24px, -50%); } }
.pg-telefono-marco { width: 300px; height: 620px; padding: 12px; border-radius: 48px; background: #111; box-shadow: 0 40px 90px rgba(0, 0, 0, .45), inset 0 0 0 2px #2b2b2d; }
.pg-telefono-pantalla { position: relative; height: 100%; overflow: hidden; border-radius: 38px; background: linear-gradient(160deg, #2c3e50 0%, #4a2f3f 55%, #1b1b1d 100%); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #fff; }
.pg-telefono-hora { margin: 0; padding-top: 58px; text-align: center; font-size: 64px; font-weight: 300; letter-spacing: -.02em; }
.pg-notificacion { display: block; width: calc(100% - 20px); margin: 28px auto 0; padding: 12px 14px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #0b0b0c; text-align: left; font: inherit; cursor: pointer; animation: pg-notificar .5s cubic-bezier(.2, .8, .2, 1); }
.pg-notificacion.is-otra { animation: pg-sacudir .5s ease; }
@keyframes pg-notificar { from { opacity: 0; transform: translateY(-16px) scale(.96); } }
@keyframes pg-sacudir { 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
.pg-notificacion-app { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: rgba(11, 11, 12, .55); }
.pg-notificacion-app em { margin-left: auto; font-style: normal; font-weight: 500; letter-spacing: 0; }
.pg-notificacion-icono { width: 18px; height: 18px; border-radius: 5px; background: #0b0b0c radial-gradient(circle at 50% 56%, #fff 0 18%, transparent 19% 33%, #fff 34% 44%, transparent 45%); }
.pg-notificacion b { display: block; margin-top: 6px; font-size: 14px; }
.pg-notificacion span[data-notificacion-cuerpo] { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; white-space: pre-line; }
.pg-telefono-pista { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.pg-app { position: absolute; inset: 0; background: #f2f2f4; color: #0b0b0c; animation: pg-app .3s ease-out; }
.pg-app[hidden] { display: none; }
@keyframes pg-app { from { opacity: 0; transform: scale(1.04); } }
.pg-app-home { display: flex; align-items: center; gap: 8px; padding: 52px 20px 0; font-size: 15px; }
.pg-app-marca { width: 26px; height: 26px; border-radius: 8px; background: #0b0b0c radial-gradient(circle at 50% 56%, #fff 0 18%, transparent 19% 33%, #fff 34% 44%, transparent 45%); }
.pg-hoja { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 16px 18px; border-radius: 26px 26px 0 0; background: #fff; box-shadow: 0 -10px 30px rgba(0, 0, 0, .12); text-align: center; animation: pg-hoja .34s cubic-bezier(.2, .8, .2, 1); }
@keyframes pg-hoja { from { transform: translateY(40%); opacity: 0; } }
.pg-hoja p { margin: 0; }
.pg-hoja-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; color: rgba(11, 11, 12, .55); }
.pg-hoja-monto { margin-top: 4px !important; font-size: 13px; font-weight: 800; }
.pg-hoja-monto b { font-size: 38px; letter-spacing: -.02em; }
.pg-hoja-direccion { margin-top: 2px !important; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; font-weight: 600; }
.pg-hoja-aviso { display: inline-block; margin-top: 8px !important; padding: 5px 12px; border-radius: 12px; background: #fff3d6; color: #8a5a00; font-size: 11px; font-weight: 700; line-height: 1.35; }
.pg-hoja-orden { margin-top: 8px !important; font-size: 12px; font-weight: 700; color: rgba(11, 11, 12, .5); }
.pg-hoja-recibo { margin-top: 8px; padding: 8px 12px; max-height: 172px; overflow-y: auto; border-radius: 14px; background: #f5f5f6; text-align: left; font-size: 12px; }
.pg-hoja-recibo div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.pg-hoja-recibo div.is-total { margin-top: 4px; padding-top: 6px; border-top: 1px solid rgba(11, 11, 12, .1); font-weight: 800; font-size: 13px; }
.pg-hoja-recibo div.is-comision { color: rgba(11, 11, 12, .55); }
.pg-hoja-pagar { display: block; width: 100%; margin-top: 12px; padding: 13px 0; border: 0; border-radius: 999px; background: #0b0b0c; color: #fff; font: 700 14px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; cursor: pointer; }
.pg-hoja-pagar[disabled] { opacity: .5; }
.pg-hoja-enlaces { display: flex; justify-content: space-between; margin-top: 6px; }
.pg-hoja-enlaces button { padding: 8px 4px; border: 0; background: none; font: 700 12px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: rgba(11, 11, 12, .6); cursor: pointer; }
.pg-hoja-enlaces button.is-rojo { color: #d42020; }
.pg-hoja-listo { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #fff; font-size: 18px; }
.pg-hoja-listo[hidden] { display: none; }
.pg-hoja-listo span { width: 64px; height: 64px; border-radius: 50%; background: var(--green) no-repeat center / 30px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pg-telefono-leyenda { margin: 14px 0 0; text-align: center; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }

@media (max-width: 1180px) {
  /* En pantallas angostas el teléfono ocupa la pantalla, como al cambiar de app. */
  .pg-telefono { inset: 0; top: 0; left: 0; transform: none; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; background: rgba(11, 11, 12, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: none; }
  .pg-telefono-marco { height: min(620px, calc(100dvh - 72px)); }
}
@media (max-width: 860px) {
  .pg-hechos, .pg-garantias { grid-template-columns: 1fr; gap: 20px; }
  .pg-seccion { padding: 80px 0; }
  .pg-tienda { grid-template-columns: 1fr; }
  .pg-caja { border-left: 0; border-top: 1px solid var(--rule); }
  .pg-pasos > li { padding-left: 52px; }
  .pg-pasos > li::before { font-size: 40px; }
  .pg-api { padding-left: 0; }
  .pg-tabla td:first-child { width: auto; }
}
@media (max-width: 559px) {
  .pg-tienda-cabeza, .pg-productos, .pg-caja, .pg-club { padding-left: 18px; padding-right: 18px; }
  .pg-productos li { grid-template-columns: minmax(0, 1fr) auto; }
  .pg-productos li .pg-precio { grid-column: 1; grid-row: 2; }
  .pg-productos li .pg-cantidad { grid-column: 2; grid-row: 1 / span 2; }
  .pg-club { flex-direction: column; align-items: stretch; }
  .pg-tienda-cabeza { flex-direction: column; }
  pre { padding: 18px 16px; font-size: 13px; border-radius: 10px; }
  .pg-pasos > li { padding-left: 0; padding-top: 44px; }
  .pg-pasos > li::before { top: 0; }
  .pg-telefono { padding: 8px; }
  .pg-telefono-marco { width: min(300px, calc(100vw - 16px)); }
}
@media (prefers-reduced-motion: reduce) {
  .pg-telefono, .pg-notificacion, .pg-app, .pg-hoja { animation: none; }
}

/* Prueba real (/pagar-con-sero/prueba/) */
.pg-prueba { display: grid; gap: 16px; margin: 32px 0 24px; }
.pg-prueba label { display: grid; gap: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pg-prueba input { padding: 13px 14px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; font: 500 16px var(--mono); color: var(--ink); letter-spacing: 0; text-transform: none; }
.pg-prueba input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.pg-prueba .btn { justify-self: start; }
.pg-prueba-boton { max-width: 420px; }
.pg-prueba-registro { max-height: 420px; overflow: auto; }

/* Un mensaje para leer (y copiar a un asistente): salta de línea en vez de deslizarse. */
.pg-mensaje pre { overflow-x: visible; padding-top: 58px; }
.pg-mensaje pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
