/* ===========================================================================
   style.css — Hoja de estilos única · CERRAREUS (reuscerrajeros.es)
   Adaptada desde plantillas-proyecto/css/style.css. Estructura sin reescribir:
   solo se han volcado los tokens y añadido los componentes del proyecto.

   Se carga desde head-common.php con versionado por filemtime.
   ORDEN: 1 tokens · 2 reset/base · 3 layout · 4 componentes · 5 utilidades · 6 media
   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 — volcados desde estado-proyecto.md §2 */
  --color-primary:       #2b3038;
  --color-primary-dark:  #1e232a;
  --color-primary-rgb:   43, 48, 56;
  --color-secondary:     #f2a33c;
  --color-secondary-rgb: 242, 163, 60;
  --color-accent-dark:   #d98a1f;   /* solo hover de botón: texto oscuro encima */
  /* Ámbar utilizable como TEXTO sobre fondo claro. #d98a1f daba 2.76:1 sobre blanco
     y 2.49:1 sobre #f2f3f5, muy por debajo del 4.5:1 exigido por WCAG AA. */
  --color-accent-text:   #a1600b;   /* 5.01:1 sobre blanco · 4.51:1 sobre #f2f3f5 */
  /* Ámbar para elementos GRÁFICOS informativos (estrellas, viñetas, iconos): mínimo 3:1 */
  --color-accent-graphic:#c9780d;   /* 3.40:1 sobre blanco · 3.06:1 sobre #f2f3f5 */

  /* Neutros */
  --color-dark:     #16191d;
  --color-text:     #1a1d21;
  --color-muted:    #686f7c;   /* #6b7280 daba 4.35:1 sobre #f2f3f5 */
  --color-bg:       #fff;
  --color-bg-alt:   #f2f3f5;
  --color-border:   #dfe2e6;   /* solo separadores decorativos */
  --color-border-strong: #8b96a4;  /* bordes de control: 3.00:1 sobre blanco */
  --color-ok-bg:    #e7f6ec;
  --color-ok-text:  #1b5e34;
  --color-err-bg:   #fdecea;
  --color-err-text: #8a1c13;
  --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:    'Poppins', 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: 96px; }

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; letter-spacing: -.5px; }
h2 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; letter-spacing: -.3px; }
h3 { font-size: clamp(18px, 2.4vw, 22px); font-weight: 700; }

p { margin: 0 0 16px; }

a { color: var(--color-accent-text); text-decoration: underline; text-underline-offset: 2px; }
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 { 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, .82); }
.section-dark h2, .section-dark h3 { color: var(--white); }

.section-head { text-align: center; max-width: 760px; margin: 0 auto 40px; }
.section-label {
  display: inline-block;
  font-size: 13px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--color-accent-text); text-transform: uppercase; margin-bottom: 10px;
}
.section-dark .section-label { color: var(--color-secondary); }

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

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

/* 4.1 Botones */
.btn-primary, .btn-secondary, .card-link, .logo, .footer-logo,
.header-main nav > a, .mobile-nav > a, .nav-dropdown-menu a, .mobile-dropdown-menu a,
.mobile-dropdown-toggle, .call-bar a,
.footer-col a, .breadcrumb a, .skip-link { text-decoration: none; }
.card-link:hover, .footer-col a:hover, .breadcrumb a:hover { text-decoration: underline; }

.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px;
  min-height: 48px;                 /* altura uniforme aunque el texto ocupe una o dos líneas */
  border-radius: var(--radius);
  font-size: 16px; font-weight: 600; line-height: 1.25;
  text-align: center; text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
  max-width: 100%;                  /* nunca desbordan su contenedor */
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.btn-primary { background: var(--color-secondary); color: var(--color-dark); }
.btn-primary:hover { background: var(--color-accent-dark); color: var(--color-dark); text-decoration: none; }
/* Antes era transparente con borde: sobre fondos con foto o en móvil no se percibía como
   botón. Ahora tiene fondo propio, sin competir con el ámbar del CTA principal. */
.btn-secondary { background: var(--white); color: var(--color-primary); border-color: var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: var(--white); text-decoration: none; }

/* En móvil no existe :hover. Sin respuesta al toque el usuario vuelve a pulsar y duplica el envío. */
.btn-primary:active, .btn-secondary:active,
.cookie-actions button:active, .burger:active { transform: scale(.97); }
.btn-primary:active { background: var(--color-accent-dark); }
.btn-secondary:active { background: var(--color-primary); color: var(--white); }
.btn-primary[disabled], .btn-secondary[disabled] {
  opacity: .55; cursor: not-allowed; transform: none; filter: grayscale(.35);
}
.card-link:active, .faq-question:active { opacity: .7; }

/* R10 — botones secundarios sobre fondo oscuro. Con borde translúcido apenas se veían:
   ahora llevan fondo semiopaco y borde sólido, y se leen como botón de verdad. */
.hero .btn-secondary,
.process .btn-secondary,
.cta-final .btn-secondary,
.zones .btn-secondary,
.section-dark .btn-secondary {
  color: #fff; background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .85);
}
.hero .btn-secondary:hover,
.process .btn-secondary:hover,
.cta-final .btn-secondary:hover,
.zones .btn-secondary:hover,
.section-dark .btn-secondary:hover { background: rgba(255, 255, 255, .22); color: #fff; }

/* 4.2 Header */
.header-top {
  background: var(--color-dark); color: rgba(255, 255, 255, .9);
  font-size: 14px; line-height: 1.35; text-align: center; padding: 8px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 4px 10px;
}
/* El número NUNCA debe partirse: es la información más importante de la barra. */
.header-top a { color: var(--color-secondary); font-weight: 700; white-space: nowrap; }
.header-top .top-texto { white-space: nowrap; }
/* En pantallas estrechas el rótulo se acorta en vez de romperse en tres líneas. */
@media (max-width: 430px) {
  .header-top { font-size: 13px; padding: 7px 12px; gap: 2px 8px; }
  .header-top .top-largo { display: none; }
}
@media (max-width: 330px) {
  .header-top .top-texto { white-space: normal; }
}

.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: 10px var(--gutter);
  display: flex; align-items: center; gap: 24px;
}
.logo { display: flex; align-items: center; }
.logo img { max-height: 48px; 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; text-decoration: none;
}
.header-main nav > a:hover, .nav-link:hover { color: var(--color-accent-text); text-decoration: none; }
.header-main nav a[aria-current="page"] { color: var(--color-accent-text); border-bottom: 2px solid var(--color-secondary); }

.nav-dropdown { position: relative; }
.nav-dropdown .nav-link::after {
  content: "⌄"; margin-left: 5px; font-size: 15px; line-height: 1;
  display: inline-block; transition: transform .2s ease;
}
.nav-dropdown.open .nav-link::after { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px; min-width: 268px;
  display: none; flex-direction: column; gap: 2px;
}
.nav-dropdown-menu a { padding: 9px 12px; border-radius: 6px; color: var(--color-text); font-size: 15px; font-weight: 500; }
.nav-dropdown-menu a:hover { background: var(--color-bg-alt); text-decoration: none; }
.nav-dropdown.open .nav-dropdown-menu { display: flex; }

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

.mobile-nav {
  display: none; flex-direction: column; gap: 8px;   /* 4px dejaba los enlaces casi pegados */
  padding: 12px var(--gutter) 20px; border-top: 1px solid var(--color-border); background: var(--white);
}
.mobile-nav.open { display: flex; }
/* :not(.btn-primary) es imprescindible: sin él, `background: none` de esta regla (0,1,1)
   ganaba a `.btn-primary` (0,1,0) y el botón de llamar del menú móvil quedaba sin fondo,
   indistinguible de un enlace de texto. */
.mobile-nav > a:not(.btn-primary), .mobile-dropdown-toggle {
  padding: 12px 6px; font-weight: 600; font-size: 16px; color: var(--color-text);
  background: none; border: 0; text-align: left; font-family: inherit; cursor: pointer;
  border-radius: 6px;
}
.mobile-nav > a:not(.btn-primary):active, .mobile-dropdown-toggle:active { background: var(--color-bg-alt); }
/* El submenú se presenta como un bloque agrupado con guía lateral, en vez de enlaces
   sueltos subrayados: se entiende de un vistazo que dependen de «Servicios». */
.mobile-dropdown-menu {
  display: none; flex-direction: column; gap: 2px;
  margin: 2px 0 6px 6px; padding: 4px 0 4px 12px;
  border-left: 3px solid var(--color-accent-graphic);
}
.mobile-dropdown.open .mobile-dropdown-menu { display: flex; }
.mobile-dropdown-menu a {
  padding: 11px 8px; color: var(--color-text); font-weight: 500; font-size: 15px;
  border-radius: 6px;
}
.mobile-dropdown-menu a:active { background: var(--color-bg-alt); }
.mobile-dropdown-menu a[aria-current="page"] {
  color: var(--color-accent-text); font-weight: 700; background: var(--color-bg-alt);
}
/* Flecha que rota al desplegar. Va al extremo derecho con justify-content, no con
   margin-left:auto: al rotar 180° el margen automático la desplazaba contra la palabra.
   El padding-bottom compensa ópticamente el giro para que quede centrada en vertical. */
.mobile-dropdown-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; gap: 12px;
}
.mobile-dropdown-toggle::after {
  content: "⌄"; flex: 0 0 auto;
  font-size: 20px; line-height: 1; padding-bottom: 6px;
  transition: transform .2s ease;
}
.mobile-dropdown.open .mobile-dropdown-toggle::after { padding: 6px 0 0; }
.mobile-dropdown.open .mobile-dropdown-toggle::after { transform: rotate(180deg); }
.mobile-cta { margin-top: 10px; }

/* 4.3 Hero */
.hero { background: var(--color-dark); color: rgba(255, 255, 255, .85); padding: 64px 0; }
.hero h1 { color: var(--white); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.hero-lead { font-size: 18px; line-height: 1.7; margin-bottom: 24px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; padding: 0; list-style: none; }
.hero-badges li {
  margin: 0; padding: 6px 14px; font-size: 14px; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; color: var(--white);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
/* Con aspect-ratio + object-fit la foto se RECORTA al cambiar el ancho, nunca se estira. */
.hero-media img, .grid-2 img, .img-redondeada { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.img-redondeada { border-radius: var(--radius-lg); }
picture { display: block; }

/* 4.4 Tarjetas de servicio */
.card {
  background: var(--white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 26px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--color-muted); }
.card-link { margin-top: auto; font-weight: 700; color: var(--color-accent-text); }

/* 4.5 Listas de ventajas y averías */
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.feature-list li { margin: 0; padding-left: 34px; position: relative; }
.feature-list li::before {
  content: ""; position: absolute; left: 0; top: 6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--color-accent-graphic);
}
.feature-list strong { display: block; color: var(--color-dark); margin-bottom: 2px; }

/* 4.6 Proceso numerado */
.steps { list-style: none; counter-reset: paso; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.steps li { margin: 0; counter-increment: paso; }
.steps li::before {
  content: counter(paso);
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-bottom: 12px;
  border-radius: 50%; background: var(--color-secondary); color: var(--color-dark);
  font-weight: 800; font-size: 18px;
}
.steps strong { display: block; margin-bottom: 4px; color: inherit; }

/* 4.7 Tabla de coste */
.table-wrap { overflow-x: auto; }
.price-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.price-table th, .price-table td { padding: 14px 16px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.price-table th { background: var(--color-bg-alt); font-weight: 700; color: var(--color-dark); }
.price-level { font-weight: 700; white-space: nowrap; color: var(--color-accent-text); }

/* 4.8 Reseñas */
.review { background: var(--white); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 24px; }
.review-stars { color: var(--color-accent-graphic); letter-spacing: 2px; font-size: 19px; }
.review-text { margin: 10px 0 14px; }
.review-author { font-weight: 700; color: var(--color-dark); font-size: 15px; }
.review-date { color: var(--color-muted); font-size: 14px; }

/* 4.9 Zonas */
.zones { background: var(--color-dark); color: rgba(255, 255, 255, .82); }
.zone-list { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px; }
.zone-list li {
  margin: 0; padding: 6px 14px; font-size: 14px;
  background: rgba(255, 255, 255, .08); border-radius: 999px; color: var(--white);
}

/* 4.10 FAQ acordeón */
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 18px 40px 18px 0; position: relative;
  font-family: inherit; font-size: 17px; font-weight: 600; color: var(--color-dark);
}
.faq-question::after {
  content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 26px; font-weight: 400; color: var(--color-accent-text);
}
.faq-item.open .faq-question::after { content: "−"; }
.faq-answer { display: none; padding: 0 0 18px; color: var(--color-muted); }
.faq-item.open .faq-answer { display: block; }

/* 4.11 Sección de contacto compartida */
.contact-section { background: var(--color-bg-alt); padding: 64px 0; }
.contact-header { text-align: center; margin-bottom: 40px; }
.contact-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: start; }
.contact-form-wrap { background: var(--white); padding: 32px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }

/* 4.11 Sección de contacto — diseño propio del proyecto */
.contact-section { background: var(--color-bg-alt); padding: 64px 0; }
.contact-header { text-align: center; max-width: 700px; margin: 0 auto 40px; }
.contact-header p { color: var(--color-muted); }
.contact-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: start; }
.contact-form-wrap {
  background: var(--white); padding: 32px;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.contact-info-wrap { display: flex; flex-direction: column; gap: 16px; }
.contact-info-card {
  background: var(--white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 24px;
}
.contact-info-card h3 { font-size: 16px; margin: 0 0 10px; }
.contact-phone {
  font-size: 26px; font-weight: 700; color: var(--color-accent-text);
  text-decoration: none; display: block;
}
.contact-phone:hover { text-decoration: underline; }
.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-accent-text); }

/* ── Campos del formulario. Portados de tarragonacerrajeros.es, que está en producción y
      probado contra el CRM. Se conservan sus nombres de clase (.field, .field-check,
      .form-msg…) para que el marcado sea idéntico y no vuelvan a aparecer divergencias. ── */
.form-row { display: grid; gap: 16px; }
@media (min-width: 700px) { .form-row--2 { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; color: var(--color-text); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px;          /* <16px hace que iOS haga zoom al enfocar */
  color: var(--color-text);
  padding: .7rem .85rem;
  border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  background: var(--white); min-height: 46px; width: 100%;
  box-sizing: border-box; transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-accent-text);
  box-shadow: 0 0 0 3px rgba(var(--color-secondary-rgb), .35);
}
.field-hint { font-size: 13px; color: var(--color-muted); }
.field-opt  { font-weight: 400; color: var(--color-muted); }
.field ::placeholder { color: var(--color-muted); opacity: 1; }   /* 5.06:1 sobre blanco */

/* Casilla RGPD: checkbox NATIVO con accent-color. Sin span falso, sin input oculto
   y sin selector de hermano; por eso siempre se ve y siempre responde al clic. */
.field-check {
  display: flex; gap: .75rem; align-items: flex-start;
  margin-bottom: 20px; padding: .5rem; margin-left: -.5rem;
  border-radius: var(--radius);
}
.field-check input {
  width: 24px; height: 24px; min-width: 24px; min-height: 24px; flex: 0 0 auto;
  margin: 10px 10px 10px 0;                 /* 24 + 20 = 44px de objetivo táctil */
  accent-color: var(--color-accent-graphic);
  cursor: pointer;
}
.field-check label {
  font-size: 14px; font-weight: 400; color: var(--color-text);
  padding: .6rem 0; cursor: pointer;        /* toda la etiqueta es clicable */
}
.field-check label a { color: var(--color-accent-text); }
.field-check.has-error { background: var(--color-err-bg); outline: 2px solid var(--color-err-text); }
.field-check.has-error label { color: var(--color-err-text); }

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

.form-msg {
  padding: .85rem 1rem; border-radius: var(--radius);
  margin-bottom: 16px; font-size: 15px;
}
.form-msg--ok  { background: var(--color-ok-bg);  color: var(--color-ok-text);  border: 1px solid var(--color-ok-text); }
.form-msg--err { background: var(--color-err-bg); color: var(--color-err-text); border: 1px solid var(--color-err-text); }

.btn-block { width: 100%; }

/* Columna de datos directos, junto al formulario */


/* 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 {   /* .footer-email es condicional: EMAIL_VISIBLE=true */ color: rgba(255, 255, 255, .75); font-size: 15px; }
.footer-col a:hover { color: var(--white); }
.footer-brand { gap: 14px; }
.footer-logo img { max-height: 52px; 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 — sin CLS: no reserva espacio en el flujo */
.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-secondary); border-color: var(--color-secondary); color: var(--color-dark); }

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

/* 4.15 Bloques de texto largo (subpáginas) */
/* Por encima de ~80 caracteres por línea se pierde el renglón al saltar. 68ch deja ~62-70. */
.prose p, .prose li, .prose > ul, .prose > ol { max-width: 68ch; }
.section-head p { max-width: 68ch; margin-left: auto; margin-right: auto; }
.faq-answer p { max-width: 68ch; }

.prose h2 { margin-top: 40px; }
.prose h3 { margin-top: 28px; font-size: 19px; }
.prose > :first-child { margin-top: 0; }

/* 4.16 CTA final */
.cta-final { background: var(--color-dark); color: rgba(255, 255, 255, .85); text-align: center; }
.cta-final h2 { color: var(--white); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 22px; }

/* 4.17 Barra fija de llamada — solo móvil.
   El negocio es de urgencias: la acción principal debe estar siempre a un toque.
   Se posiciona sobre el área segura del notch y cede el sitio al banner de cookies. */
.call-bar { display: none; }
@media (max-width: 860px) {
  .call-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--color-dark); gap: 12px;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, .28);
  }
  .call-bar a { flex: 1; justify-content: center; min-height: 48px; }
  /* Mientras el banner de cookies está visible, la barra se coloca encima de él. */
  body.con-cookies .call-bar { bottom: var(--alto-cookies, 96px); }
  /* Espacio al final del documento para que la barra no tape el footer. */
  body { padding-bottom: 70px; }
  body.con-cookies { padding-bottom: calc(70px + var(--alto-cookies, 96px)); }
}

/* Móvil en horizontal: con cabecera fija + barra de llamada + banner de cookies quedaban
   162px de contenido útil sobre 380px (57 % de pantalla perdida). En apaisado se recupera
   el espacio: la cabecera deja de ser fija y la barra de llamada se retira, porque en esa
   orientación el pulgar alcanza igualmente el botón del hero. */
@media (max-height: 460px) and (orientation: landscape) {
  .site-header { position: static; }
  .call-bar { display: none; }
  body, body.con-cookies { padding-bottom: 0; }
  .mobile-nav.open { max-height: calc(100vh - 70px); }
}

/* 4.18 Página 404 */
.error-page { text-align: center; padding: 90px 0; }
.error-code { font-size: clamp(64px, 14vw, 120px); font-weight: 800; color: var(--color-accent-graphic); line-height: 1; margin: 0; }

/* ── 5. UTILIDADES ─────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.lead { font-size: 18px; color: var(--color-muted); }

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

@media (min-width: 861px) {
  /* Si el usuario abre el menú en móvil y gira o ensancha la ventana, .open seguiría
     puesta y aparecerían las DOS navegaciones. Esta regla lo impide siempre. */
  .mobile-nav, .mobile-nav.open { display: none; }
}

@media (max-width: 860px) {
  .header-main nav, .header-cta { display: none; }
  /* Si el menú es más alto que la pantalla, hace scroll propio en vez de cortarse. */
  .mobile-nav.open { max-height: calc(100vh - 120px); overflow-y: auto; }
  .mobile-nav > a, .mobile-dropdown-toggle, .mobile-dropdown-menu a { min-height: 44px; display: flex; align-items: center; }
  .burger { display: flex; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; gap: 24px; }
  .feature-list { grid-template-columns: 1fr; }
  section { padding: 48px 0; }
  .hero { padding: 48px 0; }
}

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

/* Los pares de botones se apilan en cuanto dejan de caber cómodamente en una línea.
   Antes solo lo hacían por debajo de 560px, y entre 561 y 860 el par sumaba más de 700px:
   se desbordaba o se partía de forma irregular. */
@media (max-width: 720px) {
  .hero-actions, .cta-actions, .call-bar { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-primary, .hero-actions .btn-secondary,
  .cta-actions .btn-primary, .cta-actions .btn-secondary { width: 100%; }
  .call-bar { flex-direction: row; }        /* la barra fija sí va en horizontal */
}

/* Por debajo de 380px ni con nowrap caben «Llamar · 877 55 44 33» y «Escribir».
   Se oculta el número, que ya está en la barra superior y en el propio enlace tel:. */
@media (max-width: 380px) {
  .call-bar .call-num { display: none; }
  .call-bar a { font-size: 15px; padding: 10px 8px; }
}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .btn-primary, .btn-secondary { padding: 13px 16px; font-size: 15px; }
  .cookie-actions { width: 100%; }
  .cookie-actions button { flex: 1; }
}

/* Las páginas legales y los presupuestos se imprimen: fuera navegación, banners y CTA. */
@media print {
  .header-top, .site-header, .cookie-banner, .call-bar, .cta-final,
  .contact-form-wrap, .breadcrumb, .hero-actions, .cta-actions { display: none !important; }
  body { padding-bottom: 0; font-size: 11pt; color: #000; background: #fff; }
  .prose p, .prose li, .section-head p { max-width: none; }
  section { padding: 12pt 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  a[href^="#"]::after, a[href^="tel"]::after { content: ""; }
  h1, h2, h3 { break-after: avoid; }
  .price-table { font-size: 10pt; }
}

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