/* Zikala · estilos de la web de cada local, el flujo de reserva y la página del turno.
   Marca: verde #1E3A2B, crema #EFE8D8, bronce #C9A45C (#A9843E sobre blanco). Títulos en Oswald, texto en Rubik.
   Idea: la parte de arriba es la pizarra de precios de la barbería (verde, letra crema, precios con puntos). */

@font-face { font-family: 'Oswald'; font-weight: 500; font-style: normal; font-display: swap; src: url('/static/fonts/oswald-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/fonts/oswald-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 400; font-style: normal; font-display: swap; src: url('/static/fonts/rubik-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 500; font-style: normal; font-display: swap; src: url('/static/fonts/rubik-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 600; font-style: normal; font-display: swap; src: url('/static/fonts/rubik-latin-600-normal.woff2') format('woff2'); }

:root {
  --verde: #1E3A2B;
  --verde-hondo: #142A1F;
  --verde-claro: #E6EEE8;
  --crema: #EFE8D8;
  --crema-tenue: rgba(239, 232, 216, 0.72);
  --crema-linea: rgba(239, 232, 216, 0.22);
  --bronce: #C9A45C;
  --bronce-oscuro: #A9843E;
  --bronce-suave: #F4EBD8;
  --papel: #FFFFFF;
  --fondo: #F3F5F2;
  --tinta: #1E3A2B;
  --tenue: #56685D;
  --linea: #D9E1DB;
  --ok: #2E7D4F; --ok-suave: #DFF0E5;
  --alerta: #8A5A12; --alerta-suave: #F7EBD3;
  --mal: #A8291F; --mal-suave: #F8E1DE;
  --local: var(--verde);
  --local-texto: var(--crema);
  --titulos: 'Oswald', 'Arial Narrow', Arial, sans-serif;
  --texto: 'Rubik', 'Segoe UI', Roboto, Arial, sans-serif;
  --radio: 12px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 400 16px/1.5 var(--texto); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--bronce); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ——— Botones ——— */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 12px 18px; border: 0; border-radius: var(--radio);
  background: var(--verde); color: var(--crema); font-weight: 600; font-size: 17px; text-decoration: none;
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(.985); background: var(--verde-hondo); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; transform: none; }
.btn.claro { background: var(--papel); color: var(--verde); box-shadow: inset 0 0 0 1.5px var(--linea); }
.btn.claro:active { background: var(--fondo); }
.btn.peligro { background: var(--mal-suave); color: var(--mal); }
.btn.whatsapp { background: #E7F6EC; color: #11662F; }
.btn.chico { min-height: 40px; font-size: 15px; padding: 8px 14px; width: auto; }
.enlace { background: none; border: 0; padding: 0; color: var(--verde); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* ——— Pizarra: cabecera del local con la lista de precios ——— */
.pizarra {
  background: var(--local); color: var(--local-texto);
  padding: max(28px, env(safe-area-inset-top)) 20px 30px;
}
.pizarra-cabeza { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.logo-local {
  width: 64px; height: 64px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--crema); color: var(--verde);
  box-shadow: 0 0 0 3px var(--local), 0 0 0 5px var(--bronce);
  font: 600 24px/1 var(--titulos); letter-spacing: .02em;
}
.logo-local img { width: 100%; height: 100%; object-fit: cover; }
.pizarra h1 {
  margin: 0; font: 600 clamp(30px, 9vw, 44px)/1.02 var(--titulos);
  text-transform: uppercase; letter-spacing: .015em; text-wrap: balance;
}
.pizarra .donde { margin: 6px 0 0; color: var(--crema-tenue); font-size: 15px; }
.estado-ahora { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 15px; font-weight: 500; }
.estado-ahora::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--bronce); }
.estado-ahora.cerrado::before { background: transparent; box-shadow: inset 0 0 0 2px var(--crema-tenue); }

.precios { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--crema-linea); }
.precios li { border-bottom: 1px solid var(--crema-linea); }
.precio-btn {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px;
  width: 100%; padding: 14px 0 12px; background: none; border: 0; color: inherit; text-align: left;
}
.precio-btn .nombre { font-weight: 500; font-size: 18px; }
.precio-btn .puntos { border-bottom: 2px dotted var(--crema-linea); transform: translateY(-5px); min-width: 24px; }
.precio-btn .monto { font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--bronce); }
.precio-btn .dur { grid-column: 1 / -1; margin-top: -2px; color: var(--crema-tenue); font-size: 14px; }
.precio-btn:active .nombre { text-decoration: underline; text-underline-offset: 4px; }

/* ——— Contenido de la web del local ——— */
.contenido { max-width: 640px; margin: 0 auto; padding: 8px 20px 12px; }
.seccion { padding: 26px 0; border-bottom: 1px solid var(--linea); }
.seccion:last-of-type { border-bottom: 0; }
.seccion h2 { margin: 0 0 14px; font: 500 24px/1.15 var(--titulos); letter-spacing: .01em; }
.tenue { color: var(--tenue); }
.chico { font-size: 14px; }

.mi-turno { margin-top: 18px; padding: 16px; border-radius: var(--radio); background: var(--bronce-suave); display: grid; gap: 4px; }
.mi-turno b { font-size: 17px; }
.mi-turno a { justify-self: start; margin-top: 6px; }

.equipo { display: flex; flex-wrap: wrap; gap: 14px 22px; margin: 0; padding: 0; list-style: none; }
.equipo li { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--verde-claro); color: var(--verde); display: grid; place-items: center; font-weight: 600; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.horarios { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.horarios th { text-align: left; font-weight: 500; padding: 8px 12px 8px 0; white-space: nowrap; vertical-align: top; }
.horarios td { padding: 8px 0; color: var(--tenue); line-height: 1.45; }
.horarios tr + tr th, .horarios tr + tr td { border-top: 1px solid var(--linea); }
.horarios tr.hoy th, .horarios tr.hoy td { color: var(--tinta); font-weight: 600; }

.fotos { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 0 20px 4px; }
.fotos img { width: 78%; max-width: 360px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radio); scroll-snap-align: start; flex: none; }

.mapa { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radio); background: var(--fondo); margin: 4px 0 14px; }
.acciones { display: grid; gap: 10px; }

.pie { max-width: 640px; margin: 0 auto; padding: 0 20px calc(100px + env(safe-area-inset-bottom)); color: var(--tenue); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pie a { color: var(--tenue); }
.firma { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.firma svg { width: 18px; height: 18px; }

.barra-reservar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--linea);
}
.barra-reservar .btn { max-width: 600px; margin: 0 auto; }
.cartel { margin: 0; padding: 14px 16px; border-radius: var(--radio); background: var(--alerta-suave); color: var(--alerta); font-weight: 500; }
.cartel.ok { background: var(--ok-suave); color: var(--ok); }

/* ——— Flujo de reserva (hoja a pantalla completa) ——— */
body.con-hoja { overflow: hidden; }
.hoja {
  position: fixed; inset: 0; z-index: 30; background: var(--papel);
  display: flex; flex-direction: column;
}
.hoja.entra { animation: subir .22s ease-out;
}
@keyframes subir { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.hoja-top {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 4px;
  padding: max(8px, env(safe-area-inset-top)) 8px 6px; border-bottom: 1px solid var(--linea);
}
.hoja-top .local-mini { text-align: center; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icono-btn { width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; color: var(--verde); }
.icono-btn:active { background: var(--fondo); }
.icono-btn svg { width: 24px; height: 24px; }
.progreso { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 0 20px; margin-top: 12px; }
.progreso span { height: 4px; border-radius: 2px; background: var(--linea); }
.progreso span.hecho { background: var(--verde); }
.hoja-cuerpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 24px; }
.hoja-cuerpo > * + * { margin-top: 16px; }
.hoja h2 { margin: 0; font: 500 28px/1.1 var(--titulos); }
.hoja-pie { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); background: var(--papel); }
.hoja-pie .nota { margin: 8px 0 0; text-align: center; color: var(--tenue); font-size: 13px; }

.opciones { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.opcion {
  width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px;
  padding: 14px 16px; border-radius: var(--radio); border: 1.5px solid var(--linea); background: var(--papel); text-align: left;
}
.opcion .t { font-weight: 600; font-size: 17px; }
.opcion .s { grid-column: 1; color: var(--tenue); font-size: 14px; }
.opcion .d { grid-row: 1 / span 2; grid-column: 2; font-weight: 600; font-variant-numeric: tabular-nums; }
.opcion[aria-pressed="true"], .opcion[aria-checked="true"] { border-color: var(--verde); background: var(--verde-claro); box-shadow: inset 0 0 0 1px var(--verde); }
.opcion.con-marca { grid-template-columns: 26px 1fr auto; }
.opcion.con-marca .marca { grid-row: 1 / span 2; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--linea); display: grid; place-items: center; }
.opcion.con-marca .t, .opcion.con-marca .s { grid-column: 2; }
.opcion.con-marca .d { grid-column: 3; }
.opcion[aria-checked="true"] .marca { background: var(--verde); border-color: var(--verde); }
.opcion[aria-checked="true"] .marca::after { content: ''; width: 10px; height: 6px; border: solid var(--crema); border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.opcion:disabled { opacity: .45; cursor: not-allowed; }

.resumen { border-radius: var(--radio); background: var(--fondo); padding: 4px 14px; }
.resumen .fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; }
.resumen .fila + .fila { border-top: 1px solid var(--linea); }
.resumen .fila span:first-child { color: var(--tenue); font-size: 14px; flex: none; }
.resumen .fila b { text-align: right; font-weight: 600; }
.resumen .fila .enlace { font-size: 14px; margin-left: 8px; }

.dias { display: flex; gap: 8px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 8px; scroll-snap-type: x proximity; scroll-padding-inline: 20px; scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dia {
  flex: none; width: 58px; padding: 8px 0 9px; border-radius: var(--radio); border: 1.5px solid var(--linea); background: var(--papel);
  display: flex; flex-direction: column; align-items: center; gap: 1px; scroll-snap-align: start; font-size: 13px; color: var(--tenue);
}
.dia b { font-size: 20px; font-weight: 600; color: var(--tinta); font-variant-numeric: tabular-nums; }
.dia small { font-size: 11px; height: 14px; }
.dia.lleno { border-style: dashed; }
.dia.lleno b, .dia.cerrado b { color: var(--tenue); }
.dia.cerrado { opacity: .45; }
.dia[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: var(--crema-tenue); }
.dia[aria-pressed="true"] b { color: var(--crema); }
.mes { font-weight: 600; font-size: 15px; margin-bottom: -6px; }

.franja h3 { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--tenue); }
.horas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hora {
  min-height: 46px; border-radius: 10px; border: 1.5px solid var(--linea); background: var(--papel);
  font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums;
}
.hora:active, .hora[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: var(--crema); }
@media (max-width: 340px) { .horas { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.vacio { padding: 18px; border-radius: var(--radio); background: var(--fondo); display: grid; gap: 10px; }
.vacio p { margin: 0; }
.cargando { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cargando span { height: 46px; border-radius: 10px; background: linear-gradient(90deg, var(--fondo), #e8ece8, var(--fondo)); background-size: 200% 100%; animation: brillo 1.2s infinite linear; }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.campo { display: grid; gap: 6px; }
.campo label, .campo .etiqueta { font-weight: 500; font-size: 15px; }
.campo input {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--radio);
  border: 1.5px solid var(--linea); background: var(--papel); font-size: 18px;
}
.campo input:focus { outline: none; border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-claro); }
.campo .ayuda { color: var(--tenue); font-size: 13px; }
.campo .advertencia { color: var(--alerta); font-size: 13px; font-weight: 500; }
.casilla { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 15px; color: var(--tenue); }
.casilla input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--verde); }
.casilla a { color: var(--verde); font-weight: 500; }

.error { padding: 12px 14px; border-radius: var(--radio); background: var(--mal-suave); color: var(--mal); font-weight: 500; }
.error .btn { margin-top: 10px; }

.listo { text-align: center; padding-top: 20px; display: grid; justify-items: center; gap: 8px; }
.listo p { margin: 0; }
.listo .sello {
  width: 76px; height: 76px; border-radius: 50%; background: var(--verde); color: var(--crema);
  display: grid; place-items: center; box-shadow: 0 0 0 4px var(--papel), 0 0 0 6px var(--bronce);
}
.listo .sello svg { width: 36px; height: 36px; }
.listo h2 { margin-top: 10px; }
.listo .cuando { font: 600 22px/1.25 var(--titulos); }
.listo .link-turno { width: 100%; padding: 12px 14px; border-radius: var(--radio); background: var(--fondo); text-align: left; font-size: 14px; word-break: break-all; }

/* ——— Página del turno del cliente ——— */
.cabeza-chica { background: var(--local); color: var(--local-texto); padding: max(18px, env(safe-area-inset-top)) 20px 18px; display: flex; align-items: center; gap: 12px; }
.cabeza-chica .logo-local { width: 44px; height: 44px; font-size: 17px; box-shadow: 0 0 0 2px var(--local), 0 0 0 3.5px var(--bronce); }
.cabeza-chica a { color: inherit; text-decoration: none; font: 600 22px/1.1 var(--titulos); text-transform: uppercase; }
.pagina { max-width: 560px; margin: 0 auto; padding: 22px 20px 48px; display: grid; gap: 18px; }
.pagina h1 { margin: 0; font: 500 30px/1.1 var(--titulos); }
.turno-grande { display: grid; gap: 2px; }
.turno-grande .cuando { font: 600 26px/1.15 var(--titulos); }
.estado { justify-self: start; display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.estado.reservado { background: var(--ok-suave); color: var(--ok); }
.estado.esperando { background: var(--alerta-suave); color: var(--alerta); }
.estado.cancelado, .estado.no_vino { background: var(--mal-suave); color: var(--mal); }
.estado.reprogramado, .estado.asistido { background: var(--fondo); color: var(--tenue); }
.confirmar { padding: 16px; border-radius: var(--radio); border: 1.5px solid var(--mal-suave); display: grid; gap: 10px; }
.confirmar p { margin: 0; }

.pagina.legal { display: block; line-height: 1.6; }
.pagina.legal h1 { margin-bottom: 14px; }
.legal h2 { font: 500 22px/1.2 var(--titulos); margin: 26px 0 8px; }
.legal p, .legal li { color: #2E4337; }

.vacio-pagina { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 14px; padding: 24px; }

@media (min-width: 720px) {
  .pizarra { padding: 48px max(20px, calc(50% - 300px)) 40px; }
  .hoja { inset: 24px; margin: auto; max-width: 520px; max-height: 860px; border-radius: 18px; box-shadow: 0 30px 80px -30px rgba(20, 42, 31, .45); }
  body.con-hoja::after { content: ''; position: fixed; inset: 0; background: rgba(20, 42, 31, .35); z-index: 29; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
