/* ==========================================================================
   CERRAJEROS DONOSTIA BARROSO - HOJA DE ESTILOS PRINCIPAL (UX, WCAG AAA & CWV)
   Dominio: https://cerrajerosdonostiabarroso.com
   Teléfono Urgencias 24h: 943 56 04 14
   ========================================================================== */

:root {
  /* Paleta Corporativa de Alto Contraste Verificada (WCAG AA / AAA) */
  --bg-dark: #0a1628;
  --bg-darker: #060e1a;
  --bg-slate: #11223d;
  --bg-light: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;

  --primary: #0f294a;
  --primary-light: #163763;
  --accent: #f59e0b;
  --accent-bright: #fbbf24;
  --accent-hover: #d97706;
  --accent-light: #fef3c7;
  --accent-dark-text: #78350f;

  --urgent: #dc2626;
  --urgent-hover: #b91c1c;
  --success: #14532d;
  --success-bg: #dcfce7;

  /* Textos sobre fondos claros (Contraste > 7:1) */
  --text-main: #0f172a;
  --text-body: #1e293b;
  --text-muted: #475569;

  /* Textos sobre fondos oscuros (Contraste > 12:1) */
  --text-light: #ffffff;
  --text-light-muted: #e2e8f0;

  --border: #cbd5e1;
  --border-dark: #1e293b;

  --shadow-sm: 0 1px 3px rgba(10, 22, 40, 0.08);
  --shadow-md: 0 4px 16px rgba(10, 22, 40, 0.1);
  --shadow-lg: 0 12px 32px rgba(10, 22, 40, 0.15);
  --shadow-accent: 0 8px 24px rgba(245, 158, 11, 0.32);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --container: 1240px;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Reset y Protección Anti-Desbordamiento Lateral (Mobile-First) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  color: var(--text-body);
  background-color: var(--bg-light);
  line-height: 1.68;
  max-width: 100%;
  overflow-x: clip;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Regla Crítica CSS Grid: evita que tablas o elementos hijos ensanchen columnas en móvil */
.hero-grid > *,
.layout-sidebar > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.trust-grid > *,
.footer-grid > *,
.diag-panel > *,
.geo-meta-grid > *,
.steps-grid > *,
.hero-badges > * {
  min-width: 0;
  max-width: 100%;
}

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

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #92400e;
}

ul, ol {
  list-style-position: inside;
}

/* 2. Tipografía Semántica SEO y Contraste Inteligente */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(1.75rem, 4.2vw, 3.15rem);
  margin-bottom: 1.15rem;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
}

/* Strong hereda el color de su contenedor para garantizar contraste tanto en fondos claros como oscuros */
strong, b {
  color: inherit;
  font-weight: 800;
}

/* En contenedores de fondo claro, strong destaca en azul marino muy oscuro (#0f172a) */
.card strong,
.step-card strong,
.barrio-card strong,
.content-box strong,
.faq-item strong,
.geo-summary-box strong,
.real-case-card strong,
.trust-item strong,
.sidebar-widget:not(.urgent-widget) strong {
  color: var(--text-main);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 4.25rem 0;
}

.section-sm {
  padding: 2.75rem 0;
}

.bg-white {
  background-color: var(--surface);
  color: var(--text-body);
}

.bg-alt {
  background-color: var(--bg-alt);
  color: var(--text-body);
}

/* 3. Sistema Unificado de Contenedores Oscuros (Contraste WCAG AAA Garantizado) */
.bg-dark,
.topbar,
.breadcrumbs-bar,
.hero,
.hero-card,
.emergency-box,
.diag-widget,
.diag-panel,
.diag-metrics,
.sidebar-widget.urgent-widget,
.cta-banner,
.site-footer,
.cookie-banner {
  color: var(--text-light);
}

.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4,
.hero h1, .hero h2, .hero h3, .hero h4,
.hero-card h2, .hero-card h3, .hero-card h4,
.diag-widget h2, .diag-widget h3, .diag-widget h4,
.diag-panel h2, .diag-panel h3, .diag-panel h4,
.sidebar-widget.urgent-widget h2, .sidebar-widget.urgent-widget h3, .sidebar-widget.urgent-widget h4,
.cta-banner h2, .cta-banner h3, .cta-banner h4,
.site-footer h2, .site-footer h3, .site-footer h4,
.cookie-banner h3, .cookie-banner h4 {
  color: #ffffff;
}

.bg-dark p, .bg-dark li,
.hero p, .hero li,
.hero-card p, .hero-card li,
.emergency-box p, .emergency-box span,
.diag-widget p, .diag-widget li,
.diag-panel p, .diag-panel li,
.diag-metrics div, .diag-metrics span,
.sidebar-widget.urgent-widget p, .sidebar-widget.urgent-widget li,
.cta-banner p, .cta-banner li,
.site-footer p, .site-footer li,
.cookie-banner p {
  color: var(--text-light-muted);
}

.bg-dark strong,
.topbar strong,
.breadcrumbs-bar strong,
.hero strong,
.hero-card strong,
.emergency-box strong,
.diag-widget strong,
.diag-panel strong,
.diag-metrics strong,
.sidebar-widget.urgent-widget strong,
.cta-banner strong,
.site-footer strong,
.cookie-banner strong {
  color: #ffffff;
}

/* Protección inversa: Si una tarjeta blanca está dentro de una sección .bg-dark, mantiene su texto oscuro */
.bg-dark .card,
.bg-dark .step-card,
.bg-dark .barrio-card,
.bg-dark .content-box,
.bg-dark .faq-item,
.bg-dark .table-responsive,
.bg-dark .geo-summary-box,
.bg-dark .real-case-card {
  color: var(--text-body);
}

.bg-dark .card h2, .bg-dark .card h3, .bg-dark .card h4, .bg-dark .card strong,
.bg-dark .step-card h2, .bg-dark .step-card h3, .bg-dark .step-card h4, .bg-dark .step-card strong,
.bg-dark .barrio-card h2, .bg-dark .barrio-card h3, .bg-dark .barrio-card h4, .bg-dark .barrio-card strong,
.bg-dark .content-box h2, .bg-dark .content-box h3, .bg-dark .content-box h4, .bg-dark .content-box strong,
.bg-dark .faq-item summary, .bg-dark .faq-item strong {
  color: var(--text-main);
}

.bg-dark .card p, .bg-dark .card li,
.bg-dark .step-card p, .bg-dark .step-card li,
.bg-dark .barrio-card p, .bg-dark .barrio-card li,
.bg-dark .content-box p, .bg-dark .content-box li,
.bg-dark .faq-item .faq-answer, .bg-dark .faq-item p {
  color: var(--text-body);
}

.bg-dark {
  background-color: var(--bg-dark);
}

/* Encabezados de sección */
.section-header {
  max-width: 820px;
  margin: 0 auto 2.75rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-light);
  color: var(--accent-dark-text);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.85rem;
  max-width: 100%;
}

.bg-dark .eyebrow,
.hero .eyebrow,
.diag-widget .eyebrow,
.cta-banner .eyebrow {
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-bright);
  border: 1px solid rgba(251, 191, 36, 0.45);
}

/* 4. Topbar de Urgencias 24 Horas */
.topbar {
  background-color: var(--bg-darker);
  color: var(--text-light-muted);
  font-size: 0.85rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(22, 163, 74, 0.24);
  color: #86efac;
  padding: 0.22rem 0.7rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.78rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}

.topbar a {
  color: #ffffff;
  font-weight: 700;
}

.topbar a:hover {
  color: var(--accent-bright);
}

/* 5. Header & Navegación Principal */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.15;
  min-width: 0;
}

.brand:hover {
  color: var(--text-main);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  flex-shrink: 0;
  border: 2px solid var(--accent);
}

.brand-text {
  min-width: 0;
}

.brand-text span {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Navegación con Dropdowns Silo */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.8rem;
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.94rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-item:hover .nav-link {
  background-color: var(--bg-alt);
  color: var(--primary-light);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 270px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem;
  display: none;
  z-index: 1100;
}

.dropdown-menu.mega-grid {
  min-width: 520px;
  left: -80px;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 0.75rem;
}

.dropdown-menu.mega-barrios {
  min-width: 540px;
  left: -140px;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem 0.6rem;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  display: block;
}

.nav-item:hover .dropdown-menu.mega-grid,
.nav-item:focus-within .dropdown-menu.mega-grid,
.nav-item:hover .dropdown-menu.mega-barrios,
.nav-item:focus-within .dropdown-menu.mega-barrios {
  display: grid;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 0.86rem;
  font-weight: 600;
}

.dropdown-link:hover {
  background: var(--accent-light);
  color: var(--accent-dark-text);
}

.dropdown-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  margin-top: 0.4rem;
  padding-top: 0.55rem;
  text-align: center;
}

.dropdown-footer a {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
}

/* 6. Botones y CTAs de Alto Contraste */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  font-weight: 800;
  font-size: 0.98rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
}

.btn-call {
  background: var(--accent);
  color: var(--bg-darker) !important;
  box-shadow: var(--shadow-accent);
}

.btn-call:hover {
  transform: translateY(-2px);
  background: var(--accent-bright);
  color: var(--bg-darker) !important;
}

.btn-urgent {
  background: var(--urgent);
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.btn-urgent:hover {
  background: var(--urgent-hover);
  color: #ffffff !important;
  transform: translateY(-2px);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-outline-light:hover {
  background: #ffffff;
  color: var(--bg-darker) !important;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #ffffff !important;
}

.btn-lg {
  padding: 1rem 1.65rem;
  font-size: 1.08rem;
}

.header-cta {
  flex-shrink: 0;
}

.header-cta .btn {
  padding: 0.62rem 1.05rem;
  font-size: 0.92rem;
}

.menu-toggle {
  display: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  flex-shrink: 0;
}

/* 7. Breadcrumbs (Migas de pan SEO) */
.breadcrumbs-bar {
  background: var(--bg-darker);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.65rem 0;
  font-size: 0.85rem;
  color: var(--text-light-muted);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-light-muted);
}

.breadcrumbs a {
  color: var(--text-light-muted);
  font-weight: 500;
}

.breadcrumbs a:hover {
  color: var(--accent-bright);
}

.breadcrumbs .current {
  color: var(--accent-bright);
  font-weight: 700;
}

/* 8. Hero Principal y Hero de Servicios / Barrios */
.hero {
  position: relative;
  background: radial-gradient(circle at 80% 20%, #17335c 0%, var(--bg-dark) 55%, var(--bg-darker) 100%);
  color: #ffffff;
  padding: 3.75rem 0 4.25rem;
  overflow: hidden;
  border-bottom: 4px solid var(--accent);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.hero h1 {
  color: #ffffff;
}

.hero h1 .highlight {
  color: var(--accent-bright);
}

.hero-lead {
  font-size: 1.12rem;
  color: var(--text-light-muted);
  margin-bottom: 1.65rem;
  max-width: 650px;
}

.hero-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr));
  gap: 0.75rem;
  margin-bottom: 1.85rem;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.hero-badge svg {
  color: var(--accent-bright);
  flex-shrink: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.hero-card {
  background: #0d1d35;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.hero-card img {
  border-radius: var(--radius-md);
  margin-bottom: 1.15rem;
  width: 100%;
  object-fit: cover;
  background: var(--bg-darker);
}

.emergency-box {
  background: #132747;
  border-left: 4px solid var(--accent-bright);
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  color: #ffffff;
}

.emergency-box .phone-big {
  display: block;
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  font-weight: 900;
  color: var(--accent-bright);
  letter-spacing: -0.02em;
  margin: 0.2rem 0;
}

/* 9. Barra de Confianza / Estadísticas */
.trust-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.65rem 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.35rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.trust-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent-dark-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}

.trust-item strong {
  display: block;
  font-size: 1.02rem;
  color: var(--text-main);
}

.trust-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* 10. Grids de Tarjetas (Servicios, Barrios, Blog) Sin Desbordamiento */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  color: var(--text-body);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.card-img {
  border-radius: var(--radius-sm);
  margin-bottom: 1.15rem;
  overflow: hidden;
  background: var(--bg-dark);
  border: 1px solid var(--border);
}

.card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-dark-text);
  background: var(--accent-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  width: fit-content;
  max-width: 100%;
}

.card h3 a {
  color: var(--text-main);
}

.card h3 a:hover {
  color: var(--primary-light);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-top: 0.85rem;
  font-size: 0.94rem;
}

.card:hover .card-link {
  color: var(--accent-dark-text);
  gap: 0.65rem;
}

/* 11. Tarjetas de Barrios (Contraste WCAG AAA en Badges) */
.barrio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-body);
}

.barrio-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.barrio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.cp-badge {
  font-size: 0.76rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-sm);
}

.time-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: #14532d;
  background: #dcfce7;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
}

/* 12. Contenido Rico SEO (Listas, Tablas, Bloques de Autoridad) */
.content-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
  width: 100%;
  max-width: 100%;
}

.check-list {
  list-style: none;
  margin: 1.25rem 0;
}

.check-list li {
  position: relative;
  padding-left: 1.85rem;
  margin-bottom: 0.75rem;
  color: var(--text-body);
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 22px;
  height: 22px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.8rem;
}

/* 13. Tablas Comparativas Responsivas (Sin Desbordar el Layout Móvil) */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.seo-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.93rem;
  color: var(--text-body);
  overflow-wrap: break-word;
  word-break: break-word;
}

.seo-table th {
  background: var(--bg-dark);
  color: #ffffff;
  padding: 0.9rem 1rem;
  font-weight: 700;
  overflow-wrap: break-word;
  word-break: break-word;
}

.seo-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: break-word;
}

.seo-table td strong {
  color: var(--text-main);
}

.seo-table tr:last-child td {
  border-bottom: none;
}

.seo-table tr:nth-child(even) {
  background: var(--bg-light);
}

/* 14. Pasos de Proceso */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 1.35rem;
  margin-top: 2rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  color: var(--text-body);
}

.step-num {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--bg-darker);
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* 15. FAQ Acordeón Accesible */
.faq-list {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--text-body);
}

.faq-item summary {
  padding: 1.15rem 1.35rem;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-dark-text);
  transition: var(--transition);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}

.faq-answer {
  padding: 1.2rem 1.35rem;
  color: var(--text-body);
}

/* 16. Bloque de Interlinking (Píldoras de Enlazado Interno Silo) */
.interlink-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.52rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 100%;
}

.pill-link:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
}

.bg-dark .pill-link {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.bg-dark .pill-link:hover {
  background: var(--accent-bright);
  color: var(--bg-darker);
  border-color: var(--accent-bright);
}

/* Dentro de cajas blancas aunque estén en sección oscura */
.bg-dark .content-box .pill-link,
.bg-dark .card .pill-link {
  background: var(--bg-light);
  border-color: var(--border);
  color: var(--text-main);
}

.bg-dark .content-box .pill-link:hover,
.bg-dark .card .pill-link:hover {
  background: var(--primary);
  color: #ffffff;
}

/* 17. Sidebar para Páginas de Servicio, Barrio y Blog */
.layout-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 2.25rem;
  align-items: start;
}

.sidebar-sticky {
  position: sticky;
  top: 94px;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  width: 100%;
}

.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
}

.sidebar-widget.urgent-widget {
  background: var(--bg-dark);
  color: #ffffff;
  border: 2px solid var(--accent);
}

.sidebar-widget.urgent-widget h3,
.sidebar-widget.urgent-widget h4,
.sidebar-widget.urgent-widget strong {
  color: #ffffff;
}

.sidebar-widget.urgent-widget p {
  color: var(--text-light-muted);
}

.sidebar-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.89rem;
  background: var(--bg-light);
}

.sidebar-links a:hover, .sidebar-links a.active {
  background: var(--accent-light);
  color: var(--accent-dark-text);
}

/* 18. Banner CTA de Cierre */
.cta-banner {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--primary) 100%);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2.75rem 2rem;
  text-align: center;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.cta-banner h2 {
  color: #ffffff;
}

.cta-banner p {
  color: var(--text-light-muted);
  max-width: 680px;
  margin: 0 auto 1.65rem;
  font-size: 1.08rem;
}

/* 19. Formulario de Contacto */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text-main);
  background: var(--bg-light);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(30, 66, 115, 0.15);
}

/* 20. Footer Rico en Interlinking y NAP */
.site-footer {
  background: var(--bg-darker);
  color: var(--text-light-muted);
  padding: 4rem 0 2rem;
  border-top: 4px solid var(--accent);
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 2rem;
  margin-bottom: 2.75rem;
}

.site-footer h3, .site-footer h4 {
  color: #ffffff;
  font-size: 1.06rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-light-muted);
}

.footer-links a:hover {
  color: var(--accent-bright);
  padding-left: 4px;
}

.footer-barrios-strip {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1.4rem 0;
  margin-bottom: 1.85rem;
}

.footer-barrios-strip h4 {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-bright);
  margin-bottom: 0.75rem;
}

.footer-barrios-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.84rem;
}

.footer-barrios-links a {
  color: var(--text-light-muted);
}

.footer-barrios-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-light-muted);
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

.footer-legal-links a {
  color: var(--text-light-muted);
}

.footer-legal-links a:hover {
  color: var(--accent-bright);
}

/* 21. Barra Flotante de Llamada Urgente en Móvil */
.mobile-sticky-call {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  background: var(--bg-darker);
  padding: 0.6rem 0.9rem;
  border-top: 2px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-sticky-call a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: var(--accent);
  color: var(--bg-darker) !important;
  font-weight: 900;
  font-size: clamp(0.9rem, 4.2vw, 1.04rem);
  white-space: nowrap;
  padding: 0.78rem 0.6rem;
  border-radius: var(--radius-md);
}

/* 22. Banner de Cookies RGPD / LSSI-CE */
.cookie-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 0.85rem;
  right: 0.85rem;
  max-width: 520px;
  background: var(--bg-dark);
  color: #ffffff;
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-lg);
  z-index: 1300;
  display: none;
}

.cookie-banner.show {
  display: block;
}

.cookie-banner h4 {
  color: #ffffff;
  font-size: 0.94rem;
  margin-bottom: 0.35rem;
}

.cookie-banner p {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-light-muted);
  margin-bottom: 0.75rem;
}

.cookie-banner p a {
  color: var(--accent-bright);
  text-decoration: underline;
}

.cookie-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.cookie-btn {
  padding: 0.52rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-align: center;
}

.cookie-accept {
  background: var(--accent);
  color: var(--bg-darker);
}

.cookie-reject {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

/* 23. Componentes Avanzados UX / CRO Mobile-First & GEO (IA) */
.geo-summary-box {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 2px solid #93c5fd;
  border-left: 6px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.85rem;
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
  width: 100%;
  max-width: 100%;
}

.geo-summary-box p,
.geo-summary-box div {
  color: var(--text-body);
}

.geo-summary-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.geo-badge {
  background: var(--bg-dark);
  color: var(--accent-bright);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  max-width: 100%;
}

.geo-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px dashed #94a3b8;
  font-size: 0.87rem;
}

/* Tarjeta de Caso Real (E-E-A-T Anti-IA) */
.real-case-card {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 5px solid var(--accent-hover);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.45rem;
  margin: 1.4rem 0;
  color: var(--text-body);
}

.real-case-card p {
  color: #1e293b;
}

.real-case-tag {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #92400e;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.real-case-card h3 {
  font-size: 1.12rem;
  color: #78350f;
  margin-bottom: 0.5rem;
}

/* Diagnosticador Interactivo Mobile-First */
.diag-widget {
  background: var(--bg-dark);
  border: 2px solid rgba(251, 191, 36, 0.45);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 100%;
}

.diag-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.15rem 0 1.4rem;
}

.diag-tab {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.68rem 1.05rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.89rem;
  cursor: pointer;
  transition: var(--transition);
  max-width: 100%;
}

.diag-tab:hover, .diag-tab.active {
  background: var(--accent-bright);
  color: var(--bg-darker);
  border-color: var(--accent-bright);
}

.diag-panel {
  display: none;
  background: #102039;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  color: #ffffff;
}

.diag-panel.active {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.35rem;
  align-items: center;
}

.diag-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-darker);
  padding: 1.1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-bright);
  color: #ffffff;
}

/* 24. Reglas Responsivas Mobile-First Estrictas (Cero Scroll Lateral) */
@media (max-width: 1024px) {
  .hero-grid,
  .layout-sidebar,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .trust-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar-sticky {
    position: static;
  }
}

@media (max-width: 960px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    border-bottom: 2px solid var(--accent);
    box-shadow: var(--shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
  }
  .main-nav.open {
    display: flex;
  }
  .dropdown-menu,
  .dropdown-menu.mega-grid,
  .dropdown-menu.mega-barrios {
    position: static;
    display: block;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    background: var(--bg-light);
    grid-template-columns: 1fr;
    margin-top: 0.25rem;
    padding: 0.5rem;
  }
  .topbar-right {
    display: none;
  }
  .mobile-sticky-call {
    display: block;
  }
  body {
    padding-bottom: 74px;
  }
  .cookie-banner {
    bottom: 84px;
  }
  .diag-panel.active {
    grid-template-columns: minmax(0, 1fr);
  }
  .diag-widget {
    padding: 1.25rem;
  }
  .diag-tab {
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }
  /* En móvil ya tenemos la barra fija inferior de llamada, ocultamos el botón duplicado del header para no saturar ni desbordar en 320px-360px */
  .header-cta {
    display: none;
  }
  .brand {
    font-size: 1.02rem;
  }
  .brand-text span {
    font-size: 0.68rem;
  }
  .trust-grid,
  .footer-grid,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
  .section {
    padding: 3rem 0;
  }
  .hero {
    padding: 2.25rem 0 2.75rem;
  }
  .hero-card {
    padding: 1.15rem;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .content-box {
    padding: 1.25rem;
  }
  .cta-banner {
    padding: 1.75rem 1.15rem;
  }
  .geo-summary-box,
  .real-case-card,
  .sidebar-widget {
    padding: 1.15rem;
  }
  .seo-table {
    table-layout: fixed;
    width: 100%;
  }
  .seo-table th,
  .seo-table td {
    padding: 0.55rem 0.5rem;
    font-size: 0.8rem;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
}
