/* ==========================================================================
   Clínica Sannas · Página provisional
   HTML + CSS planos. Sin recursos externos. Mobile first.
   ========================================================================== */

/* --- Tipografías servidas desde el propio dominio (fontsource-variable, OFL) --- */
@font-face {
  font-family: "Outfit Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/outfit-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/outfit-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Manrope Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2-variations"),
       url("fonts/manrope-latin-wght-normal.woff2") format("woff2");
}

/* --- Identidad --- */
:root {
  --fondo: #FBF9F6;
  --titular: #925C59;   /* 5,1:1 sobre fondo: válido para texto */
  --oliva: #7D801B;     /* 4,0:1: solo texto grande o decoración */
  --rosa: #E7D7D4;
  --arena: #D8CA9E;
  --terracota: #B46659; /* 4,0:1: solo texto grande o decoración */

  --texto: #3E302E;     /* 12:1 sobre fondo */
  --texto-suave: #5E4A47; /* 7,8:1 sobre fondo */
  --superficie: #F4ECE9; /* rosa muy claro para bloques */
  --blanco: #FFFFFF;

  --f-titulos: "Outfit Variable", "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-texto: "Manrope Variable", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-cursiva: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;

  --ancho: 40rem;
  --radio: 1.25rem;
}

/* --- Base --- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--f-texto);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--f-titulos);
  color: var(--titular);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

p { margin: 0 0 1rem; }

a {
  color: var(--titular);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

/* Cursiva serif para destacar palabras */
em.destacado,
.destacado {
  font-family: var(--f-cursiva);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* --- Accesibilidad --- */
:focus-visible {
  outline: 3px solid var(--titular);
  outline-offset: 3px;
  border-radius: 4px;
}

.saltar {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--titular);
  color: var(--blanco);
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
}

.saltar:focus { top: 1rem; }

.visualmente-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Datos que faltan: muy visibles a propósito */
.pendiente {
  display: inline-block;
  padding: 0 0.35em;
  background: #FFE45C;
  color: #2B1F00;
  border: 2px dashed #B00020;
  border-radius: 0.25rem;
  font-family: var(--f-texto);
  font-weight: 700;
  font-style: normal;
  line-height: 1.4;
}

/* --- Contenedor --- */
.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

main { flex: 1 0 auto; }

/* ==========================================================================
   Portada
   ========================================================================== */
.portada {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(2.5rem, 8vh, 5rem);
}

.portada__logo {
  width: min(20rem, 80vw);
  margin-inline: auto;
  height: auto;
}

.portada__lema {
  margin: 1.25rem 0 0;
  font-family: var(--f-titulos);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--titular);
}

.portada__lema span[aria-hidden] {
  color: var(--terracota);
  padding-inline: 0.15em;
}

.portada__mensaje {
  margin: clamp(2.5rem, 7vh, 4rem) 0 0;
  font-size: clamp(1.85rem, 7vw, 2.9rem);
  font-weight: 300;
  color: var(--titular);
}

.portada__mensaje .destacado { color: var(--oliva); }  /* #7D801B: 4:1, válido para texto grande */

.portada__despedida {
  margin: 1rem 0 0;
  font-size: 1.125rem;
  color: var(--texto-suave);
}

.portada__nota {
  max-width: 22rem;
  margin: 1.25rem auto 0;
  font-size: 0.875rem;          /* 14 px; 15,75 px en pantallas anchas */
  font-weight: 500;
  line-height: 1.5;
  color: var(--texto-suave);    /* 7,8:1 sobre el fondo */
  text-wrap: balance;
}

.portada__redes {
  max-width: 24rem;
  margin: 2rem auto 0.75rem;
  color: var(--texto);
  text-wrap: balance;
}

/* --- Enlace a Instagram (sin contenido incrustado) --- */
.enlace-ig {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;               /* área táctil ≥ 44 px */
  padding: 0.5rem 1.1rem 0.5rem 0.9rem;
  border: 1.5px solid var(--rosa);
  border-radius: 999px;
  color: var(--titular);             /* 5,1:1 */
  font-family: var(--f-titulos);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.enlace-ig:hover {
  background: var(--superficie);
  border-color: var(--terracota);
  color: #7C4C49;
  transform: translateY(-1px);
}

.icono-ig {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--terracota);           /* icono decorativo: 4:1, > 3:1 exigido */
  transition: transform 0.25s ease;
}

.enlace-ig:hover .icono-ig { transform: scale(1.08); }

.enlace-ig--pie {
  padding: 0.35rem 0.9rem 0.35rem 0.75rem;
  border-color: transparent;
  font-size: 0.95rem;
}

.pie__redes { margin: 0 0 0.75rem !important; }

@media (prefers-reduced-motion: reduce) {
  .enlace-ig, .icono-ig { transition: none; }
  .enlace-ig:hover, .enlace-ig:hover .icono-ig { transform: none; }
}

/* --- Ondas --- */
.olas {
  position: relative;
  width: 100%;
  height: clamp(5.5rem, 16vw, 9rem);
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  overflow: hidden;
  pointer-events: none;
}

.ola {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 200%;
  height: 100%;
  will-change: transform;
}

.ola svg {
  width: 100%;
  height: 100%;
}

.ola--1 { color: var(--arena);     opacity: 0.55; height: 100%; animation: deriva 48.3s linear infinite; }
.ola--2 { color: var(--rosa);      opacity: 0.9;  height: 82%;  animation: deriva 36.7s linear infinite reverse; }
.ola--3 { color: var(--terracota); opacity: 0.16; height: 70%;  animation: deriva 58.3s linear infinite; }
.ola--4 { color: var(--superficie); opacity: 1;   height: 52%;  animation: deriva 30s linear infinite reverse; }

@keyframes deriva {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Versión fija para las páginas legales */
.olas--fijas { height: 3.5rem; margin-top: 3rem; }
.olas--fijas .ola { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .ola { animation: none !important; }
}

/* --- Contacto e identificación --- */
.contacto {
  background: var(--superficie);
  padding-block: 1.5rem 3rem;
}

.contacto h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.ficha {
  margin: 0;
  padding: 1.5rem 1.25rem;
  background: var(--fondo);
  border-radius: var(--radio);
  box-shadow: 0 1px 0 rgba(146, 92, 89, 0.08), 0 10px 30px -18px rgba(146, 92, 89, 0.35);
}

.ficha__fila { padding-block: 0.7rem; }
.ficha__fila + .ficha__fila { border-top: 1px solid var(--rosa); }

.ficha dt {
  font-family: var(--f-titulos);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--titular);
}

.ficha dd {
  margin: 0.15rem 0 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ficha address { font-style: normal; }

/* ==========================================================================
   Páginas legales
   ========================================================================== */
.cabecera {
  padding-block: 1.5rem 0.5rem;
}

.cabecera a {
  display: inline-block;
  border-radius: 0.5rem;
}

.cabecera img {
  width: 10.5rem;
  height: auto;
}

.legal {
  padding-block: 1.5rem 1rem;
}

.legal h1 {
  font-size: clamp(1.85rem, 6vw, 2.5rem);
  font-weight: 300;
  margin-bottom: 0.5rem;
}

.legal .actualizado {
  color: var(--texto-suave);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.legal h2 {
  font-size: 1.3rem;
  font-weight: 500;
  margin-top: 2.25rem;
}

.legal h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 1.5rem;
}

.legal ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

.legal li { margin-bottom: 0.4rem; }
.legal li::marker { color: var(--terracota); }

.legal strong { font-weight: 700; }

.aviso {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--superficie);
  border-left: 4px solid var(--terracota);
  border-radius: 0 0.75rem 0.75rem 0;
}

.aviso p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Pie
   ========================================================================== */
.pie {
  background: var(--superficie);
  padding-block: 1.5rem 2rem;
  font-size: 0.95rem;
  color: var(--texto-suave);
  text-align: center;
}

.pie nav ul {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
}

.pie nav a {
  display: inline-block;
  padding: 0.5rem 0.25rem; /* área táctil cómoda */
  color: var(--titular);
}

.pie nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.pie p { margin: 0; }

/* En la portada el bloque de contacto llega hasta el pie, sin huecos */
.inicio main { display: flex; flex-direction: column; }
.inicio .contacto { flex: 1 0 auto; }

/* En la portada el bloque de contacto y el pie comparten fondo */
.contacto + .pie { padding-top: 0; }

/* ==========================================================================
   Pantallas más anchas
   ========================================================================== */
@media (min-width: 40em) {
  body { font-size: 1.125rem; }

  .ficha {
    padding: 1.75rem 2rem;
  }

  .ficha__fila {
    display: grid;
    grid-template-columns: 9.5rem 1fr;
    gap: 1rem;
    align-items: baseline;
  }

  .ficha dd { margin: 0; }
}

/* ==========================================================================
   Consentimiento de cookies (js/consentimiento.js)
   ========================================================================== */
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;          /* área táctil ≥ 44 px */
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--titular);
  border-radius: 999px;
  background: var(--titular);
  color: var(--blanco);         /* 5,1:1 */
  font: 600 1rem/1.2 var(--f-titulos);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.boton:hover { background: #7C4C49; border-color: #7C4C49; }

.boton--secundario {
  background: transparent;
  color: var(--titular);
}

.boton--secundario:hover { background: var(--superficie); color: #7C4C49; }

.boton:focus-visible,
.cookies-panel__cerrar:focus-visible,
.interruptor:focus-visible {
  outline: 3px solid var(--texto);
  outline-offset: 3px;
}

/* Primera capa: barra fija abajo; el script reserva su altura al final
   de la página para que no tape contenido. */
.cookies {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--fondo);
  border-top: 3px solid var(--rosa);
  box-shadow: 0 -8px 30px -12px rgba(62, 48, 46, 0.35);
  max-height: 60vh;
  overflow-y: auto;
}

.cookies__caja {
  max-width: 64rem;
  margin-inline: auto;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

.cookies__titulo {
  font-size: 1.05rem;
  font-weight: 500;
  margin: 0 0 0.25rem;
}

.cookies__texto {
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 0.7rem;
}

.cookies__botones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* los tres del mismo ancho */
  gap: 0.5rem;
}

.cookies__botones .boton,
.cookies-panel__botones .boton { padding-inline: 0.5rem; font-size: 0.95rem; }

@media (min-width: 48em) {
  .cookies__caja {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 2rem;
    align-items: center;
  }
  .cookies__titulo { grid-column: 1; }
  .cookies__texto { grid-column: 1; margin: 0; }
  .cookies__botones {
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: repeat(3, 9rem);
  }
}

/* Segunda capa */
.sin-scroll { overflow: hidden; }

.cookies-panel {
  width: calc(100% - 1.5rem);
  max-width: 34rem;
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  border: 0;
  border-radius: var(--radio);
  background: var(--fondo);
  color: var(--texto);
  box-shadow: 0 20px 60px -20px rgba(62, 48, 46, 0.5);
  overflow-y: auto;
}

.cookies-panel::backdrop { background: rgba(62, 48, 46, 0.5); }

.cookies-panel__form { padding: 1.25rem; }

.cookies-panel__cabecera {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cookies-panel h2 { font-size: 1.35rem; font-weight: 500; margin: 0.25rem 0 0.75rem; }

.cookies-panel p { font-size: 0.95rem; line-height: 1.55; }

.cookies-panel__cerrar {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--titular);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.cookies-panel__cerrar:hover { background: var(--superficie); }

.cookies-opcion {
  padding: 0.9rem 1rem 0.1rem;
  margin-bottom: 0.75rem;
  background: var(--superficie);
  border-radius: 0.9rem;
}

.cookies-opcion__fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.cookies-opcion h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.cookies-opcion label { cursor: pointer; }

.cookies-opcion__fija {
  font-size: 0.85rem;
  font-weight: 700;
  color: #4F5210;               /* oliva oscurecido: 7:1 sobre la superficie */
  white-space: nowrap;
}

/* Interruptor accesible (checkbox con role="switch") */
.interruptor {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex-shrink: 0;
  width: 3.25rem;
  height: 1.875rem;
  margin: 0;
  border: 2px solid #6E5B58;
  border-radius: 999px;
  background: #E9E1DE;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.interruptor::before {
  content: "";
  position: absolute;
  top: 0.1875rem;
  left: 0.1875rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #6E5B58;
  transition: transform 0.2s, background-color 0.2s;
}

.interruptor:checked {
  background: var(--oliva);
  border-color: var(--oliva);
}

.interruptor:checked::before {
  background: var(--blanco);
  transform: translateX(1.375rem);
}

.cookies-panel__botones {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.cookies-panel__botones .boton--secundario { grid-column: 1 / -1; }

@media (prefers-reduced-motion: reduce) {
  .interruptor,
  .interruptor::before { transition: none; }
}

/* Tabla de la política de cookies */
.tabla-scroll {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid var(--rosa);
}

.tabla-scroll table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
}

.tabla-scroll caption {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--titular);
}

.tabla-scroll th,
.tabla-scroll td {
  padding: 0.65rem 1rem;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--rosa);
}

.tabla-scroll thead th {
  background: var(--superficie);
  font-family: var(--f-titulos);
  font-weight: 600;
  color: var(--titular);
}

.tabla-scroll code { font-size: 0.9em; overflow-wrap: anywhere; }
