/* ==========================================================================
   Grado Ventanas — style.css
   CSS puro escrito a mano, sin frameworks. Mobile-first, optimizado para
   Core Web Vitals. El CSS crítico (cabecera y hero) también se incluye
   inline en el <head> de cada página para evitar render-blocking.
   ========================================================================== */

@font-face {
  font-family: "dd-light";
  src: url("../fonts/dd-light.woff2") format("woff2"),
       url("../fonts/dd-light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ---------- Variables globales ---------- */
:root {
  --azul: #1f4e79;
  --azul-oscuro: #16395a;
  --azul-claro: #3b82c4;
  --blanco: #ffffff;
  --gris: #4a5568;
  --gris-oscuro: #1a202c;
  --fondo: #f5f7fa;
  --borde: #e6ebf2;
  --radio: 14px;
  --sombra: 0 8px 24px rgba(26, 32, 44, 0.08);
  --container: min(1180px, 100% - 2.5rem);
  --fuente: "dd-light", "Segoe UI", Arial, sans-serif;
}

/* ---------- Reset básico ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.075rem);
  line-height: 1.65;
  color: var(--gris-oscuro);
  background: var(--blanco);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { line-height: 1.18; color: var(--azul); margin: 0 0 0.55em; font-weight: 700; }
h1 { font-size: clamp(1.85rem, 4.2vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); }

p { margin: 0 0 1rem; }

a { color: var(--azul); }

address { font-style: normal; }

main { flex: 1; }

.container { width: var(--container); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--azul); color: #fff; padding: 0.8rem 1.2rem;
  border-radius: 0 0 var(--radio) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.85rem 1.6rem; border-radius: var(--radio);
  text-decoration: none; font-weight: 700; font-family: inherit; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primario { background: var(--azul); color: #fff; }
.btn-primario:hover, .btn-primario:focus { background: var(--azul-oscuro); }
.btn-secundario { background: #fff; color: var(--azul); border-color: var(--azul); }
.btn-secundario:hover, .btn-secundario:focus { background: var(--fondo); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: #fff;
  box-shadow: 0 1px 0 rgba(26, 32, 44, 0.08);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 76px; }
.brand { display: inline-flex; align-items: center; }
.brand img { width: 150px; height: auto; }

.main-nav { display: none; margin-left: auto; align-items: center; gap: 0.15rem; }
.main-nav a {
  padding: 0.6rem 0.75rem; text-decoration: none; font-weight: 600;
  color: var(--gris-oscuro); min-height: 48px; display: inline-flex; align-items: center;
}
.main-nav a:hover, .main-nav a:focus { color: var(--azul); }
.main-nav .btn-cta {
  background: var(--azul); color: #fff; border-radius: var(--radio);
  padding: 0.7rem 1.35rem; margin-left: 0.5rem;
}
.main-nav .btn-cta:hover { background: var(--azul-oscuro); color: #fff; }

.nav-toggle {
  margin-left: auto; background: none; border: 0; width: 48px; height: 48px;
  cursor: pointer; display: flex; flex-direction: column; justify-content: center;
  gap: 6px; align-items: center;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  content: ""; display: block; width: 26px; height: 3px; background: var(--azul);
  border-radius: 2px; position: relative;
}
.nav-toggle-bar::before { position: absolute; top: -8px; }
.nav-toggle-bar::after { position: absolute; top: 8px; }

/* ---------- Panel lateral móvil ---------- */
.menu-drawer {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(320px, 85vw);
  background: #fff; transform: translateX(100%); transition: transform 0.28s ease;
  z-index: 60; box-shadow: -12px 0 32px rgba(26, 32, 44, 0.18);
  padding: 1rem; overflow-y: auto;
}
.menu-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.drawer-title { font-weight: 700; color: var(--azul); font-size: 1.15rem; }
.drawer-close {
  width: 48px; height: 48px; background: none; border: 0; font-size: 1.5rem;
  cursor: pointer; color: var(--gris-oscuro); line-height: 1;
}
.drawer-nav { display: flex; flex-direction: column; gap: 0.15rem; }
.drawer-nav a {
  padding: 0.9rem 0.75rem; text-decoration: none; color: var(--gris-oscuro);
  font-weight: 600; min-height: 48px; border-bottom: 1px solid var(--borde);
  display: flex; align-items: center;
}
.drawer-nav a:hover { color: var(--azul); }
.drawer-nav .btn-cta {
  margin-top: 0.75rem; background: var(--azul); color: #fff; border: 0;
  justify-content: center; border-radius: var(--radio);
}
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(26, 32, 44, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.28s; z-index: 55;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

@media (min-width: 1024px) {
  .main-nav { display: flex; }
  .nav-toggle { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(115deg, #e9f1f9 0%, #f5f7fa 55%, #ffffff 100%);
  padding: clamp(2.75rem, 7vw, 5.5rem) 0; overflow: hidden;
}
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3.3rem); margin-bottom: 0.45em; }
.hero .lead { font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--gris); max-width: 62ch; }
.hero-imagen img { border-radius: var(--radio); box-shadow: var(--sombra); width: 100%; }
.hero-acciones { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.5rem; }
.hero-sello {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 1.5rem;
  color: var(--azul); font-weight: 700; font-size: 0.95rem;
}
.hero-sello span { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 48px; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}

/* ---------- Secciones ---------- */
.seccion { padding: clamp(2.75rem, 6vw, 4.75rem) 0; }
.seccion-alt { background: var(--fondo); }
.titulo-seccion { text-align: center; margin-bottom: 0.35em; }
.subtitulo-seccion {
  text-align: center; color: var(--gris); max-width: 65ch; margin: 0 auto 2.25rem;
}

.grid-2 { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
.grid-3 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid-4 { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }

@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; align-items: center; }
}

/* ---------- Tarjetas ---------- */
.card {
  background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.5rem; box-shadow: var(--sombra);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.card img { border-radius: calc(var(--radio) - 4px); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card h3 { margin: 0; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { color: var(--gris); margin: 0; flex: 1; }
.card .btn { align-self: flex-start; }

/* ---------- Beneficios ---------- */
.beneficio {
  display: flex; gap: 1rem; background: #fff; border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 1.25rem; box-shadow: var(--sombra);
}
.beneficio h3 { font-size: 1.05rem; margin-bottom: 0.25em; }
.beneficio p { margin: 0; color: var(--gris); font-size: 0.95rem; }

/* ---------- Chips de localidades ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.65rem; justify-content: center; }
.chip {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0.6rem 1.25rem;
  background: #fff; border: 1px solid var(--borde); border-radius: 999px;
  text-decoration: none; font-weight: 600; color: var(--azul); box-shadow: var(--sombra);
}
.chip:hover, .chip:focus { border-color: var(--azul); background: var(--fondo); }

/* ---------- Testimonios ---------- */
.testimonio {
  background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.5rem; box-shadow: var(--sombra);
}
.testimonio blockquote { margin: 0; }
.testimonio .estrellas { color: #f6b93b; letter-spacing: 2px; margin-bottom: 0.5rem; }
.testimonio footer { margin-top: 0.9rem; color: var(--gris); font-size: 0.95rem; font-weight: 600; }

/* ---------- FAQ ---------- */
.faq details {
  background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 0.75rem 1.25rem; margin-bottom: 0.9rem;
}
.faq summary {
  cursor: pointer; font-weight: 700; color: var(--azul); list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.5rem 0 0.75rem; color: var(--gris); }

/* ---------- Migas de pan ---------- */
.breadcrumb { padding: 1.25rem 0 0; font-size: 0.9rem; color: var(--gris); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 0.4rem; color: #a8b3c4; }
.breadcrumb [aria-current="page"] { color: var(--azul); font-weight: 600; }

/* ---------- Formulario ---------- */
.formulario { display: grid; gap: 1.1rem; }
.formulario-2col { display: grid; gap: 1.1rem; }
@media (min-width: 720px) { .formulario-2col { grid-template-columns: 1fr 1fr; } }
.campo { display: grid; gap: 0.35rem; }
.campo label { font-weight: 700; font-size: 0.95rem; }
.campo input, .campo select, .campo textarea {
  font: inherit; padding: 0.85rem 1rem; border: 1px solid #cbd5e1; border-radius: 10px;
  width: 100%; background: #fff; color: var(--gris-oscuro); min-height: 48px;
}
.campo textarea { min-height: 140px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: 2px solid var(--azul-claro); outline-offset: 1px; border-color: var(--azul-claro);
}
.form-nota { font-size: 0.88rem; color: var(--gris); }

/* ---------- Datos de contacto ---------- */
.dato-contacto { display: flex; gap: 0.9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.dato-contacto a { word-break: break-word; }

/* ---------- CTA final ---------- */
.cta-final {
  background: linear-gradient(115deg, var(--azul) 0%, var(--azul-oscuro) 100%);
  color: #fff; border-radius: var(--radio); padding: clamp(2rem, 5vw, 3.25rem);
  text-align: center;
}
.cta-final h2 { color: #fff; }
.cta-final p { color: #d7e3ef; max-width: 60ch; margin-inline: auto; }
.cta-final .btn-secundario { background: transparent; border-color: #fff; color: #fff; }
.cta-final .btn-secundario:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Pie ---------- */
.site-footer { background: var(--azul-oscuro); color: #d7e3ef; }
.footer-grid { display: grid; gap: 2rem; padding: clamp(2.5rem, 5vw, 3.75rem) 0 1.5rem; }
.footer-col img { border-radius: var(--radio); background: #fff; padding: 0.5rem; }
.footer-title { color: #fff; font-size: 1.05rem; font-weight: 700; margin: 0 0 0.6rem; }
.footer-nav { display: flex; flex-direction: column; }
.footer-nav a, .footer-col a {
  color: #d7e3ef; text-decoration: none; display: inline-flex; align-items: center;
  padding: 0.3rem 0; min-height: 40px;
}
.site-footer a:hover, .site-footer a:focus { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15); padding: 1.25rem 0;
  font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.75rem;
  justify-content: space-between; align-items: center;
}
.footer-bottom a { min-height: auto; padding: 0; }

@media (min-width: 720px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; } }

/* ---------- Botón flotante de llamada (sticky call) ---------- */
.cta-flotante {
  position: fixed; left: 1rem; right: 1rem; bottom: 0.75rem; z-index: 45;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 56px; background: var(--azul); color: #fff; border-radius: 999px;
  text-decoration: none; font-weight: 700; box-shadow: 0 10px 30px rgba(26, 32, 44, 0.3);
}
.cta-flotante:hover, .cta-flotante:focus { background: var(--azul-oscuro); color: #fff; }
.cta-flotante svg { width: 20px; height: 20px; flex: 0 0 auto; }

@media (min-width: 768px) {
  .cta-flotante { left: auto; right: 1.5rem; bottom: 1.5rem; padding: 0 1.5rem; width: auto; }
}

/* ---------- Banner de cookies (CMP ligero) ---------- */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 4.75rem; z-index: 46;
  background: #fff; border: 1px solid var(--borde); border-radius: var(--radio);
  box-shadow: 0 12px 34px rgba(26, 32, 44, 0.25); padding: 1rem; font-size: 0.9rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0 0 0.75rem; }
.cookie-banner-acciones { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-banner .btn { min-height: 44px; padding: 0.6rem 1.1rem; font-size: 0.9rem; }

@media (min-width: 768px) {
  .cookie-banner { left: auto; right: 1.5rem; bottom: 5.75rem; max-width: 380px; }
}

/* ---------- Mapa con consentimiento ---------- */
.mapa iframe {
  width: 100%; height: 450px; border: 0; border-radius: var(--radio);
  box-shadow: var(--sombra); margin-top: 1rem;
}

/* ---------- Página 404 ---------- */
.pagina-404 { text-align: center; padding: clamp(3rem, 8vw, 6rem) 0; }
.pagina-404 h1 { font-size: clamp(3rem, 9vw, 5.5rem); margin-bottom: 0.25em; }
.pagina-404 .enlaces-404 { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }

/* ---------- Páginas legales ---------- */
.tabla-cookies { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.95rem; }
.tabla-cookies th, .tabla-cookies td {
  border: 1px solid var(--borde); padding: 0.7rem 0.9rem; text-align: left; vertical-align: top;
}
.tabla-cookies th { background: var(--fondo); color: var(--azul); }

/* ---------- Utilidades ---------- */
.texto-centrado { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.lista-localidades { list-style: none; padding: 0; margin: 0; }
.lista-localidades li { border-top: 1px solid var(--borde); }
.lista-localidades li a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0.35rem 0;
  text-decoration: none; font-weight: 600;
}
.lista-localidades li a:hover { text-decoration: underline; }
