/* ==========================================================
   Reservas Zervio5 · App de reserva móvil (v2.0)
   Colores y letras vienen del tema (temas.css).
   ========================================================== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body.app {
    background: var(--fondo);
    color: var(--texto);
    font-family: var(--fuente-texto);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
}
button { font-family: inherit; color: inherit; }
a { color: inherit; }
.oculto { display: none !important; }

.app-wrap { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Encabezado ---------- */
.app-top {
    position: sticky; top: 0; z-index: 20;
    background: var(--fondo);
    background: color-mix(in srgb, var(--fondo) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.app-top__fila { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.app-atras {
    width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
    border: 1px solid var(--borde); background: var(--superficie);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.app-atras svg { width: 18px; height: 18px; }
.app-atras[hidden] { display: none; }
.app-marca { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; text-decoration: none; }
.app-marca img, .app-marca .inicial {
    width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex: 0 0 36px;
}
.app-marca .inicial {
    background: var(--acento); color: var(--acento-texto); font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
}
.app-marca__nombre { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-progreso { display: flex; gap: 6px; margin-top: 10px; }
.app-progreso span { flex: 1; height: 4px; border-radius: 4px; background: var(--borde); transition: background .3s; }
.app-progreso span.hecho { background: var(--acento); }
.app-progreso[hidden] { display: none; }

.app-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.app-chips:empty { display: none; }
.chip {
    border: 1px solid var(--borde); background: var(--superficie); border-radius: 999px;
    padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
}
.chip svg { width: 12px; height: 12px; opacity: .6; }

/* ---------- Pantallas ---------- */
.app-main { flex: 1; padding: 8px 16px calc(120px + env(safe-area-inset-bottom)); }
.pantalla { animation: entrar .28s cubic-bezier(.2,.8,.2,1); }
.pantalla.atras { animation: entrar-atras .28s cubic-bezier(.2,.8,.2,1); }
@keyframes entrar { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes entrar-atras { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

.titulo {
    font-family: var(--fuente-titulo); font-weight: var(--titulo-peso); letter-spacing: var(--titulo-espaciado);
    font-size: calc(30px * var(--titulo-escala)); line-height: 1.08; margin: 14px 0 6px;
}
.sub { color: var(--texto-2); margin: 0 0 18px; font-size: 15px; }

/* ---------- Tarjetas de opción ---------- */
.lista { display: flex; flex-direction: column; gap: 10px; }
.opcion {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    background: var(--superficie); border: 1.5px solid var(--borde); border-radius: var(--radio);
    padding: 12px 14px; min-height: 72px; cursor: pointer;
    transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.opcion:active { transform: scale(.985); }
.opcion.elegida { border-color: var(--acento); background: var(--superficie-2); background: color-mix(in srgb, var(--acento) 12%, var(--superficie)); }
.opcion__foto {
    width: 64px; height: 64px; border-radius: calc(var(--radio) - 4px); object-fit: cover; flex: 0 0 64px;
    background: var(--superficie-2); display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 22px; color: var(--acento);
}
.opcion__foto svg { width: 28px; height: 28px; }
.opcion__cuerpo { flex: 1; min-width: 0; }
.opcion__nombre { display: block; font-weight: 700; font-size: 17px; }
.opcion__detalle { display: block; color: var(--texto-2); font-size: 14px; margin-top: 2px; }
.opcion__lado { text-align: right; flex: 0 0 auto; }
.opcion__precio { font-weight: 800; color: var(--acento); font-size: 16px; white-space: nowrap; }
.opcion__dur { color: var(--texto-2); font-size: 12.5px; white-space: nowrap; }
.opcion--destacada { border-style: dashed; }
.flecha { width: 18px; height: 18px; opacity: .45; flex: 0 0 18px; }

/* ---------- Día y hora ---------- */
.dias {
    display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px; padding: 4px 16px 12px; scrollbar-width: none;
}
.dias::-webkit-scrollbar { display: none; }
.dia {
    scroll-snap-align: start; flex: 0 0 64px; height: 78px; border-radius: var(--radio);
    border: 1.5px solid var(--borde); background: var(--superficie); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.dia__nombre { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-2); font-weight: 600; }
.dia__num { font-size: 22px; font-weight: 800; line-height: 1; }
.dia__nota { font-size: 10.5px; color: var(--texto-2); }
.dia.elegido { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.dia.elegido .dia__nombre, .dia.elegido .dia__nota { color: var(--acento-texto); opacity: .85; }
.dia:disabled { opacity: .35; cursor: default; }

.franja { margin-top: 14px; }
.franja__titulo { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-2); font-weight: 700; margin: 0 0 8px; }
.horas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hora {
    min-height: 50px; border-radius: var(--radio); border: 1.5px solid var(--borde);
    background: var(--superficie); font-weight: 700; font-size: 15.5px; cursor: pointer;
}
.hora:active { transform: scale(.97); }
.hora.elegida { background: var(--acento); border-color: var(--acento); color: var(--acento-texto); }
.sin-horas { text-align: center; color: var(--texto-2); padding: 28px 12px; background: var(--superficie); border-radius: var(--radio); }

/* ---------- Datos ---------- */
.resumen {
    background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
    padding: 14px; display: flex; gap: 12px; align-items: center; margin-bottom: 18px;
}
.resumen__foto { width: 52px; height: 52px; border-radius: calc(var(--radio) - 4px); object-fit: cover; flex: 0 0 52px; background: var(--superficie-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--acento); }
.resumen__linea1 { font-weight: 700; }
.resumen__linea2 { color: var(--texto-2); font-size: 14px; }
.resumen__precio { margin-left: auto; font-weight: 800; color: var(--acento); white-space: nowrap; }

.campo { margin-bottom: 14px; }
.campo label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.campo input {
    width: 100%; font-size: 17px; padding: 14px; border-radius: var(--radio);
    border: 1.5px solid var(--borde); background: var(--superficie); color: var(--texto); font-family: inherit;
}
.campo input:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 25%, transparent); }
.campo input.error { border-color: var(--peligro); }
.campo__error { color: var(--peligro); font-size: 13px; margin-top: 5px; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Botones ---------- */
.btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
    min-height: 54px; border-radius: var(--radio); border: none; cursor: pointer;
    font-size: 16.5px; font-weight: 800; text-decoration: none; padding: 0 18px;
    background: var(--acento); color: var(--acento-texto);
}
.btn:disabled { opacity: .6; }
.btn svg { width: 20px; height: 20px; }
.btn--sec { background: var(--superficie); color: var(--texto); border: 1.5px solid var(--borde); font-weight: 700; }
.btn--peligro { background: transparent; color: var(--peligro); border: 1.5px solid var(--peligro); border: 1.5px solid color-mix(in srgb, var(--peligro) 45%, transparent); font-weight: 700; }
.btn--texto { background: none; color: var(--texto-2); min-height: 44px; font-weight: 600; font-size: 14.5px; text-decoration: underline; }
.btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.barra-fija {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, var(--fondo) 30%);
}
.barra-fija__in { max-width: 488px; margin: 0 auto; }
.btn.cargando { pointer-events: none; }
.btn.cargando::after {
    content: ''; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid currentColor; border-right-color: transparent; animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Saludo / cita / listo ---------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; margin-bottom: 14px; }
.tarjeta__eti { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-2); font-weight: 700; margin-bottom: 6px; }
.tarjeta__grande { font-size: 19px; font-weight: 800; }
.tarjeta__det { color: var(--texto-2); margin-top: 2px; }
.tarjeta--acento { border-color: var(--acento); background: var(--superficie-2); background: color-mix(in srgb, var(--acento) 10%, var(--superficie)); }
.fila-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.fila-btns .btn { min-height: 46px; font-size: 15px; }

.check {
    width: 84px; height: 84px; border-radius: 50%; background: var(--acento); color: var(--acento-texto);
    display: flex; align-items: center; justify-content: center; margin: 22px auto 8px;
    animation: pop .45s cubic-bezier(.2,1.4,.4,1);
}
.check svg { width: 42px; height: 42px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: trazo .4s .25s ease forwards; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes trazo { to { stroke-dashoffset: 0; } }
.centro { text-align: center; }
.listo-detalle { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 15px; }
.listo-detalle dt { color: var(--texto-2); }
.listo-detalle dd { margin: 0; font-weight: 700; text-align: right; }

.instalar { display: flex; gap: 12px; align-items: center; }
.instalar img, .instalar .inicial { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex: 0 0 44px; background: var(--acento); color: var(--acento-texto); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.instalar__txt { flex: 1; font-size: 14px; }
.instalar__txt strong { display: block; font-size: 15px; }
.instalar .btn { width: auto; min-height: 40px; font-size: 14px; padding: 0 14px; }

.vacio { text-align: center; padding: 40px 16px; color: var(--texto-2); }
.vacio svg { width: 48px; height: 48px; opacity: .5; margin-bottom: 10px; }

/* ---------- Avisos ---------- */
.toast {
    position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%);
    z-index: 50; max-width: calc(100% - 32px); width: 488px;
    background: var(--texto); color: var(--fondo); border-radius: 12px; padding: 12px 16px;
    font-weight: 600; font-size: 14.5px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
    animation: bajar .25s ease;
}
.toast.error { background: var(--peligro); color: #fff; }
@keyframes bajar { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.cargando-pantalla { display: flex; justify-content: center; padding: 60px 0; }
.cargando-pantalla::after {
    content: ''; width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid var(--acento); border-right-color: transparent; animation: girar .7s linear infinite;
}
.esqueleto { height: 72px; border-radius: var(--radio); background: linear-gradient(90deg, var(--superficie), var(--superficie-2), var(--superficie)); background-size: 200% 100%; animation: brillo 1.2s infinite; margin-bottom: 10px; }
@keyframes brillo { to { background-position: -200% 0; } }

.pie { text-align: center; font-size: 12px; color: var(--texto-2); padding: 18px 0 0; opacity: .7; }
.pie a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- v2.1 · Barberos en tarjetas grandes con foto ---------- */
.barberos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.barberos--uno { grid-template-columns: 1fr; }
.barberos--uno .barbero { aspect-ratio: 4 / 3; }
.barbero {
    position: relative; display: block; width: 100%; padding: 0; overflow: hidden; cursor: pointer;
    aspect-ratio: 3 / 4; border-radius: var(--radio); border: 2px solid var(--borde);
    background: var(--superficie-2); text-align: left; color: #fff;
    transition: transform .14s ease, border-color .15s ease, box-shadow .15s ease;
}
.barbero:active { transform: scale(.97); }
.barbero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; transition: transform .5s ease; }
.barbero:hover img { transform: scale(1.04); }
.barbero__ini { padding-bottom: 30%;
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--fuente-titulo); font-size: 72px; color: var(--acento);
    background: radial-gradient(circle at 50% 35%, var(--superficie), var(--superficie-2));
}
.barbero__velo { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.55) 62%, rgba(0,0,0,.92) 100%); }
.barbero__txt { position: absolute; left: 12px; right: 12px; bottom: 12px; display: block; }
.barbero__nombre {
    display: block; font-family: var(--fuente-titulo); font-weight: var(--titulo-peso); letter-spacing: var(--titulo-espaciado);
    font-size: calc(24px * var(--titulo-escala)); line-height: 1.02; text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.barbero__esp { display: block; font-size: 12.5px; opacity: .82; margin-top: 3px; line-height: 1.25; }
.barbero__prox {
    position: absolute; top: 10px; left: 10px; right: 10px; width: max-content; max-width: calc(100% - 20px);
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px;
    background: rgba(0,0,0,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    font-size: 11.5px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.barbero__prox i { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; flex: 0 0 7px; }
.barbero__prox.hoy i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }
.barbero__prox.lleno { opacity: .8; }
.barbero__ok {
    position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
    background: var(--acento); color: var(--acento-texto); display: none; align-items: center; justify-content: center;
}
.barbero__ok svg { width: 18px; height: 18px; }
.barbero.elegida { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento); }
.barbero.elegida .barbero__ok { display: inline-flex; }
.barbero.elegida .barbero__prox { right: 48px; }
@media (min-width: 480px) { .barbero__nombre { font-size: calc(28px * var(--titulo-escala)); } }
