/* =====================================================================
   Estilos del sitio
   Paleta: gris #2B2F36, azul #3475F2, terracota #F25234, amarillo #F2B134.
   Los colores se cambian en el bloque :root de abajo.
   ===================================================================== */

:root {
  /* Paleta de la empresa */
  --neutro: #2b2f36;        /* gris concreto: encabezado, portada y pie (letra blanca) */
  --azul: #3475f2;
  --terracota: #f25234;
  --amarillo: #f2b134;      /* botón principal; va con letra oscura */
  /* Variantes para legibilidad */
  --azul-texto: #2a62d1;    /* el mismo azul un poco más oscuro, para ligas sobre fondo blanco */
  --azul-hover: #2a62d1;
  --amarillo-hover: #f5c25c;
  --texto: #2b2f36;
  --texto-suave: #555b66;
  --fondo: #ffffff;
  --fondo-alt: #f5f3f0;
  --superficie: #ffffff;    /* tarjetas y recuadros */
  --borde: #e2ded8;
  --icono-fondo: #2b2f36;
  --icono-color: #ffffff;
  --radio: 14px;
  --sombra: 0 6px 24px rgba(43, 47, 54, 0.10);
  --ancho: 1120px;
  --fuente: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

/* ---------- Modo oscuro ----------
   Se activa con el botón del encabezado o, si el visitante no ha elegido,
   según la preferencia de su dispositivo. El encabezado, la portada y el pie
   conservan el gris de la empresa en ambos modos. */
:root[data-tema="oscuro"] {
  --texto: #ecedef;
  --texto-suave: #a3a8b1;
  --fondo: #15171b;
  --fondo-alt: #191b20;
  --superficie: #1e2127;
  --borde: #2d3138;
  --azul-texto: #8aaef8;    /* azul aclarado para que las ligas se lean sobre fondo oscuro */
  --icono-fondo: #2a2e35;
  --icono-color: #8aaef8;
  --sombra: 0 6px 24px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--texto);
  background: var(--fondo);
}
img { max-width: 100%; display: block; }
a { color: var(--azul-texto); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.contenedor { width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto; }
.saltar {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #fff; color: var(--texto); padding: .6rem 1rem;
}
.saltar:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 3px solid var(--azul); outline-offset: 3px; }

/* ---------- Fondo de marca ---------- */
.fondo-marca {
  color: #fff;
  background: var(--neutro);
}
.fondo-marca a { color: #fff; }

/* ---------- Encabezado ---------- */
.encabezado {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 4px solid var(--azul);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15);
}
.encabezado .contenedor {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 72px;
}
.marca { display: flex; align-items: center; text-decoration: none; }
.marca img { max-height: 48px; width: auto; }
.marca-texto { font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; }
.encabezado-acciones { display: flex; align-items: center; gap: .5rem; order: 3; }
.encabezado .menu { order: 2; margin-left: auto; }
.tema-boton {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .45); cursor: pointer;
}
.tema-boton:hover { background: rgba(255, 255, 255, .15); }
.tema-boton svg { width: 20px; height: 20px; }
.tema-boton .icono-sol { display: none; }
:root[data-tema="oscuro"] .tema-boton .icono-sol { display: block; }
:root[data-tema="oscuro"] .tema-boton .icono-luna { display: none; }
.menu ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.menu a {
  display: block; padding: .5rem .8rem; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.menu a:hover { background: rgba(255, 255, 255, .18); }
.menu-boton {
  display: none; background: none; border: 2px solid #fff; color: #fff;
  border-radius: 8px; padding: .4rem .7rem; font: inherit; font-weight: 700; cursor: pointer;
}

/* ---------- Portada ---------- */
.hero { padding: clamp(4rem, 9vw, 6.5rem) 0; position: relative; }
.hero-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 3.5rem; }
.hero-texto { flex: 1 1 460px; min-width: 0; }
.hero-etiqueta {
  display: inline-block; font-size: .9rem; font-weight: 700; color: #e4e6ea;
  border: 1px solid rgba(255, 255, 255, .3); padding: .35rem .8rem; border-radius: 999px; margin-bottom: 1.5rem;
}
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.08; letter-spacing: -.02em; max-width: 18ch; }
.hero p { font-size: clamp(1.1rem, 2vw, 1.2rem); max-width: 52ch; margin: 0 0 2rem; color: #e4e6ea; }
.hero-panel {
  flex: 1 1 400px; min-width: 0; height: 420px; position: relative; overflow: hidden;
  border-radius: 16px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .22);
}
.hero-panel svg { width: 100%; height: 100%; display: block; }
.hero-panel img { width: 100%; height: 100%; object-fit: cover; }
/* Franja de colores al pie de la portada y arriba del pie de página */
.hero::after, .pie::before {
  content: ""; position: absolute; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg,
    var(--azul) 0 33.3%, var(--terracota) 33.3% 66.6%, var(--amarillo) 66.6% 100%);
}
.hero::after { bottom: 0; }
.pie { position: relative; }
.pie::before { top: 0; }
.acciones { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 999px;
  font-weight: 700; font-size: 1.05rem; text-decoration: none;
  border: 2px solid transparent; transition: transform .15s, background .15s;
}
.boton:hover { transform: translateY(-2px); }
.boton-verde { background: var(--azul); color: #fff; }
.boton-verde:hover { background: var(--azul-hover); }
.boton-borde { border-color: #fff; color: #fff; }
.boton-borde:hover { background: rgba(255, 255, 255, .15); }
.boton-azul { background: var(--azul); color: #fff; }
.boton-acento, .fondo-marca .boton-acento { background: var(--amarillo); color: var(--neutro); }
.boton-acento:hover { background: var(--amarillo-hover); }

/* ---------- Secciones ---------- */
.seccion { padding: clamp(3rem, 7vw, 5rem) 0; }
.seccion-alt { background: var(--fondo-alt); }
.encabezado-seccion { margin-bottom: 2rem; }
.encabezado-seccion p { color: var(--texto-suave); margin: 0; max-width: 60ch; }
.raya {
  display: block; width: 64px; height: 6px; border-radius: 3px; margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--azul) 50%, var(--terracota) 50%);
}
.nosotros-texto { font-size: 1.15rem; max-width: 70ch; white-space: pre-line; }

/* Tarjetas de servicios */
.tarjetas {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.5rem; box-shadow: var(--sombra); border-top: 6px solid var(--azul);
}
.tarjeta:nth-child(even) { border-top-color: var(--terracota); }
.tarjeta-icono {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--icono-fondo); color: var(--icono-color); margin-bottom: .9rem;
}
.tarjeta-icono svg { width: 24px; height: 24px; }
.tarjeta h3 { font-size: 1.2rem; }
.tarjeta p { margin: 0; color: var(--texto-suave); }

/* ---------- Galería ---------- */
.galeria {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.galeria-item { margin: 0; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.galeria-enlace { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--fondo-alt); }
.galeria-enlace img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.galeria-enlace:hover img { transform: scale(1.04); }
.galeria-pdf {
  height: 100%; display: grid; place-items: center;
  background: var(--neutro);
  border-bottom: 6px solid var(--terracota);
}
.galeria-pdf span {
  background: #fff; color: var(--neutro); font-weight: 700;
  padding: .6rem 1.2rem; border-radius: 8px; font-size: 1.3rem;
}
.galeria-item figcaption { padding: .75rem 1rem; font-weight: 700; font-size: .98rem; }

/* Visor de imágenes */
.visor {
  border: none; padding: 0; background: transparent; max-width: 95vw; max-height: 95vh;
}
.visor::backdrop { background: rgba(5, 15, 30, .88); }
.visor img { max-width: 95vw; max-height: 80vh; margin: 0 auto; border-radius: 8px; background: #fff; }
.visor-barra {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  color: #fff; padding: .75rem 0 0; flex-wrap: wrap;
}
.visor-titulo { font-weight: 700; }
.visor-barra a, .visor-cerrar {
  color: #fff; background: rgba(255, 255, 255, .15); border: none; border-radius: 8px;
  padding: .5rem .9rem; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}

/* ---------- Contacto ---------- */
.contacto-grid {
  display: grid; gap: 2rem; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.6fr);
  align-items: start;
}
.datos { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1rem; }
.datos li {
  display: grid; grid-template-columns: 44px 1fr; gap: .9rem; align-items: start;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem;
}
.datos .icono {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--icono-fondo); color: var(--icono-color);
}
.datos .icono svg { width: 22px; height: 22px; }
.datos .etiqueta { display: block; font-size: .85rem; color: var(--texto-suave); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.datos a, .datos span.valor { font-weight: 700; color: var(--texto); text-decoration: none; word-break: break-word; }
.datos a:hover { color: var(--azul-texto); text-decoration: underline; }
.mapa-incrustado iframe { width: 100%; height: 260px; border: 0; border-radius: var(--radio); }

.marco-formulario {
  background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra);
  border: 1px solid var(--borde); overflow: hidden;
}
.marco-formulario iframe { width: 100%; height: 900px; border: 0; display: block; }
.marco-titulo { padding: 1rem 1.25rem; margin: 0; font-size: 1.15rem; }
.nota-privacidad { font-size: .92rem; color: var(--texto-suave); padding: 0 1.25rem 1rem; margin: 0; }
.aviso-config {
  margin: 1.25rem; padding: 1rem 1.25rem; border-radius: 10px;
  background: #fff8e1; border: 2px dashed #e0a800; color: #5c4400;
}
/* El formulario de Microsoft Forms se ve siempre claro: Microsoft no ofrece modo oscuro
   en los formularios incrustados, así que se le deja su propio fondo blanco. */
.formulario-ms { background: #ffffff; }
.pie h2.pie-titulo { color: var(--amarillo); font-size: 1rem; }

/* ---------- Páginas interiores ---------- */
.cabecera-pagina { padding: 3rem 0 2.5rem; }
.cabecera-pagina h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0; }
.cabecera-pagina p { margin: .5rem 0 0; max-width: 60ch; }
.texto-legal { max-width: 78ch; }
.texto-legal h2 { font-size: 1.3rem; margin-top: 2rem; color: var(--azul-texto); }
.texto-legal li { margin-bottom: .4rem; }
.resalte { background: #fff3c4; padding: 0 .2em; border-radius: 3px; }

/* ---------- Pie ---------- */
.pie { padding: 3rem 0 1.5rem; }
.pie-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.pie h2 { font-size: 1.1rem; }
.pie ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pie a { text-decoration: underline; text-underline-offset: 3px; }
.pie .redes { display: flex; gap: 1rem; }
.pie-legal {
  border-top: 1px solid rgba(255, 255, 255, .3); margin-top: 2rem; padding-top: 1rem;
  font-size: .92rem;
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-flotante {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--azul); color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
  transition: transform .15s, background .15s;
}
.whatsapp-flotante:hover { transform: scale(1.08); background: var(--azul-hover); }
.whatsapp-flotante svg { width: 32px; height: 32px; }

/* ---------- Celular ---------- */
@media (max-width: 860px) {
  .contacto-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .menu-boton { display: inline-block; }
  .menu {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--neutro); display: none; border-bottom: 4px solid var(--azul);
  }
  .menu.abierto { display: block; }
  .menu ul { flex-direction: column; padding: .5rem 1.25rem 1rem; }
  .encabezado .contenedor { position: relative; }
  .marco-formulario iframe { height: 1000px; }
  .hero-panel { height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
