/* Estilos de /cartel.html (antes <style> inline; archivo propio para la CSP de estilos). */
/* Colores del COMERCIO (Mi tarjeta): --c1 fondo, --c2 acento. BT Fidelis queda chico al pie. */
:root { --c1:#0D47A1; --c2:#E9965A; --txt:#ffffff; --tenue:rgba(255,255,255,.78); }
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #F2F4F7; padding: 20px 16px; display: flex; flex-direction: column; align-items: center; }
[hidden] { display: none !important; }
/* Fondo común de todas las piezas: el color del comercio con brillo arriba. */
.fondo {
  color: var(--txt); text-align: center; position: relative; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,.16), rgba(255,255,255,0) 60%), linear-gradient(165deg, var(--c1) 0%, color-mix(in srgb, var(--c1) 78%, #000) 100%);
}
.acento { color: var(--c2); }

/* Selector de formato (solo pantalla) */
/* ===== Barra de la página (no se imprime) ===== */
/* Encabezado: Volver (a la caja del comercio) + título. */
.cabecera { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.volver { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid #d5dbe7; border-radius: 99px; background: #fff; color: #10203f; font-weight: 700; font-size: 14px; text-decoration: none; box-shadow: 0 1px 2px rgba(16,32,63,.06); }
.volver:hover { border-color: #10203f; }
.cabecera-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cabecera-txt b { color: #10203f; font-size: 16px; }
.cabecera-txt span { color: #6b7a99; font-size: 12.5px; }
/* Selector de formato: control segmentado (4 en fila; 2×2 en celulares chicos). */
.formatos { width: 100%; max-width: 560px; box-sizing: border-box; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 0 0 22px; background: #fff; border: 1px solid #e3e8f1; border-radius: 16px; box-shadow: 0 1px 3px rgba(16,32,63,.06); }
.formatos button { min-height: 56px; border: 0; border-radius: 12px; background: transparent; color: #46557a; padding: 6px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-family: inherit; font-weight: 600; font-size: 12.5px; line-height: 1.15; text-align: center; cursor: pointer; transition: background .15s, color .15s; }
.formatos button .ico { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.formatos button .corto { display: none; }
.formatos button:hover { background: #f2f5fa; color: #10203f; }
.formatos button[aria-pressed="true"] { background: #10203f; color: #fff; box-shadow: 0 6px 14px -8px rgba(16,32,63,.7); }
.volver:focus-visible, .formatos button:focus-visible, .btn-accion:focus-visible { outline: 3px solid rgba(13,71,161,.35); outline-offset: 2px; }
@media (max-width: 440px) {
  /* Celular: una sola fila compacta con rótulos cortos (antes 2×2 y alto). */
  .formatos { gap: 2px; padding: 3px; border-radius: 14px; margin-bottom: 16px; }
  .formatos button { min-height: 52px; padding: 5px 2px; font-size: 11.5px; border-radius: 11px; }
  .formatos button .ico { width: 19px; height: 19px; }
  .formatos button .largo { display: none; }
  .formatos button .corto { display: inline; }
  .cabecera-txt span { display: none; }
}

/* ===== 1 · Cartel del mostrador ===== */
.poster { width: 100%; max-width: 460px; border-radius: 28px; padding: 26px 24px 20px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.45); }
.poster::after { content: ""; position: absolute; inset: 8px; border: 2px solid color-mix(in srgb, var(--c2) 70%, transparent); border-radius: 22px; pointer-events: none; }
.poster .brand-logo { max-height: 76px !important; margin-bottom: 8px !important; }
.nombre { font-weight: 800; font-size: 22px; line-height: 1.15; letter-spacing: .2px; }
.club { color: var(--tenue); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; margin-top: 4px; }
.kicker { margin: 18px 0 2px; font-size: 15px; font-weight: 600; color: var(--tenue); }
.premio { font-size: clamp(30px, 9vw, 40px); font-weight: 900; line-height: 1.05; margin: 0 4px; }
.sellos { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px auto 4px; max-width: calc(var(--cols, 7) * 36px + (var(--cols, 7) - 1) * 8px); }
.s { width: 36px; height: 36px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--txt) 55%, transparent); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--tenue); }
.s.lleno { border: 0; background: var(--c2); color: color-mix(in srgb, var(--c1) 85%, #000); font-size: 16px; }
.s.regalo { border: 0; background: #fff; font-size: 18px; box-shadow: 0 0 0 3px var(--c2); }
.s.etapa { border-style: solid; border-color: var(--c2); font-size: 15px; }
.escalones { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.escalones span { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
.accion { background: #fff; color: #10203f; border-radius: 22px; margin-top: 18px; padding: 16px 14px 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; text-align: left; }
.accion .apunta { grid-column: 1 / -1; text-align: center; font-weight: 800; font-size: 17px; color: var(--c1); }
.qrbox { justify-self: center; padding: 8px; border-radius: 14px; border: 3px solid var(--c2); background: #fff; box-sizing: border-box; max-width: 100%; }
.qr img, .qr canvas { display: block; width: 100% !important; height: auto !important; }
#qr { width: 180px; max-width: 100%; }
.nfc { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 104px; text-align: center; }
.nfc-zona { width: 96px; height: 96px; border: 3px dashed #c3cfe6; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.nfc small { font-size: 12px; color: #5b6b8c; line-height: 1.25; }
.pasos { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.paso { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 10px 6px; font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.paso b { display: flex; width: 24px; height: 24px; margin: 0 auto 4px; border-radius: 50%; background: var(--c2); color: color-mix(in srgb, var(--c1) 85%, #000); align-items: center; justify-content: center; font-size: 13px; }
.confianza { margin-top: 12px; font-size: 12.5px; font-weight: 600; color: var(--tenue); }
.socios { margin-top: 8px; font-size: 14px; font-weight: 800; }
.dir { margin-top: 6px; font-size: 12px; color: var(--tenue); }
.bt { margin-top: 10px; font-size: 10px; letter-spacing: 1px; color: var(--tenue); opacity: .75; }
/* QR + NFC lado a lado no entran en celulares (el QR se salía de la tarjeta): uno debajo del otro. */
@media (max-width: 440px) { .accion { grid-template-columns: 1fr; } .nfc { width: auto; flex-direction: row; justify-self: center; } .nfc-zona { width: 72px; height: 72px; } }

/* ===== 2 · Tarjeta de mesa A6 (plegable): dos caras de 148×105 mm; la de arriba va invertida para que,
   doblada como carpa, las dos se lean derechas. Todo escala con el ancho (cqw). ===== */
.mesa { width: min(100%, 148mm); display: flex; flex-direction: column; border: 1px dashed #9aa6bd; }
.cara { aspect-ratio: 148 / 105; container-type: inline-size; padding: 5cqw 6cqw; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4cqw; align-items: center; text-align: left; }
.cara.invertida { transform: rotate(180deg); }
.pliegue { height: 0; border-top: 1px dashed #9aa6bd; position: relative; }
.pliegue span { position: absolute; right: 6px; top: -9px; font-size: 10px; color: #7c8bb5; background: #F2F4F7; padding: 0 4px; }
.cara .brand-logo { max-height: 13cqw !important; max-width: 40cqw !important; margin: 0 0 1.5cqw !important; padding: .8cqw !important; border-radius: 2cqw !important; }
.cara .nombre { font-size: 4.6cqw; }
.cara .kicker { font-size: 3.3cqw; margin: 2.6cqw 0 .4cqw; }
.cara .premio { font-size: 6.6cqw; margin: 0; }
.cara .chip { display: inline-block; margin-top: 2.6cqw; background: var(--c2); color: color-mix(in srgb, var(--c1) 85%, #000); border-radius: 99px; padding: 1cqw 3cqw; font-size: 3cqw; font-weight: 800; }
.cara .qrbox { width: 36cqw; padding: 1.4cqw; border-radius: 2.4cqw; border-width: .7cqw; text-align: center; }
.cara .qrbox small { display: block; color: #10203f; font-size: 2.6cqw; font-weight: 800; margin-top: 1cqw; }

/* ===== 3 · Sticker de vidriera (15×15 cm) ===== */
.sticker { width: min(100%, 150mm); aspect-ratio: 1; container-type: inline-size; border-radius: 6cqw; padding: 6cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqw; }
.sticker::after { content: ""; position: absolute; inset: 2.4cqw; border: .6cqw solid color-mix(in srgb, var(--c2) 75%, transparent); border-radius: 4.4cqw; pointer-events: none; }
.sticker .brand-logo { max-height: 13cqw !important; margin: 0 auto 1cqw !important; padding: .8cqw !important; border-radius: 2cqw !important; }
.sticker .nombre { font-size: 5.4cqw; }
.sticker .gancho { font-size: 7.6cqw; font-weight: 900; line-height: 1.05; }
.sticker .breve { font-size: 3.8cqw; font-weight: 600; color: var(--tenue); line-height: 1.25; max-width: 86cqw; }
.sticker .qrbox { width: 40cqw; padding: 1.6cqw; border-radius: 3cqw; border-width: .8cqw; margin-top: 1cqw; }
.sticker .scan { font-size: 3.6cqw; font-weight: 800; }

/* ===== 4 · Historia de Instagram (1080×1920, se dibuja en un canvas y se descarga como imagen) ===== */
.historia { width: min(100%, 340px); }
.historia canvas { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.45); }

/* Acciones: la principal ancha (imprimir / descargar) y debajo las secundarias, del mismo tamaño. */
.acciones { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 10px; margin: 24px 0 12px; }
.acciones-sec { display: flex; gap: 10px; }
.acciones-sec:not(:has(> :not([hidden]))) { display: none; }
.btn-accion { flex: 1 1 0; box-sizing: border-box; min-height: 50px; border-radius: 14px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; font-weight: 700; font-size: 15px; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: transform .1s, box-shadow .15s, background .15s, border-color .15s; }
.btn-accion[hidden] { display: none; }
.btn-accion:active { transform: translateY(1px); }
.btn-accion.primario { width: 100%; min-height: 54px; border: 0; background: #E9965A; background-image: linear-gradient(160deg, #F7C29A 0%, #EA9A60 38%, #F2AD7B 58%, #CF7A42 100%); color: #3B1D08; font-weight: 800; font-size: 16px; box-shadow: 0 10px 22px -12px rgba(207,122,66,.95); }
.btn-accion.secundario { background: #fff; color: #0D47A1; border: 1.5px solid #c9d6ef; }
.btn-accion.secundario:hover { border-color: #0D47A1; background: #f5f8fe; }
@media (max-width: 440px) { .btn-accion.secundario { font-size: 14px; padding: 10px 12px; gap: 6px; } }
@media (max-width: 360px) { .acciones-sec { flex-direction: column; } }
/* Nota de ayuda del formato elegido. */
.nota { width: 100%; max-width: 460px; box-sizing: border-box; display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; background: #fff; border: 1px solid #e3e8f1; border-radius: 14px; color: #4a5878; font-size: 13px; line-height: 1.5; text-align: left; }
.nota::before { content: "💡"; flex: none; }
.nota:empty { display: none; }
/* Imprimir igual que en pantalla (si no, el navegador descarta los fondos). */
* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
@page { size: A4; margin: 10mm; }
@media print {
  body { background: #fff; padding: 0; }
  .poster { max-width: 100%; box-shadow: none; break-inside: avoid; }
  .mesa, .sticker { break-inside: avoid; }
  .pliegue span { background: #fff; }
  .solo-pantalla, .formatos, .acciones { display: none !important; }
}
