/* Club Lilah — estilos (primero celular, luego tableta y escritorio).
   Paleta y tipografía del sitio de recetas (Fraunces + Karla). Sin degradados ni emojis. */

:root {
  --fondo: #FDF8FA; --tarjeta: #FFFFFF; --borde: #E8DDE3; --borde-fuerte: #D9CDD4;
  --texto: #1A1418; --texto-suave: #4A4047;
  --sup: rgba(255,255,255,.95); --sup-borde: rgba(255,255,255,.95);
  --rosa: #A8406B; --rosa-oscuro: #853053; --rosa-suave: #FBE8F0; --rosa-btn: #A8406B; --rosa-btn-h: #853053; --azul-btn: #3C6291; --azul-btn-h: #2D4D74;
  --azul: #3C6291; --azul-oscuro: #2D4D74; --azul-suave: #E7EFF8; --gris-suave: #EEF0F3;
  --exito: #1B6B3A; --exito-suave: #E6F4EB; --error: #A3231B; --error-suave: #FCECEA; --aviso: #7A5200; --aviso-suave: #FFF3D6;
  --f-titulo: "Fraunces", Georgia, "Times New Roman", serif;
  --f-texto: "Karla", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-full: 999px;
  --s-sm: 0 1px 2px rgba(28,19,16,.06), 0 2px 6px rgba(28,19,16,.07);
  --s-md: 0 4px 10px rgba(28,19,16,.07), 0 10px 24px rgba(28,19,16,.10);
  --s-lg: 0 12px 24px rgba(28,19,16,.10), 0 24px 56px rgba(28,19,16,.18);
  --salida: cubic-bezier(.2,0,0,1); --elastica: cubic-bezier(.34,1.56,.64,1);
  --ancho: 67.5rem; --nav-alto: 68px;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Escala: el sitio crece en computadoras grandes y televisores (todo está en rem). */
@media (min-width: 1500px) { html { font-size: 112.5%; } }
@media (min-width: 1900px) { html { font-size: 137.5%; } }
@media (min-width: 2500px) { html { font-size: 175%; } }
@media (min-width: 3400px) { html { font-size: 250%; } }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--f-texto); font-size: 1.0625rem; line-height: 1.55;
  color: var(--texto); background: var(--fondo); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; touch-action: manipulation;
}
h1, h2, h3 { font-family: var(--f-titulo); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 1.6rem + 4vw, 4rem); }
h2 { font-size: clamp(1.65rem, 1.35rem + 1.2vw, 2.2rem); }
h3 { font-size: 1.28rem; }
p { margin: 0; }
img, svg, canvas, video { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--rosa-suave); }

/* ---------------------------------------------------------------- fondo fijo: repostería-cafetería difuminada */
.fondo { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #F6E9EE; pointer-events: none; }
.fondo__imagen { position: absolute; inset: 0; background: url(../img/fondo.jpg) center 32% / cover no-repeat; }
/* Dentro de la cuenta: lago con montañas (claro) y luna con nubes (oscuro). La portada conserva la foto del negocio. */
.fondo__interior { position: absolute; inset: 0; background: url(../img/fondo-claro.jpg) center 40% / cover no-repeat; opacity: 0; transition: opacity .7s ease; }
.dentro .fondo__interior { opacity: 1; }
[data-tema="oscuro"] .fondo__interior { background-image: url(../img/fondo-noche.jpg); background-position: 62% 40%; }
.fondo__velo { position: absolute; inset: 0; background: rgba(255, 255, 255, 0); }

/* ---------------------------------------------------------------- estructura */
#app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.cabecera { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(232,221,227,.9); padding-top: env(safe-area-inset-top); }
.cabecera__fila { max-width: var(--ancho); margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: .75rem; }
.marca { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--texto); }
.marca img { width: 48px; height: 48px; border-radius: 50%; transition: transform .6s var(--elastica); }
.marca:hover img, .marca:active img { transform: rotate(-10deg) scale(1.1); }
.marca__nombre { font-family: var(--f-titulo); font-weight: 600; font-size: 1.55rem; letter-spacing: -.01em; }
.marca__nombre small { display: none; }
.cabecera__espacio { flex: 1; }

.principal { flex: 1; width: 100%; max-width: var(--ancho); margin: 0 auto; padding: 1.25rem 1rem calc(var(--nav-alto) + 2.5rem + env(safe-area-inset-bottom)); }
.vista { animation: entrar .5s var(--salida) both; }
@keyframes entrar { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.escalonado > * { animation: entrar .55s var(--salida) both; }
.escalonado > *:nth-child(2) { animation-delay: .07s; } .escalonado > *:nth-child(3) { animation-delay: .14s; }
.escalonado > *:nth-child(4) { animation-delay: .21s; } .escalonado > *:nth-child(5) { animation-delay: .28s; } .escalonado > *:nth-child(n+6) { animation-delay: .35s; }

/* navegación inferior (celular) */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 2px; padding: .4rem .4rem calc(.4rem + env(safe-area-inset-bottom)); background: rgba(255,255,255,.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--borde); box-shadow: 0 -6px 20px rgba(28,19,16,.07); }
.nav button { min-height: 52px; border: 0; background: transparent; padding: .3rem .1rem; border-radius: 16px; font: 700 .8125rem var(--f-texto); color: var(--texto-suave); cursor: pointer; position: relative; transition: color .25s, background .25s, transform .2s var(--elastica); }
.nav button:active { transform: scale(.9); }
.nav button[aria-current="page"] { color: #fff; background: var(--azul-btn); animation: aparece-nav .4s var(--elastica); box-shadow: 0 6px 14px rgba(60,98,145,.35); }
@keyframes aparece-nav { from { transform: scale(.85); } to { transform: scale(1); } }
.nav-envoltura { display: contents; }
@media (min-width: 860px) {
  .nav { position: static; display: flex; gap: .4rem; padding: 0; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav-envoltura { display: block; max-width: var(--ancho); margin: 1rem auto 0; padding: 0 1rem; width: 100%; }
  .nav button { min-height: 44px; padding: .5rem 1.2rem; font-size: .95rem; background: rgba(255,255,255,.7); }
  .nav button:hover { color: var(--azul); background: #fff; }
  .nav button[aria-current="page"] { color: #fff; background: var(--azul-btn); }
  .principal { padding-bottom: 3rem; }
  .marca__nombre small { display: block; font-family: var(--f-texto); font-size: .75rem; font-weight: 400; color: var(--texto-suave); letter-spacing: .06em; text-transform: uppercase; }
}

.cabecera__nombre { font: 700 1rem var(--f-texto); color: var(--texto); }
@media (max-width: 479px) { .cabecera__nombre { display: none; } .marca__nombre { font-size: 1.4rem; } }
.cabecera__acciones { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.marca__nombre { white-space: nowrap; }
/* cabecera compacta en celulares angostos: el nombre nunca se parte en dos líneas */
@media (max-width: 479px) {
  .cabecera__fila { gap: .5rem; padding-left: .75rem; padding-right: .75rem; }
  .marca { gap: .5rem; } .marca img { width: 40px; height: 40px; }
  .cabecera__acciones { gap: .4rem; }
  .cabecera__acciones .boton--chico { min-height: 38px; padding: .3rem .85rem; font-size: .9rem; }
}

/* ---------------------------------------------------------------- tarjetas y piezas */
.tarjeta { background: rgba(255,255,255,.84); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.9); border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--s-sm); transition: box-shadow .3s, transform .3s var(--salida); }
.tarjeta--elevable:hover { box-shadow: var(--s-md); transform: translateY(-4px); }
.tarjeta--elevable:active { transform: scale(.985); }
.rejilla { display: grid; gap: 1rem; }
.rejilla--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.rejilla--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.pila { display: flex; flex-direction: column; gap: 1rem; }
.fila { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.fila--entre { justify-content: space-between; }
.suave { color: var(--texto-suave); }
.pequeno { font-size: .9rem; }
.etiqueta { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-suave); font-weight: 700; }
.centrado { text-align: center; }

.botones { display: flex; gap: .65rem; flex-wrap: wrap; }
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 54px; padding: .75rem 1.5rem; border: 2px solid transparent; border-radius: var(--r-full);
  font: 700 1.0625rem var(--f-texto); cursor: pointer; text-decoration: none; background: var(--rosa-btn); color: #fff; position: relative; overflow: hidden; isolation: isolate;
  box-shadow: 0 6px 16px rgba(168,64,107,.28); transition: background .25s, transform .25s var(--elastica), box-shadow .25s, opacity .2s;
}
.boton::before { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: rgba(255,255,255,.28); transform: skewX(-22deg); transition: left .6s var(--salida); z-index: -1; }
.boton:hover::before { left: 130%; }
.boton:hover { background: var(--rosa-btn-h); transform: translateY(-3px); box-shadow: 0 12px 24px rgba(168,64,107,.34); }
.boton:active { transform: translateY(0) scale(.95); box-shadow: 0 2px 6px rgba(168,64,107,.3); }
.boton--azul { background: var(--azul-btn); box-shadow: 0 6px 16px rgba(60,98,145,.28); } .boton--azul:hover { background: var(--azul-btn-h); box-shadow: 0 12px 24px rgba(60,98,145,.34); }
.boton--borde { background: rgba(255,255,255,.7); color: var(--azul); border-color: var(--azul); box-shadow: none; } .boton--borde:hover { background: var(--azul-suave); box-shadow: var(--s-sm); }
.boton--peligro { background: var(--error); box-shadow: 0 6px 16px rgba(163,35,27,.25); } .boton--peligro:hover { background: #7f1b15; }
.boton--chico { min-height: 42px; padding: .4rem 1.1rem; font-size: .95rem; box-shadow: none; }
.boton--grande { min-height: 60px; padding: .9rem 2rem; font-size: 1.2rem; }
.boton--ancho { width: 100%; }
.boton--pulso { animation: pulso 2.6s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { box-shadow: 0 6px 16px rgba(168,64,107,.28), 0 0 0 0 rgba(168,64,107,.4); } 50% { box-shadow: 0 6px 16px rgba(168,64,107,.28), 0 0 0 12px rgba(168,64,107,0); } }
.boton[disabled], .boton[aria-busy="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; animation: none; }
.boton[aria-busy="true"]::after { content: ""; width: 1.1em; height: 1.1em; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.boton__onda { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); transform: scale(0); animation: onda .65s ease-out forwards; pointer-events: none; z-index: -1; }
@keyframes onda { to { transform: scale(4); opacity: 0; } }

.campo { display: flex; flex-direction: column; gap: .4rem; }
.campo label { font-weight: 700; font-size: .98rem; }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 54px; padding: .7rem 1rem; font: 1.0625rem var(--f-texto); color: var(--texto); background: #fff; border: 2px solid var(--borde-fuerte); border-radius: var(--r-md); transition: border-color .2s, box-shadow .25s, transform .2s var(--salida); }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 5px rgba(60,98,145,.16); transform: translateY(-1px); }
.campo small { color: var(--texto-suave); font-size: .88rem; }
.mostrar { position: relative; } .mostrar input { padding-right: 5.2rem; }
.mostrar button { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: var(--azul-suave); color: var(--azul-oscuro); font: 700 .85rem var(--f-texto); padding: .45rem .8rem; border-radius: var(--r-full); cursor: pointer; }

.pastilla { display: inline-flex; align-items: center; padding: .25rem .8rem; border-radius: var(--r-full); font-size: .85rem; font-weight: 700; background: var(--gris-suave); color: var(--texto-suave); }
.pastilla--rosa { background: var(--rosa-suave); color: var(--rosa-oscuro); } .pastilla--azul { background: var(--azul-suave); color: var(--azul-oscuro); }
.pastilla--exito { background: var(--exito-suave); color: var(--exito); } .pastilla--error { background: var(--error-suave); color: var(--error); } .pastilla--aviso { background: var(--aviso-suave); color: var(--aviso); }
.aviso { padding: .9rem 1.1rem; border-radius: var(--r-md); font-size: .98rem; border: 1px solid; animation: entrar .4s var(--salida) both; }
.aviso--info { background: rgba(231,239,248,.95); border-color: #BCD0E6; color: var(--azul-oscuro); } .aviso--exito { background: var(--exito-suave); border-color: #B7DDC4; color: var(--exito); }
.aviso--error { background: var(--error-suave); border-color: #F0C2BE; color: var(--error); } .aviso--aviso { background: var(--aviso-suave); border-color: #EBD08A; color: var(--aviso); }
.enlace { background: none; border: 0; padding: .3rem; font: inherit; color: var(--azul); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.enlace:hover { color: var(--azul-oscuro); }

/* ---------------------------------------------------------------- portada */
.hero { min-height: calc(100dvh - 9rem); display: grid; align-content: center; gap: 1.1rem; padding: 4.6rem 0 1rem; }
.hero__panel { background: rgba(255,255,255,.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid #fff; border-radius: 30px; padding: 1.6rem 1.25rem 1.5rem; box-shadow: var(--s-lg); text-align: center; display: grid; gap: 1.1rem; animation: entrar .7s var(--elastica) both; }
.hero__logo { width: 132px; height: 132px; border-radius: 50%; margin: -4.4rem auto 0; display: block; border: 5px solid #fff; box-shadow: var(--s-md); background: #fff; animation: flotar 5s ease-in-out infinite; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero h1 { font-size: clamp(3rem, 2rem + 6vw, 4.8rem); font-weight: 700; color: #7A2A4B; letter-spacing: .01em; -webkit-text-stroke: 7px #fff; paint-order: stroke fill; text-shadow: 0 3px 0 rgba(255,255,255,.9), 0 6px 14px rgba(133,48,83,.25); }
.hero__texto { font-size: 1.2rem; color: var(--texto); max-width: 32ch; margin: .5rem auto 0; font-weight: 600; line-height: 1.45; }
.hero__botones { display: grid; gap: .75rem; max-width: 440px; width: 100%; margin: 0 auto; }
.boton--admin { background: #fff; color: var(--azul-oscuro); border: 2px dashed var(--azul); box-shadow: none; font-size: 1rem; min-height: 52px; }
.boton--admin:hover { background: var(--azul-suave); }
.hero__pasos { display: grid; gap: .7rem; }
.paso { display: flex; align-items: center; gap: 1rem; text-align: left; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid #fff; border-radius: 22px; padding: .9rem 1.1rem; box-shadow: var(--s-md); animation: entrar .6s var(--salida) both; transition: transform .3s var(--elastica); }
.paso:hover { transform: translateX(6px); }
.paso b { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%; background: var(--rosa-btn); color: #fff; display: grid; place-items: center; font: 600 1.7rem var(--f-titulo); box-shadow: 0 6px 14px rgba(168,64,107,.35); }
.paso:nth-child(2) b { background: var(--azul-btn); box-shadow: 0 6px 14px rgba(60,98,145,.35); }
.paso:nth-child(3) b { background: #1B6B3A; box-shadow: 0 6px 14px rgba(27,107,58,.3); }
.paso strong { display: block; font: 600 1.3rem var(--f-titulo); line-height: 1.15; }
.paso span { color: var(--texto-suave); font-size: .98rem; font-weight: 600; }
.paso:nth-child(1) { animation-delay: .15s; } .paso:nth-child(2) { animation-delay: .27s; } .paso:nth-child(3) { animation-delay: .39s; }
.acceso { max-width: 460px; margin: .5rem auto; }
/* celular (vertical o acostado): sin pasos, solo el cuadro de Club Lilah */
@media (max-width: 599px), (max-height: 520px) and (orientation: landscape) { .hero__pasos { display: none; } }
/* tableta vertical: panel centrado y los tres pasos en fila debajo */
@media (min-width: 600px) and (max-width: 859px) {
  .hero { padding-top: 5.2rem; gap: 1.2rem; }
  .hero__lado, .hero__pasos { max-width: 620px; width: 100%; margin-left: auto; margin-right: auto; }
  .hero__pasos { grid-template-columns: repeat(3, 1fr); }
  .paso { flex-direction: column; text-align: center; padding: 1.1rem .7rem; gap: .6rem; } .paso:hover { transform: translateY(-4px); }
}
/* computadora, tableta horizontal y televisión: panel a la izquierda, pasos a un lado */
@media (min-width: 860px) {
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2.5rem; min-height: calc(100vh - 11rem); padding-top: 5.2rem; }
  .hero__panel { padding: 2.2rem 2rem; } .hero__logo { margin-top: -5rem; }
  .hero__pasos { gap: 1rem; } .paso { padding: 1.2rem 1.4rem; }
}
/* teléfono acostado: menos alto, sin forzar la altura de la pantalla */
@media (max-height: 520px) and (orientation: landscape) { .hero { min-height: 0; } .hero__logo { width: 96px; height: 96px; margin-top: -3.2rem; } }

/* ---------------------------------------------------------------- cliente */
.saldo { text-align: center; padding: 1.8rem 1rem; position: relative; overflow: hidden; }
.saldo__numero { font-family: var(--f-titulo); font-size: clamp(4rem, 2.5rem + 9vw, 6rem); font-weight: 600; color: var(--rosa); line-height: 1; }
.saldo__aro { position: absolute; left: 50%; top: 50%; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; border: 2px solid rgba(168,64,107,.25); animation: aro 3.4s ease-out infinite; pointer-events: none; }
.saldo__aro--2 { animation-delay: 1.7s; }
@keyframes aro { from { transform: scale(.5); opacity: .9; } to { transform: scale(2); opacity: 0; } }
.saldo > *:not(.saldo__aro) { position: relative; }
.barra { height: 14px; border-radius: var(--r-full); background: var(--gris-suave); overflow: hidden; }
.barra__relleno { height: 100%; width: calc(var(--p, 0) * 1%); background: var(--azul); border-radius: var(--r-full); transition: width 1.2s var(--salida); }
.recompensa { display: flex; flex-direction: column; gap: .8rem; justify-content: space-between; }
.recompensa--bloqueada { opacity: .85; }
.recompensa__puntos { font-family: var(--f-titulo); font-size: 2.3rem; color: var(--azul); line-height: 1; }
.recompensa__puntos small { font: 700 .85rem var(--f-texto); color: var(--texto-suave); margin-left: .35rem; }
.opciones { display: flex; flex-direction: column; gap: .6rem; }
.opcion { display: flex; gap: .7rem; align-items: center; padding: .9rem 1rem; min-height: 56px; border: 2px solid var(--borde-fuerte); border-radius: var(--r-md); cursor: pointer; font-weight: 600; background: #fff; transition: border-color .2s, background .2s, transform .2s var(--elastica); }
.opcion:active { transform: scale(.97); }
.opcion:has(input:checked) { border-color: var(--azul); background: var(--azul-suave); }
.opcion input { accent-color: var(--azul); width: 1.3rem; height: 1.3rem; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--borde); animation: entrar .45s var(--salida) both; }
.lista li:last-child { border-bottom: 0; }
.mas { color: var(--exito); font-weight: 800; } .menos { color: var(--error); font-weight: 800; }

/* ---------------------------------------------------------------- ventanas (hoja inferior en celular) */
.velo { position: fixed; inset: 0; z-index: 60; background: rgba(26,20,24,.55); display: grid; place-items: end center; padding: 0; animation: aparecer .25s ease both; overflow-y: auto; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
.modal { position: relative; background: #fff; border-radius: 28px 28px 0 0; width: 100%; max-width: 520px; padding: 1.6rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); box-shadow: var(--s-lg); animation: hoja .45s var(--elastica) both; max-height: 94dvh; overflow-y: auto; }
.modal::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--borde-fuerte); margin: -.6rem auto 1rem; }
@keyframes hoja { from { transform: translateY(100%); } to { transform: none; } }
@media (min-width: 600px) { .velo { place-items: center; padding: 1rem; } .modal { border-radius: var(--r-lg); animation: modal .4s var(--elastica) both; } .modal::before { display: none; } }
@keyframes modal { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
.qr { background: #fff; padding: 12px; border: 2px solid var(--borde); border-radius: var(--r-md); display: block; margin: 0 auto; width: min(100%, 320px); height: auto; animation: revelar .7s var(--elastica) both; }
@keyframes revelar { from { opacity: 0; transform: scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
.folio { font: 700 2rem var(--f-titulo); letter-spacing: .2em; color: var(--azul); }
.visor { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #1A1418; aspect-ratio: 1; max-width: 460px; margin: 0 auto; width: 100%; }
.visor video { width: 100%; height: 100%; object-fit: cover; display: block; }
.visor__marco { position: absolute; inset: 16%; border: 4px solid #fff; border-radius: 22px; animation: marco 2.2s ease-in-out infinite; pointer-events: none; }
@keyframes marco { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
.exito-sello { width: 92px; height: 92px; margin: 0 auto 1rem; border-radius: 50%; background: var(--exito-suave); display: grid; place-items: center; animation: modal .55s var(--elastica) both; }
.exito-sello svg { width: 48px; height: 48px; stroke: var(--exito); stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: trazo .6s .25s ease-out forwards; }
.error-sello { background: var(--error-suave); } .error-sello svg { stroke: var(--error); }
@keyframes trazo { to { stroke-dashoffset: 0; } }
.confeti { position: absolute; left: 50%; top: 4.2rem; width: 0; height: 0; pointer-events: none; }
.confeti i { position: absolute; width: 10px; height: 10px; border-radius: 3px; background: var(--c); animation: confeti 1.2s var(--salida) forwards; animation-delay: var(--d); opacity: 0; }
@keyframes confeti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }

.avisos { position: fixed; z-index: 100; left: 50%; bottom: calc(var(--nav-alto) + 1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 440px); pointer-events: none; }
@media (min-width: 860px) { .avisos { bottom: 1.5rem; } }
.toast { padding: .9rem 1.2rem; border-radius: var(--r-md); color: #fff; background: var(--azul-oscuro); box-shadow: var(--s-lg); font-weight: 700; animation: toast .45s var(--elastica) both; pointer-events: auto; }
.toast--error { background: var(--error); } .toast--exito { background: var(--exito); }
.toast.saliendo { animation: toast-fuera .25s ease forwards; }
@keyframes toast { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toast-fuera { to { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- administración */
.chips { display: flex; gap: .5rem; flex-wrap: nowrap; overflow-x: auto; padding: .2rem 0 .5rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 44px; border: 2px solid var(--borde-fuerte); background: #fff; color: var(--texto-suave); padding: .4rem 1.1rem; border-radius: var(--r-full); font: 700 .95rem var(--f-texto); cursor: pointer; transition: all .25s var(--elastica); }
.chip:active { transform: scale(.93); }
.chip[aria-pressed="true"] { background: var(--azul-btn); border-color: var(--azul-btn); color: #fff; }
.productos { display: grid; gap: .65rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .productos { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }
.producto { text-align: left; padding: .9rem; min-height: 88px; border: 2px solid var(--borde); border-radius: var(--r-md); background: #fff; cursor: pointer; font: inherit; color: inherit; display: flex; flex-direction: column; gap: .15rem; transition: transform .25s var(--elastica), border-color .2s, box-shadow .25s; }
.producto:hover { border-color: var(--rosa); transform: translateY(-3px); box-shadow: var(--s-md); }
.producto:active { transform: scale(.94); }
.producto strong { font-size: 1rem; line-height: 1.2; }
.producto__pts { font-weight: 800; color: var(--rosa); font-size: .88rem; }
.producto.pulsado { animation: pulsar .4s var(--elastica); }
@keyframes pulsar { 40% { transform: scale(.9); border-color: var(--rosa); background: var(--rosa-suave); } }
.pedido-linea { display: grid; grid-template-columns: 1fr auto; gap: .25rem .75rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--borde); animation: entrar .35s var(--salida) both; }
.cantidad { display: inline-flex; align-items: center; gap: .4rem; }
.cantidad button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--borde-fuerte); background: #fff; font: 800 1.3rem var(--f-texto); cursor: pointer; transition: all .2s var(--elastica); }
.cantidad button:active { transform: scale(.85); border-color: var(--azul); color: var(--azul); }
.cantidad span { min-width: 2rem; text-align: center; font-weight: 800; font-size: 1.1rem; }
.totales { display: flex; justify-content: space-between; align-items: baseline; padding-top: .8rem; }
.totales strong { font: 600 1.8rem var(--f-titulo); }
.estadistica strong { display: block; font: 600 2.4rem var(--f-titulo); color: var(--azul); line-height: 1.1; }

/* listas en tarjetas (reemplazan a las tablas: se leen bien en celular) */
.fichas { display: grid; gap: .65rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .fichas { grid-template-columns: repeat(2, 1fr); } }
.ficha { display: flex; justify-content: space-between; align-items: center; gap: .8rem; background: rgba(255,255,255,.9); border: 1px solid var(--borde); border-radius: var(--r-md); padding: .9rem 1rem; animation: entrar .45s var(--salida) both; transition: transform .25s var(--salida), box-shadow .25s; }
.ficha:hover { transform: translateY(-2px); box-shadow: var(--s-md); }
.ficha__datos { min-width: 0; } .ficha__datos strong { display: block; overflow-wrap: anywhere; line-height: 1.25; }
.ficha__datos span { display: block; color: var(--texto-suave); font-size: .9rem; overflow-wrap: anywhere; }
.ficha__lado { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; flex: 0 0 auto; }
.ficha__num { font: 600 1.7rem var(--f-titulo); color: var(--azul); line-height: 1; }

/* ---------------------------------------------------------------- dentro de la cuenta: fondo claro y letras nítidas */
.fondo__velo { transition: background .6s ease; }
.dentro .tarjeta { background: rgba(255, 255, 255, .96); }
/* Sobre la foto nítida, todo texto va dentro de un panel: títulos, introducciones y encabezados sueltos. */
.vista > h2, .vista > .pila:not(.tarjeta) > h2, .titulo-suelto { align-self: flex-start; color: var(--texto); background: none; border: 0; box-shadow: none; padding: 0; -webkit-text-stroke: 6px rgba(255,255,255,.96); paint-order: stroke fill; text-shadow: 0 2px 10px rgba(255,255,255,.7); }
[data-tema="oscuro"] .vista > h2, [data-tema="oscuro"] .vista > .pila:not(.tarjeta) > h2, [data-tema="oscuro"] .titulo-suelto { color: #FFFFFF; -webkit-text-stroke: 6px rgba(4,9,22,.92); text-shadow: 0 2px 12px rgba(0,0,0,.75); }
.vista > p, .vista > .pila:not(.tarjeta) > p { background: var(--sup); border: 1px solid var(--sup-borde); border-radius: var(--r-md); padding: .8rem 1.1rem; box-shadow: var(--s-sm); color: var(--texto); }
.vista > .fila--entre { background: var(--sup); border: 1px solid var(--sup-borde); border-radius: var(--r-md); padding: .6rem 1rem; box-shadow: var(--s-sm); }
.vista > .pila > h3.titulo-suelto { font-size: 1.3rem; }
/* cambios en vivo: se actualiza sin repetir las animaciones de entrada */
.silencioso .vista, .silencioso .escalonado > *, .silencioso .lista li, .silencioso .ficha, .silencioso .aviso, .silencioso .nav button, .silencioso .pedido-linea { animation: none !important; }

.campo input[type="range"] { min-height: 0; padding: 0; height: 32px; accent-color: var(--azul-btn); border: 0; background: transparent; box-shadow: none; }

.resena__foto { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--r-md); display: block; }
.resena h3 { margin-bottom: .15rem; }

.ficha--col { flex-direction: column; align-items: stretch; }
.ficha--col .ficha__lado { flex-direction: row; align-items: center; flex-wrap: wrap; }

.cuenta { font: 600 2.8rem var(--f-titulo); text-align: center; color: var(--azul); line-height: 1; letter-spacing: .02em; }
.cargando { width: 42px; height: 42px; margin: .2rem auto; border-radius: 50%; border: 4px solid var(--azul-suave); border-top-color: var(--azul); animation: girar .9s linear infinite; }

/* ---------------------------------------------------------------- TEMA OSCURO (azul marino, botones azulados) */
[data-tema="oscuro"] {
  color-scheme: dark;
  --fondo: #0F1726; --tarjeta: #16243A; --borde: rgba(147,188,238,.22); --borde-fuerte: rgba(147,188,238,.45);
  --texto: #F4F8FF; --texto-suave: #C9D7EA;
  --rosa: #F28DB7; --rosa-oscuro: #F7B5D0; --rosa-suave: rgba(242,141,183,.18);
  --azul: #9CC3F2; --azul-oscuro: #C3DAF6; --azul-suave: rgba(147,188,238,.20); --gris-suave: rgba(147,188,238,.14);
  --exito: #74D9A0; --exito-suave: rgba(116,217,160,.16); --error: #FF938A; --error-suave: rgba(255,147,138,.16);
  --aviso: #F4CB6E; --aviso-suave: rgba(244,203,110,.16);
  --sup: rgba(12, 24, 46, .96); --sup-borde: rgba(110,160,235,.38);
  --btn-azulado: #2C5A98; --btn-azulado-h: #3B72BD; --btn-azul-borde: #7FB2F2;
}
[data-tema="oscuro"] body { background: var(--fondo); color: var(--texto); }
[data-tema="oscuro"] .fondo { background: #0F1726; }
[data-tema="oscuro"] .fondo__velo { background: rgba(8, 14, 28, .12); }
[data-tema="oscuro"] .cabecera { background: rgba(15, 24, 40, .92); border-bottom-color: var(--sup-borde); }
[data-tema="oscuro"] .nav { background: #0E1A30; border-top-color: var(--sup-borde); box-shadow: 0 -6px 20px rgba(0,0,0,.4); }
[data-tema="oscuro"] .nav button { color: #CFE0F7; }
[data-tema="oscuro"] .nav button:hover { background: #3470BF; color: #fff; }
[data-tema="oscuro"] .nav button[aria-current="page"] { color: #fff; }
[data-tema="oscuro"] .tarjeta, [data-tema="oscuro"] .dentro .tarjeta, [data-tema="oscuro"] .hero__panel, [data-tema="oscuro"] .paso, [data-tema="oscuro"] .ficha { background: var(--sup); border-color: var(--sup-borde); }
[data-tema="oscuro"] .hero h1 { color: #FFD3E5; -webkit-text-stroke: 7px #0F1A2E; text-shadow: 0 3px 0 rgba(15,26,46,.9), 0 6px 18px rgba(0,0,0,.45); }
[data-tema="oscuro"] .modal { background: #16243A; }
[data-tema="oscuro"] .modal::before { background: rgba(147,188,238,.4); }
[data-tema="oscuro"] .campo input, [data-tema="oscuro"] .campo select, [data-tema="oscuro"] .campo textarea { background: #0F1B30; color: var(--texto); border-color: rgba(147,188,238,.5); }
[data-tema="oscuro"] .campo input::placeholder { color: #9FB2CC; }
[data-tema="oscuro"] .campo input:focus, [data-tema="oscuro"] .campo select:focus { border-color: #9CC3F2; box-shadow: 0 0 0 5px rgba(147,188,238,.28); }
[data-tema="oscuro"] .mostrar button { background: var(--btn-azulado); color: #fff; border: 1px solid var(--btn-azul-borde); }
/* botones de contorno y de acción secundaria: azulados, nunca grises */
[data-tema="oscuro"] .boton--borde, [data-tema="oscuro"] .boton--tema { background: var(--btn-azulado); color: #fff; border-color: var(--btn-azul-borde); box-shadow: 0 4px 12px rgba(20,60,130,.45); }
[data-tema="oscuro"] .boton--borde:hover, [data-tema="oscuro"] .boton--tema:hover { background: var(--btn-azulado-h); }
[data-tema="oscuro"] .producto, [data-tema="oscuro"] .chip, [data-tema="oscuro"] .opcion, [data-tema="oscuro"] .cantidad button { background: var(--btn-azulado); color: #fff; border-color: var(--btn-azul-borde); }
[data-tema="oscuro"] .producto:hover, [data-tema="oscuro"] .chip:hover { background: var(--btn-azulado-h); border-color: #BBD5F6; color: #fff; }
[data-tema="oscuro"] .producto .suave { color: #D6E4F7; }
[data-tema="oscuro"] .chip[aria-pressed="true"] { background: #4C88DB; border-color: #D5E6FB; color: #fff; }
[data-tema="oscuro"] .opcion:has(input:checked) { background: #4C88DB; border-color: #D5E6FB; }
[data-tema="oscuro"] .aviso--info { background: rgba(60,98,145,.5); border-color: rgba(147,188,238,.5); color: #E3EEFB; }
[data-tema="oscuro"] .aviso--exito { border-color: rgba(116,217,160,.4); }
[data-tema="oscuro"] .aviso--error { border-color: rgba(255,147,138,.4); }
[data-tema="oscuro"] .aviso--aviso { border-color: rgba(244,203,110,.4); }
[data-tema="oscuro"] .principal h2 { color: var(--texto); text-shadow: none; }
[data-tema="oscuro"] .pastilla { background: #24518F; color: #fff; }
[data-tema="oscuro"] .pastilla--rosa { background: rgba(242,141,183,.22); color: #FFCFE3; }
[data-tema="oscuro"] .pastilla--azul { background: #2C5A98; color: #fff; }
[data-tema="oscuro"] .pastilla--exito { background: rgba(116,217,160,.2); color: #A5EBC4; }
[data-tema="oscuro"] .pastilla--error { background: rgba(255,147,138,.2); color: #FFC3BE; }
[data-tema="oscuro"] .pastilla--aviso { background: rgba(244,203,110,.2); color: #F8DD9E; }
[data-tema="oscuro"] .exito-sello { background: rgba(116,217,160,.18); }
[data-tema="oscuro"] .error-sello { background: rgba(255,147,138,.18); }
[data-tema="oscuro"] .saldo__aro { border-color: rgba(242,141,183,.4); }
[data-tema="oscuro"] .barra { background: rgba(147,188,238,.2); }
[data-tema="oscuro"] .campo input[type="range"] { background: transparent; accent-color: #5C9CF0; }
[data-tema="oscuro"] .marca img { background: #fff; }
[data-tema="oscuro"] .boton--azul { background: #3270C4; box-shadow: 0 6px 16px rgba(30,80,170,.5); }
[data-tema="oscuro"] .boton--azul:hover { background: #4A88DC; }
[data-tema="oscuro"] .nav button[aria-current="page"] { background: #3A78D0; box-shadow: 0 6px 14px rgba(30,80,170,.5); }
[data-tema="oscuro"] .nav button { background: #24518F; border: 1px solid #4B84D6; color: #fff; }
[data-tema="oscuro"] .nav button:active { background: #3A78D0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .fondo__capa { animation: none; } .fondo__capa--1 { opacity: 1; } .fondo__miga { display: none; }
}
