/* ===========================================================================
   style.css — Hoja de estilos única del proyecto
   PLANTILLA. Adaptar cambiando los tokens :root (colores de estado-proyecto.md §2)
   y los ajustes visuales. No reescribir la estructura.

   Se carga desde head-common.php con versionado por filemtime:
     <link rel="stylesheet" href="/css/style.css?v=<?= @filemtime(...) ?>">

   ORDEN: 1 tokens · 2 reset/base · 3 layout · 4 componentes · 5 utilidades · 6 media queries
   Regla: los colores NUNCA en hexadecimal dentro de los componentes → var(--color-*)
   Ver: guia-construccion-web.md 1.3.2 · reglas-proyecto.md R10
   =========================================================================== */

/* ── 1. TOKENS ─────────────────────────────────────────────────────────── */
:root {
  /* Colores del proyecto — volcar desde config.php / estado-proyecto.md */
  --color-primary:       #C2410C;
  --color-primary-dark:  #9A340A;
  --color-primary-rgb:   194, 65, 12;
  --color-secondary:     #14213D;
  --color-secondary-rgb: 20, 33, 61;
  --color-accent:        #F26419;   /* naranja vivo: solo sobre fondo oscuro */

  /* Neutros */
  --color-dark:     #14213D;
  --color-text:     #1F2933;
  --color-muted:    #6b6b6b;
  --color-bg:       #fff;
  --color-bg-alt:   #F8F5F2;
  --color-border:   #e2ddd7;
  --white:          #fff;

  /* Medidas */
  --radius:      8px;
  --radius-lg:   14px;
  --max-width:   1180px;
  --gutter:      20px;
  --shadow-sm:   0 2px 8px rgba(0, 0, 0, .06);
  --shadow-md:   0 6px 24px rgba(0, 0, 0, .10);

  /* Tipografía */
  --font-body:    system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: var(--font-body);
}

/* ── 2. RESET Y BASE ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-dark);
  margin: 0 0 16px;
}
h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 800; }
h2 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; }
h3 { font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; }

p { margin: 0 0 16px; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }

:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--color-dark); color: var(--white); padding: 12px 20px;
}
.skip-link:focus { left: 0; }

/* ── 3. LAYOUT ─────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section { padding: 64px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-dark { background: var(--color-dark); color: rgba(255, 255, 255, .88); }
.section-dark h2, .section-dark h3 { color: var(--white); }

.section-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: 10px;
}

.section-header { text-align: center; max-width: 760px; margin: 0 auto 40px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── 4. COMPONENTES ────────────────────────────────────────────────────── */

/* 4.1 Botones */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--color-primary-dark); color: var(--white); text-decoration: none; }
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary); color: var(--white); text-decoration: none; }

/* R10 — botones secundarios sobre fondo oscuro: una sola regla, no repetir por sección */
.hero .btn-secondary,
.process .btn-secondary,
.cta-final .btn-secondary,
.service-cta .btn-secondary,
.zones .btn-secondary,
.section-dark .btn-secondary { color: #fff; border-color: rgba(255, 255, 255, .5); }
.hero .btn-secondary:hover,
.process .btn-secondary:hover,
.cta-final .btn-secondary:hover,
.service-cta .btn-secondary:hover,
.zones .btn-secondary:hover,
.section-dark .btn-secondary:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* 4.2 Header */
.header-top {
  background: var(--color-dark);
  color: rgba(255, 255, 255, .9);
  font-size: 14px;
  text-align: center;
  padding: 7px var(--gutter);
}
.header-top a { color: var(--white); font-weight: 600; }

.site-header { position: sticky; top: 0; z-index: 100; background: var(--white); box-shadow: var(--shadow-sm); }

.header-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { display: flex; align-items: center; font-weight: 800; font-size: 20px; color: var(--color-dark); }
.logo img { max-height: 44px; width: auto; }

.header-main nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.header-main nav > a, .nav-link {
  color: var(--color-text);
  font-weight: 600;
  font-size: 15px;
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
  font-family: inherit;
}
.header-main nav a:hover, .nav-link:hover { color: var(--color-primary); text-decoration: none; }
.header-main nav a[aria-current="page"] { color: var(--color-primary); border-bottom: 2px solid var(--color-primary); }

/* Dropdown de servicios */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 0; min-width: 240px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  display: none;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 10px 18px; font-size: 15px; color: var(--color-text); }
.nav-dropdown-menu a:hover { background: var(--color-bg-alt); color: var(--color-primary); text-decoration: none; }

.header-cta { padding: 10px 20px; font-size: 15px; }

/* Burger */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer;
  margin-left: auto;
}
.burger span { display: block; height: 3px; width: 26px; background: var(--color-dark); border-radius: 2px; transition: transform .2s; }

/* Menú móvil */
.mobile-nav { display: none; flex-direction: column; padding: 12px var(--gutter) 20px; border-top: 1px solid var(--color-border); background: var(--white); }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 12px 0; font-weight: 600; color: var(--color-text); border-bottom: 1px solid var(--color-border); }
.mobile-dropdown-toggle {
  width: 100%; text-align: left; padding: 12px 0;
  background: none; border: 0; border-bottom: 1px solid var(--color-border);
  font: inherit; font-weight: 600; color: var(--color-text); cursor: pointer;
}
.mobile-dropdown-menu { display: none; padding-left: 14px; }
.mobile-dropdown-menu.open { display: block; }
.mobile-cta { margin-top: 16px; border-bottom: 0 !important; color: var(--white) !important; }

/* 4.3 Hero */
.hero {
  position: relative;
  background: var(--color-dark);
  color: rgba(255, 255, 255, .92);
  padding: 76px 0;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(0, 0, 0, .78) 40%, rgba(0, 0, 0, .35));
  z-index: 1;
}
.hero > .container { position: relative; z-index: 2; max-width: 800px; }
.hero h1 { color: var(--white); }
.hero p { font-size: 18px; margin-bottom: 28px; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 30px; font-size: 15px; font-weight: 600; }

/* 4.4 Tarjetas de servicio */
.card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin-bottom: 10px; }
.card-body p { color: var(--color-muted); font-size: 15px; flex: 1; }
.card-link { font-weight: 700; color: var(--color-primary); }

/* 4.5 Proceso / pasos */
.process { background: var(--color-dark); color: rgba(255, 255, 255, .88); }
.process h2, .process h3 { color: var(--white); }
.step { text-align: center; padding: 10px; }
.step-num {
  width: 46px; height: 46px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--color-secondary);
  color: var(--color-dark);
  font-weight: 800; font-size: 18px;
}

/* 4.6 Reseñas */
.review-card {
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.review-stars { color: var(--color-secondary); font-size: 17px; letter-spacing: 2px; margin-bottom: 10px; }
.review-text { font-size: 15px; color: var(--color-text); }
.review-author { font-weight: 700; font-size: 14px; margin: 0; }
.review-date { font-size: 13px; color: var(--color-muted); }

/* 4.7 FAQ acordeón */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
  width: 100%; text-align: left;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 17px; color: var(--color-dark);
}
.faq-question .chevron { transition: transform .2s ease; color: var(--color-primary); }
.faq-question[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.faq-answer { display: none; padding: 0 0 18px; color: var(--color-muted); }
.faq-answer.open { display: block; }

/* 4.8 Zonas de cobertura */
.zones { background: var(--color-dark); color: rgba(255, 255, 255, .88); }
.zones h2 { color: var(--white); }
.zones-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.zones-list li {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 15px;
  margin: 0;
}

/* 4.9 Breadcrumb */
.breadcrumb { padding: 14px 0; font-size: 14px; color: var(--color-muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: '›'; margin-right: 8px; color: var(--color-muted); }

/* 4.10 CTA final */
.cta-final { background: var(--color-primary); color: var(--white); text-align: center; }
.cta-final h2 { color: var(--white); }
.cta-final .btn-primary { background: var(--white); color: var(--color-primary); }
.cta-final .btn-primary:hover { background: rgba(255, 255, 255, .9); color: var(--color-primary); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 24px; }

/* 4.11 Sección de contacto compartida (includes/contact-section.php) */
.contact-section { background: var(--color-bg-alt); padding: 60px 0; }
.contact-header { text-align: center; margin-bottom: 40px; }
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: start; }

.contact-form-wrap {
  background: var(--white);
  padding: 32px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-weight: 600; font-size: 14px;
  margin-bottom: 6px; color: var(--color-text);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  background: var(--white);
  transition: border-color .2s;
  box-sizing: border-box;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), .1);
}
.form-group textarea { resize: vertical; min-height: 110px; }

/* Checkbox RGPD — nativo oculto con opacity (no display:none) para no perder accesibilidad */
.form-checkbox { margin-bottom: 24px; }
.checkbox-label {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-weight: 400; line-height: 1.4;
}
.checkbox-label input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox-custom {
  flex-shrink: 0; width: 20px; height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 4px; margin-top: 2px;
  transition: all .15s ease;
  position: relative; background: var(--white);
}
.checkbox-custom::after {
  content: ''; position: absolute; left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .15s ease;
}
.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--color-primary); border-color: var(--color-primary);
}
.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after { transform: rotate(45deg) scale(1); }
.checkbox-label input[type="checkbox"]:focus-visible + .checkbox-custom {
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), .3);
}
.checkbox-text { font-size: 13px; color: var(--color-muted); }
.checkbox-text a { color: var(--color-primary); text-decoration: underline; }

.btn-submit {
  width: 100%; padding: 14px 24px;
  font-size: 16px; font-weight: 600;
  cursor: pointer; border: none; border-radius: var(--radius);
}
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.form-message {
  margin-top: 12px; padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
}

.contact-info-wrap { display: flex; flex-direction: column; gap: 20px; }
.contact-info-card {
  background: var(--white); padding: 24px;
  border-radius: 12px; box-shadow: var(--shadow-sm);
}
.contact-info-card h3 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--color-muted); margin: 0 0 12px;
}
.contact-phone {
  font-size: 24px; font-weight: 700;
  color: var(--color-primary); text-decoration: none; display: block;
}
.contact-schedule { font-size: 14px; color: var(--color-muted); margin: 8px 0 0; }
.contact-nap { font-style: normal; line-height: 1.6; font-size: 15px; }
.contact-nap strong { font-weight: 600; }
.contact-nap a { color: var(--color-primary); text-decoration: none; }

/* 4.12 Footer */
.site-footer { background: var(--color-dark); color: rgba(255, 255, 255, .75); padding: 52px 0 24px; }
.site-footer h3 { color: var(--white); font-size: 15px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 9px; }
.footer-col a, .footer-email { color: rgba(255, 255, 255, .75); font-size: 15px; }
.footer-col a:hover { color: var(--white); }
.footer-logo img { max-height: 46px; width: auto; }
.footer-nap { font-style: normal; font-size: 15px; line-height: 1.65; }
.footer-nap strong { color: var(--white); }
.footer-nap a { color: rgba(255, 255, 255, .75); }
.footer-bottom {
  margin-top: 36px; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  text-align: center; font-size: 14px;
}
.footer-bottom p { margin: 0; }

/* 4.13 Cookie banner — reserva de espacio para no provocar CLS */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--color-dark); color: rgba(255, 255, 255, .9);
  padding: 16px var(--gutter);
  display: none;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, .25);
}
.cookie-banner.show { display: block; }
.cookie-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  font-size: 14px;
}
.cookie-inner p { margin: 0; flex: 1; min-width: 240px; }
.cookie-inner a { color: var(--color-secondary); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button {
  padding: 9px 18px; border-radius: var(--radius);
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid rgba(255, 255, 255, .4);
  background: transparent; color: #fff;
}
.cookie-actions .cookie-accept { background: var(--color-primary); border-color: var(--color-primary); }

/* ── 5. UTILIDADES ─────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.lead { font-size: 18px; color: var(--color-muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 6. MEDIA QUERIES ──────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .header-main nav, .header-cta { display: none; }
  .burger { display: flex; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 24px; }
  section { padding: 48px 0; }
  .hero { padding: 56px 0; }
}

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-form-wrap { padding: 24px; }
}

@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions .btn-primary, .hero-actions .btn-secondary { width: 100%; }
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   AJUSTES DEL PROYECTO — Cerracunit
   Añadidos sobre la hoja base. Los tokens :root ya llevan la paleta.
   ═══════════════════════════════════════════════════════════════════ */

/* R10 — Botones sobre el hero navy: el primary naranja pierde contraste
   sobre fondo oscuro, así que sobre .hero-dark se invierte la jerarquía. */
.hero-dark .btn-primary { background: var(--color-accent); color: #14213D; }
.hero-dark .btn-primary:hover { background: #ff7a33; }
.hero-dark .btn-secondary { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.55); }
.hero-dark .btn-secondary:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* Honeypot: fuera de pantalla, nunca display:none (algunos bots lo detectan) */
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Hero sin foto (usado en /cierres-metalicos) */
.hero-plain {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #1d2f52 100%);
  color: #fff;
  padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.hero-plain h1 { color: #fff; }
.hero-plain p { color: rgba(255,255,255,.88); }

/* Barra superior */
.header-top { background: var(--color-secondary); color: #fff; font-size: .875rem; }
.header-top-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem 0; }
.header-top-tel { color: var(--color-accent); font-weight: 700; text-decoration: none; white-space: nowrap; }
.header-top-tel:hover { text-decoration: underline; }
@media (max-width: 560px) { .header-top-claim { display: none; } .header-top-inner { justify-content: center; } }

/* Tabla de niveles de coste */
.tabla-coste { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.tabla-coste th, .tabla-coste td { padding: .8rem .7rem; text-align: left; border-bottom: 1px solid var(--color-border, #e5e7eb); }
.tabla-coste th { background: var(--color-bg-alt); font-size: .9rem; }
.nivel { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.nivel--eco { background: #dcfce7; color: #14532d; }
.nivel--mod { background: #fef3c7; color: #78350f; }
.nivel--pre { background: #fee2e2; color: #7f1d1d; }

/* Zonas */
.zonas-lista { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; }
.zonas-lista li { background: #fff; border: 1px solid var(--color-border, #e5e7eb); border-radius: 999px; padding: .4rem .9rem; font-size: .92rem; }
.contact-zonas { font-size: .88rem; line-height: 1.7; color: var(--color-text-light, #6b7280); }

/* Cookie banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; background: var(--color-secondary); color: #fff; padding: 1rem; }
.cookie-inner { max-width: 1100px; margin: 0 auto; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-inner p { margin: 0; font-size: .9rem; }
.cookie-inner a { color: var(--color-accent); }
.cookie-actions { display: flex; gap: .6rem; flex-shrink: 0; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }

/* Mensaje del formulario */
.form-message { margin-top: 1rem; padding: .85rem 1rem; border-radius: 8px; font-size: .95rem; }
.form-message.is-ok { background: #dcfce7; color: #14532d; }
.form-message.is-error { background: #fee2e2; color: #7f1d1d; }

/* Página 404 */
.error-404 { text-align: center; }
.error-codigo { font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; line-height: 1; color: var(--color-primary); opacity: .18; margin: 0; }
.error-404 .grid-3 { margin-top: 1.5rem; }
.error-404 .mini-card h3 { margin: 0; font-size: 1.05rem; }
.error-404 .mini-card a { text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════════
   CORRECCIONES DE AUDITORÍA — 03/08/2026
   La hoja base usaba nombres de clase en inglés (.hero-actions,
   .review-card, .step-num…) y el HTML se generó en español.
   36 clases quedaban sin ninguna regla. Aquí se cierran todas.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables que faltaban (se usaban con var() sin estar en :root) ── */
:root {
  --color-text-light: #5B6672;   /* 6.34:1 sobre blanco */
  --header-alto: 132px;          /* barra superior + header, para las anclas */
}

/* ── ROTO 1 · El menú móvil nunca abría ──
   El CSS esperaba .open y el JS aplica .is-open. Se aceptan ambas. */
.mobile-nav.is-open,
.mobile-nav.open { display: flex; }
.mobile-dropdown-menu.is-open,
.mobile-dropdown-menu.open { display: block; }
.nav-dropdown.is-open .nav-dropdown-menu { display: block; }

/* Bloqueo del scroll de fondo con el menú abierto */
body.nav-abierto { overflow: hidden; }

/* Si el menú no cabe en pantalla, hace scroll propio */
.mobile-nav {
  max-height: calc(100vh - var(--header-alto));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── ROTO 2 · Hover del desplegable aislado a punteros finos ──
   En táctil el :hover se queda pegado tras el primer toque. */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
}
@media (hover: none), (pointer: coarse) {
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.is-open .nav-dropdown-menu { display: block; }
}

/* ── ROTO 3 · Layout de cabecera y navegación ── */
.header-main-inner { display: flex; align-items: center; gap: 20px; }
.nav-desktop { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-desktop > a,
.nav-dropdown-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 12px; font-weight: 600; font-size: 15px;
  color: var(--color-text); background: none; border: 0; cursor: pointer;
  border-radius: var(--radius); text-decoration: none;
}
.nav-desktop > a:hover, .nav-dropdown-toggle:hover { color: var(--color-primary); }
.nav-desktop [aria-current="page"],
.nav-dropdown-toggle[data-active="true"] {
  color: var(--color-primary);
  box-shadow: inset 0 -3px 0 var(--color-primary);
}
.nav-dropdown { position: relative; }
.nav-dropdown-menu [aria-current="page"] { color: var(--color-primary); font-weight: 700; }
.mobile-dropdown { border-bottom: 1px solid var(--color-border); }
@media (max-width: 860px) { .nav-desktop { display: none; } }

/* ── ROTO 4 · El hero: la imagen se maquetaba como bloque y empujaba el texto ── */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-inner { position: relative; z-index: 2; max-width: 820px; }
.hero-sub { font-size: 18px; margin-bottom: 24px; color: rgba(255,255,255,.92); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-badges {
  display: flex; flex-wrap: wrap; gap: 10px;
  list-style: none; padding: 0; margin: 0 0 26px;
}
.hero-badges li {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; padding: 6px 14px;
  font-size: 14px; font-weight: 600; color: #fff;
}
.hero-servicio { padding: 64px 0; }
.hero-plain .hero-inner { max-width: 820px; }

/* ── ROTO 5 · Secciones, contenedores y tipografía de apoyo ── */
.section { padding: 72px 0; }
.container-estrecho { max-width: 760px; }   /* ~72 caracteres por línea */
.contenido-legal { max-width: 720px; }
.contenido-legal h2 { margin-top: 2rem; font-size: 1.25rem; }
.contenido-legal li { margin-bottom: .4rem; }
.legal-fecha { color: var(--color-text-light); font-size: .92rem; }
.section-intro { font-size: 1.05rem; color: var(--color-text-light); max-width: 68ch; }

/* ── ROTO 6 · Tarjetas de servicio y reseñas ── */
.card-servicio img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border-radius: var(--radius); margin-bottom: 14px; }
.card-servicio h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card-link { font-weight: 700; color: var(--color-primary); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-resena { display: flex; flex-direction: column; gap: 10px; }
.estrellas { color: var(--color-primary); font-size: 1.1rem; letter-spacing: 2px; }
.resena-texto { margin: 0; font-size: .96rem; }
.resena-autor { margin: 0; font-size: .9rem; color: var(--color-text-light); }

/* ── ROTO 7 · Proceso numerado ── */
.pasos { list-style: none; padding: 0; display: grid; gap: 24px; grid-template-columns: repeat(4, 1fr); }
.pasos li { text-align: center; }
.paso-num {
  width: 46px; height: 46px; margin: 0 auto 12px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--color-secondary); color: #fff;
  font-weight: 800; font-size: 18px;
}
.pasos h3 { font-size: 1rem; margin: 0 0 6px; }
@media (max-width: 860px) { .pasos { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .pasos { grid-template-columns: 1fr; } }

/* ── ROTO 8 · FAQ, figuras y dos columnas ── */
.faq-lista { display: flex; flex-direction: column; gap: 10px; }
.faq-icon { margin-left: auto; font-size: 1.3rem; line-height: 1; color: var(--color-primary); }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.figura { margin: 1.8rem 0; }
.figura img { width: 100%; height: auto; border-radius: var(--radius); }
.figura figcaption { font-size: .88rem; color: var(--color-text-light); margin-top: .5rem; }
.figura-ancha img { aspect-ratio: 3/2; object-fit: cover; }
.dos-columnas { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: start; }
@media (max-width: 860px) { .dos-columnas { grid-template-columns: 1fr; gap: 28px; } }
.lista-ventajas { list-style: none; padding: 0; }
.lista-ventajas li { padding-left: 26px; position: relative; margin-bottom: .7rem; }
.lista-ventajas li::before {
  content: '✓'; position: absolute; left: 0;
  color: var(--color-primary); font-weight: 800;
}

/* ── ROTO 9 · Footer y contacto ── */
.footer-brand { max-width: 280px; }
.footer-claim { font-size: .92rem; opacity: .85; }
.footer-tel { font-weight: 700; color: var(--color-accent); text-decoration: none; }
.footer-horario { font-size: .88rem; opacity: .85; margin-top: .5rem; }
.contact-info-card--phone { background: var(--color-secondary); color: #fff; }
.contact-info-card--phone h3 { color: #fff; }
.contact-phone { font-size: 1.5rem; font-weight: 800; color: var(--color-accent); text-decoration: none; display: block; }
.contact-schedule { font-size: .88rem; opacity: .85; margin: .3rem 0 0; }
.captcha-group { background: var(--color-bg-alt); padding: 14px; border-radius: var(--radius); }

/* ── BARRERA 1 · iOS hacía zoom al enfocar (campos a 15px) ── */
.form-group input,
.form-group select,
.form-group textarea { font-size: 16px; }

/* Placeholder con contraste medido (4.61:1 sobre blanco) */
.form-group input::placeholder,
.form-group textarea::placeholder { color: #6B7280; opacity: 1; }

/* Casilla RGPD: área táctil real y estado marcado visible */
.checkbox-label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; min-height: 44px; }
.checkbox-label input[type="checkbox"] { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; }
.checkbox-custom { width: 24px; height: 24px; border: 2px solid #6B7280; border-radius: 4px; flex-shrink: 0; position: relative; background: #fff; }
.checkbox-label input:checked + .checkbox-custom { background: var(--color-primary); border-color: var(--color-primary); }
.checkbox-label input:checked + .checkbox-custom::after {
  content: ''; position: absolute; left: 7px; top: 2px;
  width: 6px; height: 12px; border: solid #fff;
  border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.checkbox-label input:focus-visible + .checkbox-custom { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.checkbox-text { font-size: .92rem; line-height: 1.5; }
.form-group.tiene-error input,
.form-group.tiene-error .checkbox-custom { border-color: #B91C1C; }

/* ── BARRERA 2 · Anclas bajo la cabecera fija ── */
:target { scroll-margin-top: calc(var(--header-alto) + 16px); }
#contacto, #zonas, #opiniones, #faq, #servicios, #urgencias, #averias, #coste { scroll-margin-top: calc(var(--header-alto) + 16px); }

/* ── BARRERA 3 · Sin respuesta al toque: el usuario pulsa dos veces ── */
.btn-primary:active, .btn-secondary:active, .btn-ghost:active { transform: translateY(1px); filter: brightness(.94); }
.btn-primary:disabled, .btn-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.burger:active span { background: var(--color-primary); }

/* Objetivo táctil mínimo */
.btn-primary, .btn-secondary, .btn-ghost, .btn-submit { min-height: 44px; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; min-height: 48px; }
.nav-desktop > a, .nav-dropdown-toggle, .mobile-nav a { min-height: 44px; }

/* ── BARRERA 4 · Enlace de salto (el CSS ya lo tenía; faltaba en el HTML) ── */

/* ── BARRERA 5 · Capas: el banner no debe tapar el CTA fijo ── */
.site-header { z-index: 100; }
.mobile-nav { z-index: 99; }
.cookie-banner { z-index: 300; }
.barra-llamada { z-index: 250; }

/* ── Barra fija de llamada en móvil (servicio de urgencias) ── */
.barra-llamada { display: none; }
@media (max-width: 860px) {
  .barra-llamada {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    background: var(--color-secondary);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    gap: 10px; box-shadow: 0 -2px 12px rgba(0,0,0,.18);
  }
  .barra-llamada .btn-primary, .barra-llamada .btn-secondary { flex: 1; margin: 0; }
  body { padding-bottom: 76px; }              /* deja hueco a la barra */
  body.cookies-visibles { padding-bottom: 190px; }
}

/* ── Sin scroll horizontal ── */
html, body { overflow-x: hidden; }
img, picture, video, table { max-width: 100%; }
.tabla-coste { display: block; overflow-x: auto; white-space: normal; }
@media (min-width: 561px) { .tabla-coste { display: table; } }

/* ── Móvil en horizontal (altura ~380px): la cabecera no debe comerse la pantalla ── */
@media (max-height: 420px) and (orientation: landscape) {
  .site-header { position: static; }
  .header-top { display: none; }
  .mobile-nav { max-height: 70vh; }
  .barra-llamada { padding: 6px 12px; }
  body { padding-bottom: 62px; }
}

/* ── Impresión: las legales son lo único imprimible ── */
@media print {
  .site-header, .mobile-nav, .cookie-banner, .barra-llamada,
  .contact-section, .cta-final, .hero-bg { display: none !important; }
  body { padding: 0; color: #000; background: #fff; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  .contenido-legal { max-width: 100%; }
}
