/* ==================================================================
   Plantilla de citas — estilo "azulejo de barrio"
   Para otro negocio: cambia los colores y letras de este bloque.
   ================================================================== */
:root {
  --fondo: #F4F3EF;          /* blanco cal */
  --superficie: #FFFFFF;
  --texto: #161A2E;          /* tinta azul casi negra */
  --texto-suave: #4A4F66;
  --acento: #2440A8;         /* azul cobalto: botones */
  --acento-hondo: #1A2F80;
  --sobre-acento: #FFFFFF;
  --mostaza: #E2A93B;        /* solo en el azulejo y detalles, nunca en texto sobre claro */
  --linea: #D8D6CE;
  --linea-fuerte: #B9B6AA;
  --tinta: #161A2E;          /* bloque oscuro */
  --sobre-tinta: #F4F3EF;
  --sobre-tinta-suave: #C3C6D6;

  --letra-titulos: "Bricolage Grotesque Variable", "Bricolage Grotesque", system-ui, sans-serif;
  --letra-texto: "Instrument Sans Variable", "Instrument Sans", system-ui, sans-serif;

  --t-1: clamp(2.5rem, 1.4rem + 5vw, 5.5rem);
  --t-2: clamp(1.75rem, 1.25rem + 2vw, 2.75rem);
  --t-3: clamp(1.15rem, 1.05rem + .45vw, 1.35rem);
  --t-texto: 1.0625rem;

  --ancho: 72rem;
  --margen: clamp(1.25rem, 4vw, 2.5rem);
  --seccion: clamp(3.75rem, 8vw, 6.5rem);
  --radio: 10px;
  --salida: cubic-bezier(.16, 1, .3, 1);

  /* El azulejo: un rombo cobalto con centro mostaza, en cuadros de 28 px */
  --azulejo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Crect width='28' height='28' fill='%23F4F3EF'/%3E%3Cpath d='M14 2 26 14 14 26 2 14Z' fill='%232440A8'/%3E%3Cpath d='M14 9 19 14 14 19 9 14Z' fill='%23E2A93B'/%3E%3Ccircle cx='0' cy='0' r='3.2' fill='%232440A8'/%3E%3Ccircle cx='28' cy='0' r='3.2' fill='%232440A8'/%3E%3Ccircle cx='0' cy='28' r='3.2' fill='%232440A8'/%3E%3Ccircle cx='28' cy='28' r='3.2' fill='%232440A8'/%3E%3C/svg%3E");
}

/* ---------- 1. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* lo oculto se queda oculto aunque tenga otro estilo */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font-family: var(--letra-texto); font-size: var(--t-texto); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 {
  font-family: var(--letra-titulos); font-weight: 700; line-height: 1.05;
  letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance;
}
h1 { font-size: var(--t-1); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: var(--t-2); }
h3 { font-size: var(--t-3); line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 1em; max-width: 62ch; text-wrap: pretty; }
a { color: inherit; text-underline-offset: .2em; }
::selection { background: var(--acento); color: var(--sobre-acento); }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; border-radius: 4px; }
input, select, textarea, button { font: inherit; accent-color: var(--acento); }
.cifras { font-variant-numeric: tabular-nums; }
.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.contenedor { width: min(100% - 2 * var(--margen), var(--ancho)); margin-inline: auto; }
.seccion { padding-block: var(--seccion); }
.saltar { position: absolute; left: -999px; top: 0; }
.saltar:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--superficie); padding: .6rem 1rem; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- 2. Botones y enlaces ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .75rem 1.35rem; border: 0; border-radius: var(--radio);
  background: var(--acento); color: var(--sobre-acento);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .2s var(--salida), background-color .2s;
}
.boton:hover { background: var(--acento-hondo); }
.boton:active { transform: scale(.98); }
.boton svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.boton svg.relleno { fill: currentColor; stroke: none; }
.boton-chico { min-height: 44px; padding: .55rem 1rem; font-size: .95rem; }
.boton-claro { background: var(--sobre-tinta); color: var(--tinta); }
.boton-claro:hover { background: #FFFFFF; }
.enlace {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px;
}
.enlace:hover { text-decoration-thickness: 2px; }

/* ---------- 3. Aviso de plantilla ---------- */
.aviso { background: var(--tinta); color: var(--sobre-tinta); font-size: .875rem; }
.aviso-in { display: flex; align-items: center; gap: .75rem; padding-block: .35rem; }
.aviso p { margin: 0; flex: 1; line-height: 1.4; }
.aviso-cerrar {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -.6rem;
  border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 8px;
}
.aviso-cerrar svg, .chat-cerrar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.aviso-cerrar:hover { background: rgba(244, 243, 239, .12); }
.aviso :focus-visible { outline-color: var(--sobre-tinta); }

/* ---------- 4. Barra de arriba ---------- */
.barra {
  position: sticky; top: 0; z-index: 40;
  background: rgba(244, 243, 239, .96); border-bottom: 1px solid var(--linea);
}
.barra-in { display: flex; align-items: center; gap: 1rem; min-height: 4rem; }
.marca { display: flex; align-items: center; gap: .65rem; text-decoration: none; min-height: 44px; }
.marca-sello {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 8px; background: var(--acento); color: var(--sobre-acento);
  font-family: var(--letra-titulos); font-weight: 800; font-size: 1.25rem; line-height: 1;
  box-shadow: inset 0 -4px 0 var(--mostaza);
}
.marca-nombre { font-family: var(--letra-titulos); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.menu { display: none; gap: 1.75rem; margin-left: auto; }
.menu a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-decoration: none; }
.menu a:hover { text-decoration: underline; }
.barra .boton-chico { margin-left: auto; }

/* ---------- 5. Portada ---------- */
.portada { padding-top: clamp(2.25rem, 6vw, 4.5rem); }
.portada-texto { max-width: 46rem; }
.portada-lema { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); line-height: 1.45; color: var(--texto); }
.portada-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 1.5rem 0 1rem; }
.portada-dato { color: var(--texto-suave); font-size: 1rem; }

/* Horarios libres: una repisa de azulejo con las horas que siguen libres */
.libres {
  margin-top: 1.75rem; max-width: 46rem;
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden;
}
.cenefa { height: 14px; background: var(--azulejo); background-size: 14px 14px; }
.libres-in { padding: 1rem 1.1rem 1.15rem; }
.libres-titulo { font-size: 1.1rem; margin: 0 0 .15rem; letter-spacing: -.01em; }
.libres-nota { margin: 0 0 .75rem; font-size: 1rem; color: var(--texto-suave); }
.libres-horas { display: flex; flex-wrap: wrap; gap: .5rem; }
.hora {
  min-height: 44px; min-width: 4.75rem; padding: .45rem .8rem;
  border: 1px solid var(--linea-fuerte); border-radius: 8px;
  background: var(--fondo); color: var(--texto);
  font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.hora:hover { border-color: var(--acento); background: #EEF1FB; }
.hora:active { transform: scale(.98); }

.portada-foto { margin-top: clamp(2rem, 5vw, 3.5rem); }

/* ---------- 6. Fotos ---------- */
.foto { margin: 0; position: relative; border-radius: var(--radio); overflow: hidden; background: var(--linea); }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto-ancha { aspect-ratio: 4 / 3; }
.foto-alta { aspect-ratio: 4 / 5; }
.portada-foto .foto::after {   /* la cenefa de azulejo al pie de la foto principal */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px;
  background: var(--azulejo); background-size: 14px 14px;
}
/* Espacio para una foto que todavía no está: se nota que falta, pero no le gana al contenido */
.foto-hueco {
  display: grid; place-items: center; align-content: center; gap: .55rem; padding: 1.25rem 1.5rem 1.75rem; text-align: center;
  background: linear-gradient(rgba(244, 243, 239, .87), rgba(244, 243, 239, .87)), var(--azulejo);
  background-size: auto, 56px 56px;
  outline: 2px dashed var(--linea-fuerte); outline-offset: -10px;
}
.foto-hueco-icono { width: 34px; height: 34px; fill: none; stroke: var(--acento); stroke-width: 1.6; stroke-linejoin: round; }
.foto-hueco figcaption { max-width: 20rem; color: var(--texto-suave); font-size: .95rem; line-height: 1.45; }
@media (max-width: 559px) { .foto-hueco.foto-alta { aspect-ratio: 4 / 3; } }
.nota-fotos { color: var(--texto-suave); font-size: .9rem; margin-top: -.5rem; }
.galeria { display: grid; gap: .75rem; grid-template-columns: 1fr; }

/* ---------- 7. Servicios: lista de precios con puntos guía ---------- */
.servicios { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--texto); }
.servicio { padding: 1.1rem 0 1.2rem; border-bottom: 1px solid var(--linea); }
.servicio-linea { display: flex; align-items: baseline; gap: .6rem; }
.servicio h3 { margin: 0; }
.puntos { flex: 1; min-width: 1.5rem; border-bottom: 2px dotted var(--linea-fuerte); transform: translateY(-.3em); }
.precio { margin: 0; font-family: var(--letra-titulos); font-weight: 700; font-size: var(--t-3); }
.servicio-detalle { margin: .35rem 0 .35rem; color: var(--texto-suave); }
.duracion { white-space: nowrap; color: var(--texto); font-weight: 600; }
.duracion::before { content: ""; display: inline-block; width: .35rem; height: .35rem; margin: 0 .5rem .15em .1rem; border-radius: 50%; background: var(--mostaza); vertical-align: middle; }
.servicio-agendar {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--acento); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px;
}
.servicio-agendar:hover { color: var(--acento-hondo); text-decoration-thickness: 2px; }

/* ---------- 8. Cómo se agenda ---------- */
.seccion-pasos { background: var(--superficie); border-block: 1px solid var(--linea); }
.pasos { list-style: none; counter-reset: paso; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.pasos li { counter-increment: paso; display: grid; grid-template-columns: 2.5rem 1fr; gap: .9rem; align-items: start; max-width: 40rem; }
.pasos li::before {
  content: counter(paso); display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border-radius: 8px; background: var(--acento); color: var(--sobre-acento);
  font-family: var(--letra-titulos); font-weight: 800; box-shadow: inset 0 -4px 0 var(--mostaza);
}
.pasos p { margin: 0; }
.pasos strong { display: block; font-family: var(--letra-titulos); font-size: 1.1rem; margin-bottom: .2rem; }

/* ---------- 9. Horario y ubicación ---------- */
.seccion-tinta { background: var(--tinta); color: var(--sobre-tinta); color-scheme: dark; }
.seccion-tinta :focus-visible { outline-color: var(--mostaza); }
.seccion-tinta a:not(.boton) { color: var(--sobre-tinta); }
.ubicacion-in { display: grid; gap: 2.5rem; }
.estado { font-weight: 600; color: var(--mostaza); }
.horario { border-collapse: collapse; width: 100%; max-width: 26rem; }
.horario th, .horario td { padding: .55rem 0; border-bottom: 1px solid rgba(244, 243, 239, .16); text-align: left; font-weight: 400; }
.horario td { text-align: right; }
.horario tr.hoy th, .horario tr.hoy td { font-weight: 700; color: #FFFFFF; }
.horario tr.hoy th::after { content: " (hoy)"; font-weight: 400; color: var(--sobre-tinta-suave); }
.contacto { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.contacto p { margin: 0; }
.contacto-dir { font-family: var(--letra-titulos); font-size: var(--t-3); font-weight: 600; }
.contacto .boton { margin-top: 1rem; }

/* ---------- 10. Pie ---------- */
.pie { padding: 2.5rem 0 7rem; border-top: 1px solid var(--linea); font-size: .95rem; }
.pie p { margin: 0 0 .35rem; }
.pie-nombre { font-family: var(--letra-titulos); font-weight: 700; font-size: 1.1rem; }
.pie-redes { display: flex; gap: 1rem; }
.pie-redes a, .pie a { display: inline-flex; align-items: center; min-height: 44px; }
.pie-chico { color: var(--texto-suave); font-size: .875rem; }

/* ---------- 11. Chat de citas ---------- */
.chat-burbuja {
  position: fixed; right: var(--margen); bottom: 1.25rem; z-index: 60;
  display: none; align-items: center; gap: .5rem; min-height: 56px; padding: .6rem 1.3rem .6rem 1.05rem;
  border: 0; border-radius: 999px; background: var(--acento); color: var(--sobre-acento);
  font-weight: 700; font-size: 1rem; cursor: pointer;
  box-shadow: 0 10px 28px -10px rgba(22, 26, 46, .6), inset 0 -4px 0 var(--mostaza);
}
.js .chat-burbuja { display: inline-flex; }
.chat-burbuja svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-burbuja:hover { background: var(--acento-hondo); }

.chat {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; background: var(--fondo);
}
.chat[hidden] { display: none; }
.chat-cabeza {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .5rem .7rem 1rem; background: var(--tinta); color: var(--sobre-tinta);
}
.chat-cabeza-texto { flex: 1; min-width: 0; }
.chat-cabeza h2 { font-size: 1.05rem; margin: 0; letter-spacing: -.005em; }
.chat-cabeza p { margin: 0; font-size: .8125rem; line-height: 1.35; color: var(--sobre-tinta-suave); }
.chat-cerrar {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px;
  border: 0; border-radius: 8px; background: transparent; color: var(--sobre-tinta); cursor: pointer;
}
.chat-cerrar:hover { background: rgba(244, 243, 239, .12); }
.chat-cabeza :focus-visible { outline-color: var(--mostaza); }

.chat-mensajes {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: .6rem; padding: 1rem;
}
.chat-mensajes > * { flex-shrink: 0; } /* que nada se aplaste cuando hay muchos mensajes */
.msg {
  max-width: 88%; margin: 0; padding: .65rem .9rem; border-radius: 14px;
  line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere;
}
.msg-bot { align-self: flex-start; background: var(--superficie); border: 1px solid var(--linea); border-bottom-left-radius: 4px; }
.msg-cliente { align-self: flex-end; background: var(--acento); color: var(--sobre-acento); border-bottom-right-radius: 4px; }
.msg-escribiendo { color: var(--texto-suave); font-style: italic; }
.msg-error { border-color: #B54708; }

.opciones { display: flex; flex-wrap: wrap; gap: .4rem; align-self: stretch; }
.opcion {
  min-height: 44px; padding: .45rem .9rem;
  border: 1px solid var(--linea-fuerte); border-radius: 999px;
  background: var(--superficie); color: var(--texto); font-weight: 600; cursor: pointer;
  text-align: left; line-height: 1.25;
}
.opcion:hover { border-color: var(--acento); background: #EEF1FB; }
.opcion-principal { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.opcion-principal:hover { background: var(--acento-hondo); border-color: var(--acento-hondo); }
.opcion:disabled { opacity: .5; cursor: default; }
.opcion-hora { font-variant-numeric: tabular-nums; min-width: 4.75rem; text-align: center; }
a.opcion { display: inline-flex; align-items: center; text-decoration: none; }

.tarjeta-cita {
  align-self: stretch; margin: 0; padding: 0; overflow: hidden;
  background: var(--superficie); border: 1px solid var(--linea); border-radius: 14px;
}
.tarjeta-cita .cenefa { height: 12px; background-size: 12px 12px; }
.tarjeta-cita-in { padding: .9rem 1rem 1rem; }
.tarjeta-cita p { margin: 0 0 .2rem; }
.tarjeta-codigo { font-family: var(--letra-titulos); font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.tarjeta-etiqueta { font-size: .85rem; color: var(--texto-suave); }

.mini-form { align-self: stretch; display: grid; gap: .6rem; padding: .9rem; background: var(--superficie); border: 1px solid var(--linea); border-radius: 14px; }
.mini-form label { display: grid; gap: .25rem; font-size: .9rem; font-weight: 600; }
.mini-form input {
  min-height: 48px; padding: .55rem .8rem; font-size: 1rem;
  border: 1px solid var(--linea-fuerte); border-radius: 8px; background: var(--superficie); color: var(--texto);
}
.mini-form input:focus-visible { outline: 3px solid var(--acento); outline-offset: 1px; }
.mini-form .error { margin: 0; color: #9A3412; font-size: .9rem; font-weight: 600; }
.mini-form .boton { width: 100%; }

.chat-form {
  display: flex; gap: .5rem; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
  background: var(--superficie); border-top: 1px solid var(--linea);
}
.chat-form input {
  flex: 1; min-width: 0; min-height: 48px; padding: .6rem .9rem;
  border: 1px solid var(--linea-fuerte); border-radius: var(--radio);
  background: var(--superficie); color: var(--texto); font-size: 1rem;
}
.chat-form input::placeholder { color: #6A6F84; }
.chat-form input:focus-visible { outline: 3px solid var(--acento); outline-offset: 1px; }
.chat-enviar {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px;
  border: 0; border-radius: var(--radio); background: var(--acento); color: var(--sobre-acento); cursor: pointer;
}
.chat-enviar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-enviar:hover { background: var(--acento-hondo); }
.chat-enviar:disabled { opacity: .55; cursor: wait; }

.chat-abierto body { overflow: hidden; }
.chat-abierto .chat-burbuja { display: none; }

/* ---------- 12. Tamaños de pantalla ---------- */
@media (max-width: 719px) {
  .barra .boton-chico { padding-inline: .85rem; }
  .marca-nombre { font-size: 1.05rem; }
  .chat-burbuja { padding-right: 1.1rem; }
}
@media (min-width: 560px) {
  .galeria { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .foto-ancha { aspect-ratio: 16 / 9; }
  .chat {
    inset: auto var(--margen) 5.5rem auto;
    width: 25rem; height: min(42rem, 100vh - 7.5rem);
    border: 1px solid var(--linea); border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 60px -24px rgba(22, 26, 46, .55);
  }
  .chat-abierto body { overflow: auto; }
  .chat-abierto .chat-burbuja { display: inline-flex; }
  .ubicacion-in { grid-template-columns: 1fr 1fr; align-items: start; }
  .pasos { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
  .pasos li { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
  .menu { display: flex; }
  .barra .boton-chico { margin-left: 0; }
  .servicios-in { display: grid; grid-template-columns: 4fr 8fr; gap: 4rem; align-items: start; }
  .servicios-cabeza { position: sticky; top: 6rem; }
}

/* ---------- 13. Un solo momento de movimiento: la entrada de la portada ---------- */
@media (prefers-reduced-motion: no-preference) {
  .entra { animation: entra .9s var(--salida) both; }
  .entra-2 { animation-delay: .1s; }
  @keyframes entra { from { opacity: 0; transform: translateY(14px); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boton:active, .hora:active { transform: none; }
}
