/* Tipografía del sitio: Myriad Pro (la del sitio de Itaú). Se toma de las fuentes instaladas en el equipo;
   si no está instalada, se usa Source Sans 3, que es la que reemplaza a Myriad Pro en el diseño de Penpot. */
@font-face { font-family: 'Myriad Sitio'; font-weight: 300; src: local('MyriadPro-Light'), local('Myriad Pro Light'); }
@font-face { font-family: 'Myriad Sitio'; font-weight: 400 500; src: local('MyriadPro-Regular'), local('Myriad Pro Regular'), local('Myriad Pro'); }
@font-face { font-family: 'Myriad Sitio'; font-weight: 400 500; font-style: italic; src: local('MyriadPro-It'), local('Myriad Pro Italic'); }
@font-face { font-family: 'Myriad Sitio'; font-weight: 600; src: local('MyriadPro-Semibold'), local('Myriad Pro Semibold'); }
@font-face { font-family: 'Myriad Sitio'; font-weight: 600; font-style: italic; src: local('MyriadPro-SemiboldIt'), local('Myriad Pro Semibold Italic'); }
@font-face { font-family: 'Myriad Sitio'; font-weight: 700 900; src: local('MyriadPro-Bold'), local('Myriad Pro Bold'); }

:root {
  --fuente-sitio: 'Myriad Sitio', 'Source Sans 3', sans-serif;
  --barra: 56px;
  --z: 1;
  --naranja: #FF6200;
  --naranja-oscuro: #DE5500;
  --naranja-suave-activo: #FEEEE3;
  --gris-titulo: #464646;
  --gris-texto: #5F6062;
  --gris-ayuda: #767676; /* 4,54:1 sobre blanco (WCAG AA para texto chico) */
  --borde-campo: #CCCCCC;
  --azul-acento: #223F83;
  --azul-pb: #000D3C;
  --nota-fondo: #FFF6CC;
  --nota-borde: #D9B800;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #E9EBEF;
  font-family: 'Source Sans 3', 'Myriad Pro', system-ui, sans-serif;
  color: #333;
}

/* ---------- Barra del prototipo ---------- */
#barra {
  position: fixed; inset: 0 0 auto 0; min-height: 56px; z-index: 100;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 9px 16px;
  background: #1F2430; color: #fff; font-size: 13px; white-space: nowrap;
}
#barra .titulo { font-weight: 700; font-size: 14px; margin-right: 4px; }
/* cada grupo: nombre arriba, opciones abajo */
#barra .grupo { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
#barra .grupo > span { font-size: 11px; letter-spacing: .02em; }
/* separador entre grupos de controles */
#barra .grupo + .grupo { border-left: 1px solid #3B4254; padding-left: 20px; }
#barra [hidden] { display: none !important; }
#barra .notas { margin-left: auto; }
#barra .grupo > span { color: #AEB4C2; }
#barra .seg { display: inline-flex; border: 1px solid #3B4254; border-radius: 6px; overflow: hidden; }
#barra button {
  font: inherit; color: #DDE1EA; background: transparent; border: 0; padding: 6px 10px; cursor: pointer;
}
#barra .seg button + button { border-left: 1px solid #3B4254; }
#barra button[aria-pressed="true"] { background: #FF6200; color: #fff; }
#barra button:disabled { color: #5D6476; cursor: not-allowed; }
#barra .accion { border: 1px solid #3B4254; border-radius: 6px; }
#barra a.accion { color: #DDE1EA; text-decoration: none; padding: 6px 10px; }
#barra a.accion:hover { color: #fff; border-color: #6B7385; }
#barra .accion[aria-pressed="true"] { background: #D9B800; color: #1F2430; border-color: #D9B800; }
#barra .plegar { display: inline-flex; align-items: center; padding: 6px 9px; }
#barra .plegar svg, #solapa svg { width: 12px; height: 8px; }

/* Barra plegada: queda una solapa chica arriba a la derecha */
#solapa {
  display: none; position: fixed; top: 0; right: 16px; z-index: 100; align-items: center; gap: 6px;
  padding: 3px 10px 5px; border: 0; border-radius: 0 0 8px 8px; background: #1F2430; color: #DDE1EA;
  font: 600 11px 'Source Sans 3', sans-serif; letter-spacing: .03em; cursor: pointer; opacity: .85;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#solapa:hover, #solapa:focus-visible { opacity: 1; color: #fff; }
body.barra-plegada #barra { display: none; }
body.barra-plegada #solapa { display: inline-flex; }
/* En pantallas medianas la barra se compacta para entrar en una fila */
@media (max-width: 1599px) {
  #barra .titulo { display: none; }
}
@media (max-width: 1439px) {
  #barra { column-gap: 14px; }
  #barra .grupo + .grupo { padding-left: 14px; }
  #barra button { padding: 6px 8px; }
}
/* En el celular la barra es una sola fila que se desliza de costado */
@media (max-width: 700px) {
  #barra { flex-wrap: nowrap; overflow-x: auto; padding: 8px 10px; gap: 10px; scrollbar-width: none; }
  #barra::-webkit-scrollbar { display: none; }
  #barra .titulo { display: none; }
  #barra .grupo, #barra .accion { flex: none; }
}

#escenario { padding-top: var(--barra); }

/* ---------- Lienzo desktop ---------- */
/* La página ocupa todo el ancho de la ventana; la pantalla del diseño va centrada encima */
.lienzo { position: relative; zoom: var(--z); background: #fff; overflow-x: clip; }
.lienzo .banda { position: absolute; left: 0; right: 0; }
.lienzo > .pantalla { position: absolute; top: 0; }
/* overflow: clip (no hidden) para no romper el Resumen con position: sticky */
.pantalla { position: relative; background: #fff; overflow: clip; font-family: var(--fuente-sitio); }
.capa { position: absolute; }
.zona { position: absolute; cursor: pointer; border-radius: 8px; background: transparent; border: 0; padding: 0; }

/* Pantallas generadas desde Penpot (herramientas/gen.js): cajas, textos y vectores con posición absoluta */
.pv .b, .pv .t, .pv .v { position: absolute; box-sizing: border-box; }
.pv .t { display: flex; flex-direction: column; }
.pv .g { position: absolute; left: 0; top: 0; }
.pv .v svg { position: absolute; display: block; overflow: visible; }

/* Encabezado del carrito lateral: «$ X + N millas» */
.total-cajon { position: absolute; display: flex; align-items: baseline; gap: 5px; color: #464646; white-space: nowrap; }
.total-cajon .importe { font: 400 18px/1.44 var(--fuente-sitio); }
.total-cajon .unidad { font: italic 400 15px/1.4 var(--fuente-sitio); }
.zona:focus-visible { outline: 3px solid #223F83; outline-offset: 2px; }
/* Pista de zonas interactivas, igual a las "hotspot hints" de Figma (medidas en prototipos públicos de Figma):
   al tocar un lugar que no hace nada, cada zona que responde se cubre con un recuadro #30C2FF, borde de 2 px
   opaco por dentro y relleno al 50 %, encima del contenido y con esquinas rectas. Aparece de golpe, se
   desvanece y a los 0,7 s se corta con un 14 % de opacidad todavía visible. El borde mide 2 px de pantalla
   con cualquier zoom. */
.ver-zonas .zona::after, .ver-zonas .boton-continuar::after, .ver-zonas .boton-max::after,
.ver-zonas .campo::after, .ver-zonas .control::after, .ver-zonas .etiqueta-rut::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border: calc(2px / var(--z)) solid #30C2FF; background: rgba(48, 194, 255, .5); border-radius: 0;
  opacity: 0; animation: pista-zona .7s linear;
}
/* Que el recuadro cubra también el borde propio del control */
.ver-zonas .campo::after, .ver-zonas .boton-max::after { inset: -1px; }
.ver-zonas .boton-max[aria-pressed="true"]::after { inset: -2px; }
@keyframes pista-zona {
  0% { opacity: 1; } 10% { opacity: .92; } 20% { opacity: .81; } 33% { opacity: .67; } 50% { opacity: .5; }
  66% { opacity: .37; } 80% { opacity: .25; } 90% { opacity: .19; } 100% { opacity: .14; }
}
@media (prefers-reduced-motion: reduce) {
  .ver-zonas .zona::after, .ver-zonas .boton-continuar::after, .ver-zonas .boton-max::after,
  .ver-zonas .campo::after, .ver-zonas .control::after, .ver-zonas .etiqueta-rut::after { animation: none; opacity: .6; }
}

/* ---------- Teléfono (mobile) ---------- */
/* Sin marco de dispositivo: de borde a borde en alto, con el ancho de un teléfono */
.telefono {
  position: relative; width: 390px; margin: 0 auto; background: #fff; overflow: hidden;
  height: calc(100vh - var(--barra)); height: calc(100dvh - var(--barra));
  box-shadow: 0 0 24px rgba(0,0,0,.12);
}
/* Sin barra de desplazamiento: se desplaza con el dedo, la rueda o arrastrando con el mouse */
.telefono .scroll, .telefono .cajon { scrollbar-width: none; -ms-overflow-style: none; }
.telefono .scroll::-webkit-scrollbar, .telefono .cajon::-webkit-scrollbar { display: none; }
.telefono .scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; cursor: grab; }
.telefono .arrastrando { cursor: grabbing; user-select: none; }
.telefono .pantalla { width: 390px; margin: 0 auto; }
@media (max-width: 600px) {
  .telefono { width: 100%; box-shadow: none; }
}

/* ---------- Carrito lateral ---------- */
.cajon-fondo { position: fixed; inset: var(--barra) 0 0 0; background: rgba(0,0,0,.45); z-index: 50; }
.cajon { position: fixed; top: var(--barra); right: 0; bottom: 0; overflow-y: auto; background: #fff; z-index: 51;
  box-shadow: -6px 0 24px rgba(0,0,0,.2); animation: entra .25s ease-out; }
.cajon .contenido { zoom: var(--z); }
.telefono .cajon-fondo { position: absolute; inset: 0; }
.telefono .cajon { position: absolute; top: 0; }
@keyframes entra { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ---------- Componentes nuevos (HTML real) ---------- */
.txt { position: absolute; white-space: nowrap; line-height: 1.42; }

/* Control deslizante */
.control { position: absolute; height: 44px; touch-action: none; }
.control .pista { position: absolute; left: 0; right: 0; top: 17px; height: 11px; border-radius: 5.5px; }
.control .relleno { position: absolute; left: 0; top: 0; height: 11px; border-radius: 5.5px; }
.control .tirador {
  position: absolute; top: 7px; width: 30px; height: 30px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; cursor: grab;
}
.control .tirador img { width: 17px; height: 14px; pointer-events: none; }
.control:focus-visible { outline: none; }
.control:focus-visible .tirador { outline: 3px solid #223F83; outline-offset: 2px; }
.control.arrastrando .tirador { cursor: grabbing; }

/* Campo de millas */
.campo {
  position: absolute; display: flex; align-items: center; justify-content: flex-end; gap: 6px;
  padding: 0 10px; background: #fff; border: 1px solid var(--borde, var(--borde-campo)); border-radius: 4px;
}
.campo input {
  border: 0; outline: 0; background: transparent; padding: 0; margin: 0; min-width: 0; width: 100%;
  text-align: right; font: 400 16px var(--fuente-sitio); color: #000;
}
.campo span { font-size: 13px; color: #636363; }
/* Foco: borde y aureola difuminada del mismo color, el naranja de los botones (#FF6200) con transparencia */
.campo:focus-within { border-color: rgba(255, 98, 0, .2); box-shadow: 0 0 6px 3px rgba(255, 98, 0, .2); }

/* "Usar el máximo" (botón de la ficha, funciona como interruptor) */
.boton-max {
  position: absolute; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #FF6200; color: var(--naranja-oscuro);
  font: 400 14px var(--fuente-sitio); cursor: pointer; padding: 0;
}
/* Activo en semibold, como en el sitio. Para que la frase no cambie de ancho al activarse, el estado
   normal lleva un espaciado de .017em: en Myriad Pro 14 px la semibold mide 93 px y la normal 89,7 px. */
.boton-max { letter-spacing: .017em; }
.boton-max[aria-pressed="true"] { background: var(--naranja-suave-activo); border: 2px solid #DE5500; font-weight: 600; letter-spacing: 0; }

/* Tarjeta "Tus millas" (mismo lenguaje que "Tu pedido") */
.tarjeta-millas { position: absolute; background: #fff; border-radius: 15px; box-shadow: 0 0 2px #CCCCCC; overflow: hidden; }
.tarjeta-millas .banda { position: absolute; left: 0; top: 0; right: 0; background: #3E3F40; color: #fff;
  font-weight: 700; font-size: 16px; display: flex; align-items: center; padding-left: 15px; }
.tarjeta-millas .pregunta { font-size: 18px; color: var(--gris-titulo); }
.tarjeta-millas .saldo { font-size: 14px; color: #000; }
.tarjeta-millas .escala { font-size: 12px; color: var(--gris-ayuda); }
.tarjeta-millas .divisoria { position: absolute; height: 1px; background: #DCDCDC; }
.tarjeta-millas .total { font-size: 14px; font-weight: 700; color: var(--gris-titulo); }
.tarjeta-millas .total-monto { font-size: 16px; }

/* Etiqueta de ahorro */
.etiqueta-ahorro {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; height: 26px;
  padding: 0 10px 0 8px; border-radius: 4px; font-size: 14px; white-space: nowrap;
}
.etiqueta-ahorro svg { width: 16px; height: 16px; flex: none; }

/* Resumen (desktop): caja fija al hacer scroll */
.columna-resumen { position: absolute; }
.resumen {
  position: sticky; top: 16px; width: 278px; background: #fff; border: 1px solid #E6E6E6; border-radius: 5px;
}
.resumen .fila { position: absolute; height: 34px; display: flex; align-items: center; font-size: 14px; font-weight: 300; }
.resumen .titulo.envio { color: #333333; }
.resumen .titulo { position: absolute; left: 0; right: 0; text-align: center; color: var(--naranja); font-size: 14px; }
.resumen .hr { position: absolute; left: 2px; right: 2px; top: 38px; height: 1px; background: #EEEEEE; }
.resumen .sep { position: absolute; height: 2px; background: #D6D6D6; }
.chevron { display: block; width: 10px; height: 6px; }

/* Filas del Resumen del carrito completo (escenario con tope) */
.fila-resumen { position: absolute; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 300; }
.separador-resumen { position: absolute; height: 2px; background: #D6D6D6; }

/* «Necesito factura con RUT»: el checkbox nativo del navegador, como en el sitio (13 × 13, sin estilo propio) */
.etiqueta-rut { cursor: pointer; }
.etiqueta-rut input { position: absolute; margin: 0; width: 13px; height: 13px; cursor: pointer; }

/* Botón Continuar (cambia de texto al saltear el pago) */
.boton-continuar {
  position: absolute; display: flex; align-items: center; justify-content: center; border: 0; cursor: pointer;
  background: #FF6200; color: #fff; border-radius: 17px; font: 400 14px var(--fuente-sitio);
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}

/* Contador del carrito */
.contador { position: absolute; background: #00A80A; color: #fff; border-radius: 8px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; pointer-events: none; }

/* ---------- Notas para desarrollo ---------- */
.pin {
  position: absolute; z-index: 40; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
  background: #FFD84D; border: 2px solid #8A6D00; color: #4A3A00; font: 700 12px 'Source Sans 3', sans-serif;
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.pin[aria-expanded="true"] { background: #1F2430; color: #FFD84D; border-color: #FFD84D; }
.panel-notas {
  position: fixed; z-index: 90; right: 12px; top: calc(var(--barra) + 12px); width: 360px;
  max-height: calc(100vh - var(--barra) - 24px); overflow-y: auto;
  background: var(--nota-fondo); border: 1px solid var(--nota-borde); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 13.5px; line-height: 1.45; color: #2F2A10;
}
.panel-notas header { position: sticky; top: 0; background: var(--nota-fondo); padding: 12px 14px 8px;
  border-bottom: 1px solid #EAD98A; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #6B5A00; }
.panel-notas ol { margin: 0; padding: 10px 14px 14px 14px; list-style: none; }
.panel-notas li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px dashed #EAD98A; }
.panel-notas li:last-child { border-bottom: 0; }
.panel-notas li b.n { width: 22px; height: 22px; border-radius: 50%; background: #FFD84D; border: 2px solid #8A6D00;
  display: flex; align-items: center; justify-content: center; font-size: 11px; }
.panel-notas li.resaltada { background: rgba(255, 216, 77, .35); border-radius: 6px; }
.panel-notas code { font-size: 12px; background: rgba(0,0,0,.06); padding: 0 3px; border-radius: 3px; }


/* ---------- Fin del recorrido ---------- */
.modal-fondo { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 12px; padding: 22px 24px; max-width: 420px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal h2 { margin: 0 0 8px; font-size: 18px; color: var(--gris-titulo); }
.modal p { margin: 0 0 16px; color: var(--gris-texto); font-size: 14px; line-height: 1.5; }
.modal button { background: #FF6200; color: #fff; border: 0; border-radius: 17px; padding: 8px 20px; font: 400 14px 'Source Sans 3', sans-serif; cursor: pointer; }
.modal button.secundario { background: #fff; color: #DE5500; border: 1px solid #FF6200; margin-left: 8px; }

/* Panel de notas en pantallas angostas: abajo, sin tapar el teléfono entero */
@media (max-width: 900px) {
  .panel-notas { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 38vh; }
}
