/* ==========================================================================
   Housing Project — components.css
   Componentes UI: botones, header, hero, cards, footer, FAB, cookies, etc.
   Depende de las custom properties definidas en main.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn-hp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-family: var(--hp-font-body);
  font-size: var(--hp-fs-base);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: 2px solid transparent;
  border-radius: var(--hp-radius);
  cursor: pointer;
  transition: transform var(--hp-transition), background-color var(--hp-transition),
    border-color var(--hp-transition), color var(--hp-transition);
}
.btn-hp:hover {
  transform: translateY(-2px);
}
.btn-hp svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.btn-hp--primary {
  background: var(--hp-color-accent);
  color: var(--hp-color-dark);
}
.btn-hp--primary:hover {
  background: var(--hp-color-accent-600);
  color: var(--hp-color-dark);
}

.btn-hp--secondary {
  background: transparent;
  color: var(--hp-color-primary);
  border-color: currentColor;
}
.btn-hp--secondary:hover {
  background: var(--hp-color-primary);
  color: #fff;
}

.btn-hp--ghost {
  background: transparent;
  color: inherit;
  border-color: rgb(255 255 255 / 0.4);
}
.btn-hp--ghost:hover {
  background: rgb(255 255 255 / 0.12);
  color: inherit;
}

.btn-hp--whatsapp {
  background: var(--hp-color-success);
  color: #fff;
}
.btn-hp--whatsapp:hover {
  background: var(--hp-color-success-600);
  color: #fff;
}

.btn-hp--lg {
  padding: 1.05rem 2rem;
  font-size: var(--hp-fs-lg);
}
.btn-group-hp {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hp-space-3);
}

/* --------------------------------------------------------------------------
   Header sticky + navegación
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--hp-color-bg);
  border-bottom: 1px solid var(--hp-color-line);
  transition: box-shadow var(--hp-transition), background-color var(--hp-transition);
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--hp-color-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--hp-shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hp-space-3);
  min-height: var(--hp-header-h);
  flex-wrap: nowrap;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-width: 0;
  max-width: 100%;
  color: var(--hp-color-primary); /* logo navy sobre cabecera clara */
}
.site-logo svg {
  height: clamp(34px, 6.5vw, 42px);
  width: auto;
  max-width: 100%;
  display: block;
  flex: none;
}
/* Logo sobre fondos oscuros (footer, menú móvil): blanco */
.mobile-nav .site-logo,
.site-footer .site-logo {
  color: #fff;
}
.site-footer .site-logo svg {
  height: clamp(38px, 7vw, 48px);
}

.main-nav {
  display: none;
}
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
}
.main-nav a,
.main-nav .nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.55rem;
  font-family: var(--hp-font-display);
  font-weight: 500;
  font-size: var(--hp-fs-sm);
  color: var(--hp-color-text);
  text-decoration: none;
  background: none;
  border: 0;
  border-radius: var(--hp-radius-sm);
  cursor: pointer;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav .nav-trigger:hover {
  color: var(--hp-color-primary);
  background: var(--hp-color-bg-alt);
}
.main-nav a[aria-current="page"] {
  color: var(--hp-color-primary);
  box-shadow: inset 0 -2px 0 var(--hp-color-accent);
}

/* Mega menú (anclas de servicios/reformas) */
.has-megamenu {
  position: relative;
}
.megamenu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 30rem;
  padding: var(--hp-space-6);
  background: var(--hp-color-bg);
  border: 1px solid var(--hp-color-line);
  border-radius: var(--hp-radius);
  box-shadow: var(--hp-shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1.5rem;
  /* Oculto por defecto; se muestra al pasar el ratón o al recibir foco con teclado */
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--hp-transition), transform var(--hp-transition), visibility var(--hp-transition);
}
.has-megamenu:hover .megamenu,
.has-megamenu:focus-within .megamenu {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
.megamenu a {
  padding: 0.55rem 0.6rem;
  font-family: var(--hp-font-body);
  border-radius: var(--hp-radius-sm);
}
.megamenu a strong {
  display: block;
  font-family: var(--hp-font-display);
  font-weight: 600;
  color: var(--hp-color-primary);
}
.megamenu a span {
  font-size: var(--hp-fs-xs);
  color: var(--hp-color-muted);
}
[x-cloak] {
  display: none !important;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--hp-space-3);
  flex: none;
  min-width: 0;
}
.header__phone {
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--hp-font-display);
  font-weight: 600;
  color: var(--hp-color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.header__phone svg {
  flex: none;
}
.header__phone:hover {
  color: var(--hp-color-accent-600);
}

/* Conmutador de idioma */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--hp-font-display);
  font-size: var(--hp-fs-sm);
  font-weight: 600;
}
.lang-switcher a {
  color: var(--hp-color-muted);
  text-decoration: none;
  padding: 0.2rem 0.35rem;
  border-radius: var(--hp-radius-sm);
}
.lang-switcher a[aria-current="true"] {
  color: var(--hp-color-primary);
  background: var(--hp-color-primary-100);
}
.lang-switcher span {
  color: var(--hp-color-line);
}

/* Botón hamburguesa (móvil) */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hp-color-line);
  border-radius: var(--hp-radius-sm);
  background: var(--hp-color-bg);
  color: var(--hp-color-primary);
  cursor: pointer;
}
.nav-toggle svg { width: 24px; height: 24px; }

/* Offcanvas móvil */
.mobile-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(86vw, 360px);
  z-index: 1090;
  background: var(--hp-color-primary);
  color: #fff;
  padding: var(--hp-space-6);
  transform: translateX(100%);
  visibility: hidden; /* fuera del árbol de accesibilidad/tab mientras está cerrado */
  transition: transform 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--hp-space-4);
}
.mobile-nav.is-open {
  transform: translateX(0);
  visibility: visible;
}
.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-nav a {
  color: #fff;
  text-decoration: none;
  font-family: var(--hp-font-display);
  font-size: var(--hp-fs-lg);
  padding: 0.5rem 0;
  display: block;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
}
.mobile-nav .nav-toggle {
  background: transparent;
  border-color: rgb(255 255 255 / 0.3);
  color: #fff;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: rgb(10 27 48 / 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--hp-transition), visibility var(--hp-transition);
}
.nav-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1100px) {
  .main-nav { display: block; }
  .header__phone { display: inline-flex; }
  .nav-toggle { display: none; }
}

/* El botón "Pedir presupuesto" en cabecera solo aparece cuando hay sitio
   suficiente para no comprimir el nav. */
@media (max-width: 1279px) {
  .header__actions .btn-hp--primary { display: none !important; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(520px, 70vh, 720px);
  background: var(--hp-color-primary-700);
  color: #fff;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media picture,
.card-reform picture,
.gallery-item picture {
  display: block;
  width: 100%;
  height: 100%;
}
.card-reform picture { position: absolute; inset: 0; }
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgb(10 27 48 / 0.92) 30%, rgb(10 27 48 / 0.45) 100%);
}
.hero__inner {
  position: relative;
  z-index: 1;
  padding-block: var(--hp-space-24);
}
.hero__content {
  max-width: 46rem;
}
.hero h1 {
  color: #fff;
  font-size: var(--hp-fs-4xl);
}
.hero p {
  font-size: var(--hp-fs-lg);
  color: rgb(228 234 243 / 0.92);
  margin-top: var(--hp-space-4);
  max-width: 40rem;
}
.hero .btn-group-hp {
  margin-top: var(--hp-space-8);
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  margin-bottom: var(--hp-space-6);
  background: rgb(232 197 71 / 0.16);
  border: 1px solid rgb(232 197 71 / 0.5);
  color: var(--hp-color-accent);
  border-radius: 100px;
  font-size: var(--hp-fs-sm);
  font-weight: 600;
}
.hero__badge svg { width: 1em; height: 1em; }

/* Hero secundario (páginas internas) */
.page-hero {
  background: var(--hp-color-primary);
  color: #fff;
  padding-block: clamp(3rem, 5vw, 5rem);
}
.page-hero h1 {
  color: #fff;
  max-width: 22ch;
}
.page-hero p {
  color: rgb(228 234 243 / 0.9);
  font-size: var(--hp-fs-lg);
  max-width: 50ch;
  margin-top: var(--hp-space-3);
}
.page-hero .btn-group-hp { margin-top: var(--hp-space-6); }
.page-hero--media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(4rem, 8vw, 7rem);
}
.page-hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.page-hero__media picture,
.page-hero__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.page-hero--media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(14 36 64 / 0.85) 0%, rgb(14 36 64 / 0.7) 100%);
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb-hp {
  font-size: var(--hp-fs-sm);
}
.breadcrumb-hp ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}
.breadcrumb-hp li::after {
  content: "/";
  margin-left: 0.5rem;
  color: rgb(255 255 255 / 0.4);
}
.breadcrumb-hp li:last-child::after { content: none; }
.breadcrumb-hp a { color: rgb(255 255 255 / 0.8); text-decoration: none; }
.breadcrumb-hp a:hover { color: var(--hp-color-accent); }
.breadcrumb-hp [aria-current="page"] { color: #fff; }

/* --------------------------------------------------------------------------
   Barra de USPs
   -------------------------------------------------------------------------- */
.usp-bar {
  display: grid;
  gap: var(--hp-space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  padding: var(--hp-space-8);
  background: var(--hp-color-bg);
  border: 1px solid var(--hp-color-line);
  border-radius: var(--hp-radius-lg);
  box-shadow: var(--hp-shadow-md);
}
.usp {
  display: flex;
  align-items: center;
  gap: var(--hp-space-3);
}
.usp svg {
  width: 2rem;
  height: 2rem;
  color: var(--hp-color-accent-600);
  flex: none;
}
.usp strong {
  display: block;
  font-family: var(--hp-font-display);
  color: var(--hp-color-primary);
}
.usp span {
  font-size: var(--hp-fs-sm);
  color: var(--hp-color-muted);
}

/* --------------------------------------------------------------------------
   Card de servicio
   -------------------------------------------------------------------------- */
.card-service {
  display: flex;
  flex-direction: column;
  gap: var(--hp-space-3);
  padding: var(--hp-space-8);
  background: var(--hp-color-bg);
  border: 1px solid var(--hp-color-line);
  border-radius: var(--hp-radius);
  text-decoration: none;
  color: inherit;
  transition: transform var(--hp-transition), box-shadow var(--hp-transition),
    border-color var(--hp-transition);
}
.card-service:hover {
  transform: translateY(-4px);
  box-shadow: var(--hp-shadow-md);
  border-color: var(--hp-color-accent);
  color: inherit;
}
.card-service__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--hp-radius-sm);
  background: var(--hp-color-primary-100);
  color: var(--hp-color-primary);
}
.card-service__icon svg { width: 1.75rem; height: 1.75rem; }
.card-service h3 { font-size: var(--hp-fs-lg); }
.card-service p {
  font-size: var(--hp-fs-sm);
  color: var(--hp-color-muted);
  flex: 1;
}
.card-service__more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--hp-font-display);
  font-weight: 600;
  font-size: var(--hp-fs-sm);
  color: var(--hp-color-accent-700);
}
.card-service:hover .card-service__more svg {
  transform: translateX(3px);
}
.card-service__more svg { width: 1em; height: 1em; transition: transform var(--hp-transition); }

/* --------------------------------------------------------------------------
   Card de reforma (visual)
   -------------------------------------------------------------------------- */
.card-reform {
  position: relative;
  display: block;
  min-height: 18rem;
  border-radius: var(--hp-radius);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: var(--hp-color-primary);
}
.card-reform img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card-reform::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(10 27 48 / 0.85) 10%, rgb(10 27 48 / 0) 60%);
}
.card-reform:hover img { transform: scale(1.05); }
.card-reform__body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: var(--hp-space-6);
}
.card-reform__body .chip {
  background: var(--hp-color-accent);
  color: var(--hp-color-dark);
  margin-bottom: var(--hp-space-2);
}
.card-reform h3 { color: #fff; }
.card-reform p { font-size: var(--hp-fs-sm); color: rgb(255 255 255 / 0.85); }

/* Placeholder de imagen (cuando no hay foto real todavía) */
.img-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--hp-color-primary-100),
    var(--hp-color-primary-100) 12px,
    var(--hp-color-bg-alt) 12px,
    var(--hp-color-bg-alt) 24px
  );
  color: var(--hp-color-muted);
  font-size: var(--hp-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.img-placeholder[data-ratio="16/9"] { aspect-ratio: 16 / 9; }
.img-placeholder[data-ratio="4/3"] { aspect-ratio: 4 / 3; }
.img-placeholder[data-ratio="1/1"] { aspect-ratio: 1 / 1; }
.hero__media .img-placeholder { height: 100%; }

/* --------------------------------------------------------------------------
   B2B split
   -------------------------------------------------------------------------- */
.b2b-card {
  padding: var(--hp-space-12);
  border-radius: var(--hp-radius);
  background: var(--hp-color-bg);
  border: 1px solid var(--hp-color-line);
  overflow: hidden;
}
.b2b-card--media {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.b2b-card--media .b2b-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.b2b-card--media .b2b-card__media picture,
.b2b-card--media .b2b-card__media img {
  width: 100%;
  height: 100%;
  display: block;
}
.b2b-card--media .b2b-card__media img {
  object-fit: cover;
  transition: transform 0.4s ease;
}
.b2b-card--media:hover .b2b-card__media img {
  transform: scale(1.04);
}
.b2b-card--media .b2b-card__body {
  padding: var(--hp-space-8) var(--hp-space-8) var(--hp-space-10);
  display: flex;
  flex-direction: column;
  gap: var(--hp-space-3);
  flex: 1;
}
.b2b-card svg.b2b-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--hp-color-accent-600);
  margin-bottom: var(--hp-space-4);
}
.b2b-card--media svg.b2b-card__icon {
  margin-bottom: var(--hp-space-2);
}
.b2b-card ul {
  list-style: none;
  margin-top: var(--hp-space-4);
}
.b2b-card li {
  position: relative;
  padding-left: 1.75rem;
  margin-top: var(--hp-space-2);
}
.b2b-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--hp-color-accent);
}

/* --------------------------------------------------------------------------
   Proceso (timeline 4 pasos)
   -------------------------------------------------------------------------- */
.process {
  display: grid;
  gap: var(--hp-space-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  counter-reset: step;
}
.process__step {
  position: relative;
}
.process__num {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--hp-color-accent);
  color: var(--hp-color-dark);
  font-family: var(--hp-font-display);
  font-weight: 700;
  font-size: var(--hp-fs-lg);
  margin-bottom: var(--hp-space-4);
}
.process__step h3 { font-size: var(--hp-fs-lg); }
.process__step p { font-size: var(--hp-fs-sm); color: var(--hp-color-muted); }

/* --------------------------------------------------------------------------
   Contadores
   -------------------------------------------------------------------------- */
.counters {
  display: grid;
  gap: var(--hp-space-8);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  text-align: center;
}
.counter__num {
  font-family: var(--hp-font-display);
  font-weight: 700;
  font-size: var(--hp-fs-4xl);
  color: var(--hp-color-accent);
  line-height: 1;
}
.counter__label {
  margin-top: var(--hp-space-2);
  color: rgb(255 255 255 / 0.8);
}

/* --------------------------------------------------------------------------
   Testimonios
   -------------------------------------------------------------------------- */
.testimonial {
  height: auto;
  padding: var(--hp-space-8);
  background: var(--hp-color-bg);
  border: 1px solid var(--hp-color-line);
  border-radius: var(--hp-radius);
}
.testimonial__stars {
  color: var(--hp-color-accent-700);
  letter-spacing: 0.1em;
  margin-bottom: var(--hp-space-3);
}
.testimonial blockquote { font-size: var(--hp-fs-lg); }
.testimonial cite {
  display: block;
  margin-top: var(--hp-space-4);
  font-style: normal;
  font-weight: 700;
  color: var(--hp-color-primary);
}
.testimonial cite span {
  display: block;
  font-weight: 400;
  font-size: var(--hp-fs-sm);
  color: var(--hp-color-muted);
}

/* --------------------------------------------------------------------------
   FAQ (accordion nativo con <details>)
   -------------------------------------------------------------------------- */
.faq {
  border-top: 1px solid var(--hp-color-line);
}
.faq__item {
  border-bottom: 1px solid var(--hp-color-line);
}
.faq__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hp-space-4);
  padding: var(--hp-space-6) 0;
  font-family: var(--hp-font-display);
  font-weight: 600;
  font-size: var(--hp-fs-lg);
  color: var(--hp-color-primary);
  cursor: pointer;
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  color: var(--hp-color-accent-700);
  transition: transform var(--hp-transition);
  flex: none;
}
.faq__item[open] summary::after {
  content: "\00d7";
  transform: rotate(0deg);
}
.faq__item p {
  padding-bottom: var(--hp-space-6);
  color: var(--hp-color-muted);
  margin-top: calc(-1 * var(--hp-space-2));
}

/* --------------------------------------------------------------------------
   FAB WhatsApp
   -------------------------------------------------------------------------- */
.wa-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1070;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  background: var(--hp-color-success);
  color: #fff;
  border-radius: 50%;
  box-shadow: var(--hp-shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  animation: wa-pulse 2.5s infinite;
}
.wa-fab.wa-fab--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.wa-fab svg { width: 32px; height: 32px; }
.wa-fab__tip {
  position: absolute;
  right: calc(100% + 0.75rem);
  white-space: nowrap;
  background: var(--hp-color-primary);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: var(--hp-radius-sm);
  font-size: var(--hp-fs-sm);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--hp-transition);
}
.wa-fab:hover .wa-fab__tip { opacity: 1; }

@keyframes wa-pulse {
  0% { box-shadow: 0 0 0 0 rgb(22 163 74 / 0.5); }
  70% { box-shadow: 0 0 0 16px rgb(22 163 74 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(22 163 74 / 0); }
}
@media (prefers-reduced-motion: reduce) {
  .wa-fab { animation: none; }
}
@media (max-width: 1099px) {
  .wa-fab { opacity: 1; visibility: visible; transform: none; }
  .wa-fab__tip { display: none; }
}

/* --------------------------------------------------------------------------
   TOC sticky (hubs largos)
   -------------------------------------------------------------------------- */
.hub-layout {
  display: grid;
  gap: var(--hp-space-12);
}
@media (min-width: 992px) {
  .hub-layout {
    grid-template-columns: 260px 1fr;
    align-items: start;
  }
}
.toc {
  position: sticky;
  top: calc(var(--hp-header-h) + 1.5rem);
}
.toc__title {
  font-family: var(--hp-font-display);
  font-size: var(--hp-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hp-color-muted);
  margin-bottom: var(--hp-space-3);
}
.toc ul { list-style: none; }
.toc a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid var(--hp-color-line);
  color: var(--hp-color-muted);
  text-decoration: none;
  font-size: var(--hp-fs-sm);
}
.toc a:hover { color: var(--hp-color-primary); }
.toc a.is-active {
  color: var(--hp-color-primary);
  border-left-color: var(--hp-color-accent);
  font-weight: 600;
}
/* Chips de índice (alternativa horizontal en móvil) */
.toc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hp-space-2);
}

/* Secciones-ancla de los hubs */
.hub-section {
  scroll-margin-top: calc(var(--hp-header-h) + 1rem);
  padding-block: var(--hp-space-12);
  border-top: 1px solid var(--hp-color-line);
}
.hub-section:first-of-type { border-top: 0; }
.hub-section__head {
  display: flex;
  align-items: center;
  gap: var(--hp-space-4);
  margin-bottom: var(--hp-space-4);
}
.hub-section__head svg {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--hp-color-accent-600);
  flex: none;
}
.hub-section__media {
  margin-block: var(--hp-space-4) var(--hp-space-6);
  border-radius: var(--hp-radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--hp-color-primary-100);
}
.hub-section__media picture,
.hub-section__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.service-list {
  columns: 2;
  column-gap: var(--hp-space-8);
  list-style: none;
  margin-block: var(--hp-space-4);
}
.service-list li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: var(--hp-space-2);
  break-inside: avoid;
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--hp-color-accent);
  transform: rotate(45deg);
}
@media (max-width: 575px) {
  .service-list { columns: 1; }
}

/* --------------------------------------------------------------------------
   Tabla de precios
   -------------------------------------------------------------------------- */
.price-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--hp-color-bg);
  border-radius: var(--hp-radius);
  overflow: hidden;
  border: 1px solid var(--hp-color-line);
}
.price-table th,
.price-table td {
  padding: var(--hp-space-4);
  text-align: left;
  border-bottom: 1px solid var(--hp-color-line);
}
.price-table thead th {
  background: var(--hp-color-primary);
  color: #fff;
  font-family: var(--hp-font-display);
}
.price-table tbody tr:nth-child(even) { background: var(--hp-color-bg-alt); }
.price-table td:last-child { font-weight: 700; color: var(--hp-color-primary); }

/* --------------------------------------------------------------------------
   Galería de proyectos (filtros + lightbox)
   -------------------------------------------------------------------------- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--hp-space-2);
  margin-bottom: var(--hp-space-8);
}
.gallery-filters button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--hp-color-line);
  border-radius: 100px;
  background: var(--hp-color-bg);
  font-family: var(--hp-font-display);
  font-weight: 500;
  font-size: var(--hp-fs-sm);
  color: var(--hp-color-text);
  cursor: pointer;
}
.gallery-filters button[aria-pressed="true"] {
  background: var(--hp-color-primary);
  color: #fff;
  border-color: var(--hp-color-primary);
}
.gallery-grid {
  display: grid;
  gap: var(--hp-space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}
.gallery-item {
  position: relative;
  border: 0;
  padding: 0;
  background: var(--hp-color-primary);
  border-radius: var(--hp-radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  color: #fff;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item[hidden] { display: none; }
.gallery-item__meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--hp-space-4);
  text-align: left;
  background: linear-gradient(to top, rgb(10 27 48 / 0.85), rgb(10 27 48 / 0));
}
.gallery-item__meta strong { display: block; font-family: var(--hp-font-display); }
.gallery-item__meta span { font-size: var(--hp-fs-xs); color: rgb(255 255 255 / 0.8); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  place-items: center;
  padding: var(--hp-space-6);
  background: rgb(10 27 48 / 0.92);
}
.lightbox[open],
.lightbox.is-open { display: grid; }
.lightbox figure {
  max-width: min(900px, 100%);
  background: var(--hp-color-bg);
  border-radius: var(--hp-radius);
  overflow: hidden;
}
.lightbox figcaption {
  padding: var(--hp-space-4);
  color: var(--hp-color-text);
}
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--hp-color-bg);
  color: var(--hp-color-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Mapa click-to-load
   -------------------------------------------------------------------------- */
.map-placeholder {
  display: grid;
  place-items: center;
  gap: var(--hp-space-3);
  aspect-ratio: 16 / 9;
  background: var(--hp-color-primary-100);
  border-radius: var(--hp-radius);
  text-align: center;
  padding: var(--hp-space-6);
}
.map-placeholder > svg {
  width: 48px;
  height: 48px;
  color: var(--hp-color-primary);
}
.map-placeholder iframe,
.map-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--hp-radius);
}

/* --------------------------------------------------------------------------
   Vías de contacto (cards grandes)
   -------------------------------------------------------------------------- */
.contact-methods {
  display: grid;
  gap: var(--hp-space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.contact-method {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--hp-space-3);
  padding: var(--hp-space-8);
  border: 1px solid var(--hp-color-line);
  border-radius: var(--hp-radius);
  text-decoration: none;
  color: inherit;
  background: var(--hp-color-bg);
  transition: transform var(--hp-transition), box-shadow var(--hp-transition);
}
.contact-method:hover { transform: translateY(-4px); box-shadow: var(--hp-shadow-md); color: inherit; }
.contact-method svg { width: 2.25rem; height: 2.25rem; color: var(--hp-color-accent-600); }
.contact-method strong { font-family: var(--hp-font-display); font-size: var(--hp-fs-lg); color: var(--hp-color-primary); }
.contact-method span { color: var(--hp-color-muted); font-size: var(--hp-fs-sm); }

/* --------------------------------------------------------------------------
   CTA final (banda)
   -------------------------------------------------------------------------- */
.cta-band {
  background: var(--hp-color-primary);
  color: #fff;
  border-radius: var(--hp-radius-lg);
  padding: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgb(228 234 243 / 0.9); max-width: 44ch; margin-inline: auto; margin-top: var(--hp-space-3); }
.cta-band .btn-group-hp { justify-content: center; margin-top: var(--hp-space-8); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--hp-color-dark);
  color: rgb(228 234 243 / 0.78);
  padding-block: var(--hp-space-24) var(--hp-space-8);
}
.footer-grid {
  display: grid;
  gap: var(--hp-space-12);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.site-footer h2 {
  font-family: var(--hp-font-display);
  font-size: var(--hp-fs-base);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: var(--hp-space-4);
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: var(--hp-space-2); }
.site-footer a { color: rgb(228 234 243 / 0.78); text-decoration: none; }
.site-footer a:hover { color: var(--hp-color-accent); }
.footer-brand .site-logo { margin-bottom: var(--hp-space-4); }
.footer-brand .site-logo svg { height: 48px; }
.footer-brand p { font-size: var(--hp-fs-sm); }
.footer-social {
  display: flex;
  gap: var(--hp-space-3);
  margin-top: var(--hp-space-4);
}
.footer-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 50%;
}
.footer-social svg { width: 1.15rem; height: 1.15rem; }
.footer-districts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  font-size: var(--hp-fs-sm);
}
.sub-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--hp-space-4);
  margin-top: var(--hp-space-16);
  padding-top: var(--hp-space-8);
  border-top: 1px solid rgb(255 255 255 / 0.12);
  font-size: var(--hp-fs-sm);
}
.sub-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

/* --------------------------------------------------------------------------
   Banner de cookies
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 1095;
  max-width: 720px;
  margin-inline: auto;
  padding: var(--hp-space-6);
  background: var(--hp-color-bg);
  border-top: 3px solid var(--hp-color-accent);
  border-radius: var(--hp-radius);
  box-shadow: var(--hp-shadow-lg);
  transform: translateY(150%);
  transition: transform 0.4s ease;
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner p { font-size: var(--hp-fs-sm); color: var(--hp-color-muted); }
.cookie-banner h2 { font-size: var(--hp-fs-lg); margin-bottom: var(--hp-space-2); }
.cookie-banner .btn-group-hp { margin-top: var(--hp-space-4); }
.cookie-banner .btn-hp { flex: 1; padding-block: 0.7rem; font-size: var(--hp-fs-sm); }

/* --------------------------------------------------------------------------
   Reveal al hacer scroll
   -------------------------------------------------------------------------- */
/* Progressive enhancement: sin JS el contenido es visible (la regla solo aplica
   cuando <html class="js">). Con JS, IntersectionObserver añade .is-visible. */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* Texto enriquecido (legales, artículos) */
.prose { max-width: var(--hp-container-narrow); }
.prose h2 { margin-top: var(--hp-space-12); }
.prose h3 { margin-top: var(--hp-space-8); }
.prose p,
.prose ul,
.prose ol { margin-top: var(--hp-space-4); }
.prose li { margin-bottom: var(--hp-space-2); }
.prose a { color: var(--hp-color-primary-500); }
