/* Probador virtual de gafas y checkout simulado (probador.html, checkout.html) */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #0b1430; background: #f7f5f1; -webkit-font-smoothing: antialiased;
}
body.fondo-claro { background: #f6f7fb; }
a { color: inherit; }

.pagina { max-width: 1040px; margin: 0 auto; padding: 0 20px max(32px, env(safe-area-inset-bottom)); }
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.logo { height: 46px; width: auto; }
.enlace-volver { font-weight: 600; text-decoration: none; color: #334155; padding: 8px 0; }
.enlace-volver:hover { color: #1f4fd8; }

.intro { max-width: 560px; margin: 12px auto 0; text-align: center; }
.sobretitulo { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #1f4fd8; }
h1 { margin: 0 0 12px; font-size: clamp(1.8rem, 6vw, 2.6rem); line-height: 1.1; letter-spacing: -.01em; }
.texto { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.55; color: #475569; }
.nota { margin: 12px 0 0; font-size: .86rem; line-height: 1.45; color: #64748b; }

.catalogo { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 22px; padding: 0; }
.catalogo li { background: #fff; border: 1px solid #e8e4dc; border-radius: 14px; padding: 10px 8px 12px; }
.catalogo img { display: block; width: 100%; height: auto; aspect-ratio: 56 / 34; object-fit: contain; }
.catalogo span { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.catalogo b { font-size: .88rem; }
.catalogo small { font-size: .8rem; color: #64748b; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-size: 1.05rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.primario { background: #0b1430; color: #fff; }
.btn.primario:hover { background: #1f4fd8; }
.btn.secundario { background: transparent; color: #0b1430; border-color: #cbd2de; margin-top: 10px; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #1f4fd8; outline-offset: 2px; }

/* ---------- Vista de cámara ---------- */
.ar { position: fixed; inset: 0; background: #000; overflow: hidden; }
.ar-contenedor { position: absolute; inset: 0; overflow: hidden; }
.ar-arriba { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 12px 12px; pointer-events: none; }
.redondo { pointer-events: auto; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%;
  background: rgba(11, 20, 48, .7); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.estado { margin: 0 auto; padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .94);
  font-weight: 700; font-size: .95rem; text-align: center; box-shadow: 0 4px 18px rgba(0, 0, 0, .2); }
.ar-abajo { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 14px max(16px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96);
  border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); max-width: 520px; margin: 0 auto; }
.selector { display: flex; gap: 8px; justify-content: center; }
.selector button { flex: 1; max-width: 120px; padding: 6px; border: 2px solid #e2e6ee; border-radius: 14px; background: #fff; cursor: pointer; }
.selector button[aria-checked="true"] { border-color: #1f4fd8; box-shadow: 0 0 0 3px rgba(31, 79, 216, .18); }
.selector img { display: block; width: 100%; height: auto; aspect-ratio: 56 / 34; object-fit: contain; }
.ficha { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ficha-nombre { margin: 0; font-size: 1.1rem; font-weight: 800; }
.ficha-detalle { margin: 2px 0 0; font-size: .85rem; color: #64748b; }
.ficha-precio { margin: 0; font-size: 1.15rem; font-weight: 800; white-space: nowrap; }

/* ---------- Checkout ---------- */
.aviso-demo { padding: 10px 16px; background: #fff4d6; color: #5c4400; border-bottom: 1px solid #f0d995; font-size: .9rem; text-align: center; }
.marca-demo { font-weight: 800; letter-spacing: .04em; color: #64748b; }
.checkout h1 { text-align: left; margin-top: 4px; }
.checkout-columnas { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.checkout-columnas > * { min-width: 0; }
fieldset { min-width: 0; margin: 0 0 18px; padding: 18px; border: 1px solid #e3e7ef; border-radius: 16px; background: #fff; }
legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 800; font-size: 1.05rem; }
.paso { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #0b1430; color: #fff; font-size: .85rem; }
label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: .9rem; font-weight: 600; color: #334155; }
input:not([type="radio"]) { width: 100%; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1.5px solid #cfd6e2; border-radius: 10px; font: inherit; font-weight: 400; color: #0b1430; background: #fbfcfe; }
input.invalido { border-color: #c62828; background: #fff6f6; }
.fila-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.metodos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metodo { flex-direction: row; align-items: center; gap: 10px; margin: 0; padding: 12px; border: 1.5px solid #dfe4ec; border-radius: 12px; cursor: pointer; }
.metodo:has(input:checked) { border-color: #1f4fd8; background: #f2f6ff; }
.metodo input { width: 18px; height: 18px; accent-color: #1f4fd8; }
.metodo span { display: flex; flex-direction: column; }
.metodo small { font-weight: 400; color: #64748b; }
.error-form { margin: 0 0 12px; color: #c62828; font-weight: 700; }
.btn.grande { min-height: 58px; font-size: 1.1rem; }

.resumen { padding: 18px; border: 1px solid #e3e7ef; border-radius: 16px; background: #fff; position: sticky; top: 16px; }
.resumen h2 { margin: 0 0 12px; font-size: 1.1rem; }
.resumen-producto { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #eef1f6; }
.resumen-producto img { width: 110px; height: auto; aspect-ratio: 56 / 34; object-fit: contain; background: #f7f5f1; border-radius: 10px; }
.cantidad { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #eef1f6; font-weight: 600; }
.contador { display: flex; align-items: center; gap: 10px; }
.contador button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid #cfd6e2; background: #fff; font-size: 1.2rem; cursor: pointer; }
.contador button:disabled { opacity: .4; cursor: default; }
.contador output { min-width: 1.5em; text-align: center; font-weight: 800; }
.totales { margin: 12px 0 0; }
.totales div { display: flex; justify-content: space-between; padding: 4px 0; color: #475569; }
.totales dd { margin: 0; font-weight: 600; color: #0b1430; }
.totales .total { margin-top: 6px; padding-top: 10px; border-top: 1px solid #eef1f6; font-size: 1.15rem; font-weight: 800; color: #0b1430; }

.confirmacion { max-width: 560px; text-align: center; padding-top: 32px; }
.confirmacion h1 { text-align: center; }
.confirmacion .check { width: 74px; height: 74px; margin: 0 auto 16px; border-radius: 50%; background: #16a34a; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 800; }
.confirmacion .resumen { position: static; text-align: left; margin-bottom: 18px; }
.acciones-conf { display: flex; flex-direction: column; }

@media (max-width: 760px) {
  .checkout-columnas { grid-template-columns: minmax(0, 1fr); }
  .resumen { position: static; order: -1; }
  .metodos { grid-template-columns: 1fr; }
  .catalogo { gap: 8px; }
}
