/* Farmacia Aurum Madrid Sur — «Día y noche»
   Una farmacia que no cierra nunca: la web cambia sola con la hora de Madrid. De 9:00 a 21:00, clara (blanco frío y
   azul Aurum); de 21:00 a 9:00, modo noche en azul oscuro, con la cruz verde del rótulo como única luz. Detalles
   propios: la franja de las 24 horas siempre llena con la marca de «ahora», la cruz de farmacia como señal de sección
   (contorno de día, encendida de noche) y las bandas oscuras de «De noche» y «Cómo llegar» en los dos modos.
   Colores Aurum (manual de marca): azul Pantone 285 C, cian 801 y verde 375; el cian y el verde, solo sobre oscuro. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("/assets/fonts/lexend-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Fijos (los dos modos) */
  --noche: #0a1a2b;          /* azul noche: franja, bandas oscuras, pie */
  --noche-2: #10263c;
  --azul: #1375bc;           /* azul Aurum (Pantone 285 C) */
  --cian: #00aeef;           /* cian Aurum (801): solo sobre oscuro */
  --verde: #8cc63f;          /* verde Aurum (375): solo sobre oscuro; la cruz encendida */
  --sobre-noche: #c9d8e6;
  --filete-noche: rgba(255, 255, 255, 0.16);

  /* Día */
  --fondo: #f5f8fb;
  --superficie: #ffffff;
  --suave: #e8f0f7;
  --tinta: #0a1a2b;
  --tinta-2: #3b4f63;        /* 8:1 sobre el fondo */
  --enlace: #0e5f9c;         /* azul Aurum oscurecido para texto (6,6:1) */
  --filete: #d3dee9;
  --cruz-relleno: none;
  --cruz-trazo: var(--azul);
  --foto-filtro: none;

  --ancho: 76rem;
  --titulares: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --texto: "Lexend", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

/* Noche (21:00 – 9:00, o si se pulsa «Ver de noche») */
:root[data-modo="noche"] {
  --fondo: #0a1a2b;
  --superficie: #10263c;
  --suave: #0e2236;
  --tinta: #eaf2f8;
  --tinta-2: #b9cad9;
  --enlace: #6fd0f7;
  --filete: #23405c;
  --cruz-relleno: var(--verde);
  --cruz-trazo: var(--verde);
  --foto-filtro: brightness(0.86);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--texto);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--tinta);
  background: var(--fondo);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--enlace); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a[href^="tel:"], a[href^="https://wa.me"] { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--cian); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--titulares); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
address { font-style: normal; }
ul, ol { padding: 0; }

.sprite { display: none; }
.saltar { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--superficie); color: var(--tinta); padding: 0.6rem 1rem; font-weight: 600; }
.saltar:focus { left: 8px; }
.contenedor { width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto; }
.cifras { font-variant-numeric: tabular-nums; }

/* Cruz de farmacia: señal de cada sección. De día, en contorno azul; de noche, encendida en verde. */
.cruz { width: 1.05em; height: 1.05em; flex: none; fill: var(--cruz-relleno); stroke: var(--cruz-trazo); stroke-width: 1.6; overflow: visible; }
.antetitulo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--enlace);
  margin-bottom: 1rem;
}
.entradilla { font-size: clamp(1.2rem, 1.1rem + 0.35vw, 1.35rem); line-height: 1.55; color: var(--tinta-2); max-width: 40ch; }
.nota { margin-top: 1.5rem; font-size: 1rem; color: var(--tinta-2); }

/* ---------- Botones ---------- */
.botones { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 3.4rem;
  padding: 0.6rem 1.4rem;
  border: 2px solid var(--tinta);
  border-radius: 4px;
  background: var(--superficie);
  color: var(--tinta);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.boton svg { width: 1.3em; height: 1.3em; flex: none; }
.boton:hover { background: var(--tinta); color: var(--fondo); }
.boton-principal { background: var(--azul); border-color: var(--azul); color: #fff; }
.boton-principal:hover { background: var(--noche); border-color: var(--noche); color: #fff; }
:root[data-modo="noche"] .boton-principal { background: var(--verde); border-color: var(--verde); color: var(--noche); }
:root[data-modo="noche"] .boton-principal:hover { background: #fff; border-color: #fff; color: var(--noche); }
.boton-pequeno { min-height: 2.8rem; padding: 0.4rem 1rem; }
.boton-claro { background: #fff; border-color: #fff; color: var(--noche); }
.boton-claro:hover { background: var(--verde); border-color: var(--verde); color: var(--noche); }
.boton-contorno { background: transparent; border-color: #fff; color: #fff; }
.boton-contorno:hover { background: #fff; color: var(--noche); }
.icono-wa { color: #25d366; }
.boton:hover .icono-wa { color: inherit; }
.enlace { font-weight: 600; }

/* ---------- Franja superior (siempre de noche) ---------- */
.franja { background: var(--noche); color: var(--sobre-noche); font-size: 1rem; }
.franja .contenedor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; padding-block: 0.5rem; }
.franja a { color: #fff; text-decoration: none; font-weight: 500; }
.franja a:hover { text-decoration: underline; }
.franja-der { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; }
.estado { display: inline-flex; align-items: center; gap: 0.45em; font-weight: 600; color: var(--verde); }
.luz { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--verde); }
.boton-modo { font: inherit; font-size: 0.95rem; font-weight: 500; color: #fff; background: none; border: 1px solid var(--filete-noche); border-radius: 4px; padding: 0.2rem 0.7rem; cursor: pointer; }
.boton-modo:hover { border-color: #fff; }

/* ---------- Cabecera ---------- */
.cabecera { background: var(--superficie); border-bottom: 1px solid var(--filete); }
.cabecera .contenedor { display: flex; align-items: center; gap: 1.5rem; padding-block: 0.85rem; }
.marca { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--tinta); margin-right: auto; }
.marca img { width: auto; height: 3.3rem; }
.marca-texto { display: grid; line-height: 1; }
.marca-nombre { font-family: var(--titulares); font-weight: 700; font-size: 1.6rem; letter-spacing: -0.02em; }
.marca-lugar { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--enlace); margin-top: 0.35rem; }
.nav { display: flex; gap: 1.6rem; }
.nav a { color: var(--tinta); font-weight: 500; text-decoration: none; padding-block: 0.4rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--cian); }
.cabecera-der { display: flex; align-items: center; gap: 0.75rem; }
.boton-menu { display: none; }

/* ---------- Portada ---------- */
.portada { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); }
.portada-rejilla { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.portada h1 { font-size: clamp(2.9rem, 1.8rem + 4vw, 5.2rem); font-weight: 800; margin-bottom: 1.4rem; }
.portada h1 span { display: block; font-weight: 500; color: var(--enlace); font-size: 0.62em; letter-spacing: -0.01em; margin-top: 0.45rem; }
.portada .entradilla { margin-bottom: 2rem; }

.foto img { width: 100%; height: auto; filter: var(--foto-filtro); border: 1px solid var(--filete); }
figcaption { font-size: 0.95rem; color: var(--tinta-2); margin-top: 0.7rem; padding-left: 0.8rem; border-left: 3px solid var(--azul); }
:root[data-modo="noche"] figcaption, .seccion-noche figcaption { border-left-color: var(--verde); }

/* Franja de las 24 horas: siempre llena; la marca dice qué hora es */
.dia { margin-top: clamp(2.5rem, 5vw, 4rem); }
.dia-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 1.5rem; }
.dia-titulo { font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.8rem); font-weight: 600; }
.dia-ahora { font-weight: 600; color: var(--enlace); }
.dia-barra { position: relative; height: 1.1rem; background: var(--suave); }
.dia-relleno { position: absolute; inset: 0; background: var(--azul); }
:root[data-modo="noche"] .dia-relleno { background: var(--verde); }
.dia-marca { position: absolute; top: -0.45rem; bottom: -0.45rem; width: 4px; margin-left: -2px; background: var(--tinta); }
.dia-marca::before { content: ""; position: absolute; top: -0.55rem; left: 50%; translate: -50% 0; border: 0.45rem solid transparent; border-top-color: var(--tinta); border-bottom: 0; }
.dia-horas { list-style: none; display: flex; justify-content: space-between; margin-top: 0.55rem; font-size: 0.95rem; color: var(--tinta-2); }
.dia-horas li { width: 2ch; text-align: center; }
.dia-horas li:first-child { text-align: left; }
.dia-horas li:last-child { text-align: right; }

.datos { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--filete); }
.dato { padding: 1.3rem 1.5rem 0.3rem 0; }
.dato + .dato { padding-left: 1.5rem; border-left: 1px solid var(--filete); }
.dato h2 { font-family: var(--texto); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--enlace); margin-bottom: 0.4rem; }
.dato-valor { font-family: var(--titulares); font-weight: 700; font-size: clamp(1.6rem, 1.4rem + 0.8vw, 2.1rem); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 0.3rem; }
.dato-valor a { color: var(--tinta); text-decoration: none; }
.dato p:not(.dato-valor) { color: var(--tinta-2); }

/* ---------- Secciones ---------- */
.seccion { padding-block: clamp(3.5rem, 8vw, 6rem); }
.seccion-suave { background: var(--suave); }
.titulo-seccion { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); margin-bottom: 1.2rem; }
.seccion-cabeza { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.seccion-cabeza .entradilla { max-width: none; }

/* Bandas de noche (iguales en los dos modos): «De noche» y «Cómo llegar» */
.seccion-noche { background: var(--noche); color: #fff; --enlace: #6fd0f7; --tinta-2: var(--sobre-noche); --filete: var(--filete-noche); }
/* De noche el fondo ya es oscuro: las bandas y el pie bajan un tono para que se sigan distinguiendo */
:root[data-modo="noche"] .seccion-noche, :root[data-modo="noche"] .pie, :root[data-modo="noche"] .franja { background: #050f1a; }
.seccion-noche .antetitulo { color: var(--verde); }
.seccion-noche .cruz { fill: var(--verde); stroke: var(--verde); }
.seccion-noche a:not(.boton) { color: #fff; text-decoration-color: var(--verde); }
.seccion-noche .foto img { filter: none; border-color: var(--filete-noche); }
.noche-rejilla { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.noche-texto p + p { margin-top: 1rem; }
.noche-texto p:not(.antetitulo) { color: var(--sobre-noche); max-width: 46ch; }

/* Servicios */
.servicios { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2.5rem; }
.servicios li { padding: 1.3rem 0 1.5rem; border-top: 2px solid var(--tinta); }
.servicios h3 { font-size: clamp(1.35rem, 1.2rem + 0.4vw, 1.6rem); margin-bottom: 0.45rem; }
.servicios p { color: var(--tinta-2); }

/* La farmacia */
.farmacia-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.farmacia-texto { grid-row: 1 / span 2; align-self: center; }
.farmacia-texto p + p { margin-top: 1rem; }
.farmacia-foto-2 { width: 70%; justify-self: end; }
.hermana { padding-top: 1rem; border-top: 1px solid var(--filete); color: var(--tinta-2); }

/* Equipo */
.equipo { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2.5rem; }
.equipo li { display: grid; padding: 1rem 0 1.1rem; border-top: 1px solid var(--filete); }
.equipo-nombre { font-family: var(--titulares); font-weight: 600; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.01em; }
.equipo-cargo { font-size: 0.95rem; color: var(--tinta-2); margin-top: 0.2rem; }
.equipo-titular { border-top: 2px solid var(--tinta) !important; }
.equipo-titular .equipo-cargo { color: var(--enlace); font-weight: 600; }
.equipo-grupo + .equipo-grupo { margin-top: clamp(2rem, 4vw, 2.75rem); }
.equipo-grupo-titulo { font-family: var(--texto); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--enlace); margin-bottom: 0.7rem; }
.equipo-fila { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 2.5rem; margin-top: clamp(2rem, 4vw, 2.75rem); }
.equipo-fila .equipo-grupo + .equipo-grupo { margin-top: 0; }
.equipo-fila .equipo-grupo:first-child .equipo { grid-template-columns: 1fr; }
.equipo-fila .equipo-grupo:last-child { grid-column: span 2; }
.equipo-fila .equipo-grupo:last-child .equipo { grid-template-columns: 1fr 1fr; }

/* Cómo llegar */
.visita-rejilla { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2.5rem, 5vw, 4rem); align-items: start; }
.visita address { font-size: 1.25rem; color: var(--sobre-noche); margin-bottom: 1.75rem; }
.datos-contacto { display: grid; gap: 0.55rem; margin-bottom: 2rem; }
.datos-contacto div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--filete-noche); }
.datos-contacto dt { color: var(--sobre-noche); }
.datos-contacto dd { font-weight: 500; overflow-wrap: anywhere; }
.mapa { aspect-ratio: 4 / 3; background: var(--noche-2); border: 1px solid var(--filete-noche); }
.mapa iframe { display: block; width: 100%; height: 100%; border: 0; }
.mapa-aviso { height: 100%; display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 2rem 1.25rem; text-align: center; }
.mapa-aviso p { max-width: 46ch; font-size: 1rem; color: var(--sobre-noche); }
.mapa-aviso .mapa-titulo { font-family: var(--titulares); font-weight: 700; font-size: 1.6rem; color: #fff; }

/* ---------- Pie (siempre de noche) ---------- */
.pie { background: var(--noche); color: var(--sobre-noche); padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem; border-top: 1px solid var(--filete-noche); }
.pie-cabeza { display: flex; align-items: center; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--filete-noche); }
.pie-cabeza img { width: 8.5rem; height: auto; flex: none; }
.pie-lema { font-family: var(--titulares); font-weight: 600; font-size: clamp(1.5rem, 1.3rem + 0.7vw, 2rem); line-height: 1.2; color: #fff; }
.pie-rejilla { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr 1fr; gap: 2rem; padding-block: 2rem; }
.pie h2 { font-family: var(--texto); font-size: 0.9rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--verde); margin-bottom: 0.6rem; }
.pie ul { list-style: none; }
.pie a { color: #fff; overflow-wrap: anywhere; }
.pie-final { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--filete-noche); font-size: 1rem; }
.pie-final nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

.barra-movil { display: none; }

/* ---------- Páginas legales y 404 ---------- */
.legal { padding-block: clamp(2.5rem, 6vw, 5rem); }
.legal .contenedor { max-width: 48rem; }
.legal h1 { font-size: clamp(2.4rem, 1.8rem + 2.2vw, 3.4rem); margin-bottom: 0.75rem; }
.legal .actualizado { color: var(--tinta-2); font-size: 1rem; margin-bottom: 2.5rem; }
.legal h2 { font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.9rem); margin: 2.5rem 0 0.9rem; padding-top: 1.5rem; border-top: 1px solid var(--filete); }
.legal p + p { margin-top: 1rem; }
.legal ul { padding-left: 1.25rem; }
.legal li { margin-bottom: 0.4rem; }
.volver { display: inline-block; margin-bottom: 2rem; font-weight: 600; }
.error { padding-block: clamp(3rem, 10vw, 7rem); }
.error .contenedor { display: grid; gap: 1.25rem; justify-items: start; }
.error h1 { font-size: clamp(2.8rem, 2rem + 3vw, 4.4rem); }
.error p:not(.antetitulo) { max-width: 52ch; color: var(--tinta-2); }

/* Marca de dato pendiente: visible a propósito hasta que se rellene */
mark.pendiente { background: #ffe58a; color: #0a1a2b; padding: 0 0.2em; }

/* ---------- Tableta ---------- */
@media (max-width: 1080px) {
  .nav { gap: 1.1rem; }
  .boton-llamar { display: none; }
  .servicios, .equipo { grid-template-columns: 1fr 1fr; }
  .equipo-fila { grid-template-columns: 1fr 1fr; }
  .equipo-fila .equipo-grupo:last-child { grid-column: auto; }
  .equipo-fila .equipo-grupo:last-child .equipo { grid-template-columns: 1fr; }
}

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .boton-menu {
    display: inline-flex;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.4rem 0.9rem;
    border: 2px solid var(--tinta);
    border-radius: 4px;
    background: var(--superficie);
    color: var(--tinta);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }
  .cabecera .contenedor { flex-wrap: wrap; gap: 0.75rem; }
  .nav { display: none; order: 3; width: 100%; flex-direction: column; gap: 0; border-top: 1px solid var(--filete); }
  .nav[data-abierto] { display: flex; }
  .nav a { padding: 0.9rem 0; border-bottom: 1px solid var(--filete); font-size: 1.2rem; }

  .portada-rejilla, .noche-rejilla, .farmacia-rejilla, .visita-rejilla { grid-template-columns: 1fr; }
  .farmacia-texto { grid-row: auto; }
  .farmacia-foto-2 { width: 80%; }
  .datos { grid-template-columns: 1fr; }
  .dato, .dato + .dato { padding: 1.1rem 0 0.9rem; border-left: 0; }
  .dato + .dato { border-top: 1px solid var(--filete); }
  .pie-rejilla { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  body { padding-bottom: 4.6rem; }
  .franja-dir, .franja-der a { display: none; }
  .barra-movil {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    background: var(--noche);
    border-top: 1px solid var(--filete-noche);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .barra-movil a { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0.65rem 0.25rem; color: #fff; font-size: 1rem; font-weight: 600; text-decoration: none; }
  .barra-movil a + a { border-left: 1px solid var(--filete-noche); }
  .barra-movil svg { width: 1.5rem; height: 1.5rem; }
  .marca img { height: 2.7rem; }
  .marca-nombre { font-size: 1.35rem; }
  .marca-lugar { font-size: 0.72rem; letter-spacing: 0.08em; }
  .botones .boton { flex: 1 1 100%; }
  .dia-horas li:nth-child(even) { visibility: hidden; }
  .servicios, .equipo { grid-template-columns: 1fr; }
  .equipo-fila { grid-template-columns: 1fr; }
  .equipo-fila .equipo-grupo + .equipo-grupo { margin-top: 2rem; }
  .equipo-fila .equipo-grupo:last-child .equipo { grid-template-columns: 1fr; }
  .pie-cabeza { flex-direction: column; align-items: flex-start; }
  .pie-rejilla { grid-template-columns: 1fr; gap: 1.5rem; }
  .pie li { padding-block: 0.2rem; }
  .datos-contacto div { grid-template-columns: 1fr; gap: 0; }
}
