/* ==========================================================================
   HEADER — Figma node 293:479 (1440x160)
   El header NO ocupa espacio en el flujo: en Figma está superpuesto sobre el
   hero de cada página (por eso todos los heroes tienen padding-top 200px, que
   ya incluye los 160px del header). Su fondo es una imagen con la onda rosa
   y debajo de la onda es transparente, así que debe ir en position:absolute
   sobre el hero — si se pone en flujo normal, el fondo del menú se corta y
   no empalma con el hero (bug reportado).
   ========================================================================== */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  padding: 16px 0 0;
  background-image: url('../images/desktop/header/header-bg.webp');
  background-size: 100% 100%;
  background-position: top center;
  background-repeat: no-repeat;
  pointer-events: none; /* deja pasar el clic en la zona transparente de la onda */
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  pointer-events: auto;
}

/* Logo: 199x78 en Figma */
.site-header__logo img {
  width: 199px;
  height: auto;
}

/* Menú: bloque de 857px con los 6 enlaces repartidos (space-between) */
.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;              /* separación mínima: nunca se tocan */
  width: var(--w-8col);
  max-width: 100%;
}

.site-header__nav a {
  font-family: var(--font-heading);
  /* Figma usa 20px con SF Pro Display; Inter (la sustituta libre) es más ancha
     y a 20px las 6 etiquetas suman 858px, justo el ancho del bloque, dejando
     los enlaces pegados. El tamaño acompaña al ancho del bloque (que también
     escala), con tope en los 18px que caben a 1440px. */
  font-size: clamp(12px, 1.25vw, 18px);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  color: var(--color-blanco);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.site-header__nav a.is-active,
.site-header__nav a:hover {
  color: var(--color-secundario);
}

.site-header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.site-header__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-blanco);
}

@media (max-width: 1023px) {
  .site-header { height: 120px; }
  .site-header__logo img { width: 150px; }
  .site-header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    padding: 24px var(--grid-margin) 32px;
    background: var(--color-primario);
  }
  .site-header__nav.is-open { display: flex; }
  .site-header__burger { display: flex; }
}

/* ==========================================================================
   FOOTER — Figma node 621:1027 (1440x936)
   ========================================================================== */

.site-footer {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--color-bg);
}

/* --- Bloque superior (rosa claro): "Únete a nuestra comunidad" ----------- */
.site-footer__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
  padding: 80px var(--grid-margin);
  background: var(--color-bg);
}

.site-footer__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--w-8col);
  max-width: 100%;
  text-align: center;
}
.site-footer__intro h2 {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, var(--fs-h3));
  font-weight: var(--fw-bold);
  color: var(--color-primario);
  text-transform: uppercase;
}
.site-footer__intro p {
  font-family: var(--font-heading);
  font-size: var(--fs-body-lg);
  color: var(--color-gris-oscuro);
}

/* Dos iconos de 89px repartidos en un bloque de 200px */
.site-footer__social {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 200px;
}
.site-footer__social img { width: 89px; height: 89px; }

/* --- Pleca (onda rosa + morada) -----------------------------------------
   En Figma el SVG mide 1440x184.69 pero su contenedor lo recorta a 98px de
   alto: sólo se ve la cresta. El bloque morado de abajo continúa el color.  */
.site-footer__pleca {
  position: relative;
  width: 100%;
  height: 98px;
  overflow: hidden;
  line-height: 0;
}
.site-footer__pleca img {
  display: block;
  width: 100%;
  height: 184.69px;
}

/* --- Bloque inferior (morado) ------------------------------------------- */
.site-footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 80px;
  width: 100%;
  padding: 0 var(--grid-margin) 40px;
  background: var(--color-primario);
  color: var(--color-blanco);
}

/* Fila logo + aviso */
.site-footer__row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0px;
  gap: 10px;
  width: 100%;
}
.site-footer__logo img { width: 199px; height: auto; }

.site-footer__warning {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 20px;
  width: 740px;
  height: 120px;
  flex-shrink: 0;
}
.site-footer__warning img { width: 89px; height: 89px; flex-shrink: 0; }
.site-footer__warning p {
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 24px;
  text-transform: uppercase;
  color: #FFFFFF;
  flex-grow: 1;
}

/* Bloque legal: enlaces + tarjeta UNE + copyright, separados 16px entre sí
   (en Figma es un grupo propio; antes heredaban el gap de 80px del padre y
   por eso el pie quedaba desarmado). */
.site-footer__legal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0px;
  gap: 16px;
  width: 100%;
}

.site-footer__links {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0px;
  gap: 20px;
  width: 857px;
  height: 24px;
}
.site-footer__links a {
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 24px;
  color: #FFFFFF;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.site-footer__links a:hover { color: var(--color-secundario); }

.site-footer__une {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 24px 96px 24px 40px;
  gap: 32px;
  width: 100%;
  height: 162px;
  background: #FFFFFF;
  border-radius: 24px;
}
.site-footer__une p {
  width: 817px;
  height: auto;
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 19px;
  color: #543784;
}

/* Bloque de sellos: 199x112 en Figma, 2x2 */
.site-footer__badges {
  width: 199px;
  height: 112px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  align-items: center;
  justify-items: center;
  gap: 8px 12px;
  flex-shrink: 0;
}
.site-footer__badges img { max-height: 48px; width: auto; }

.site-footer__copy {
  width: 817px;
  height: 19px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  line-height: 19px;
  color: #FFFFFF;
}

@media (max-width: 1023px) {
  .site-footer__bottom { gap: 48px; }
  .site-footer__row { flex-wrap: wrap; }
  .site-footer__warning { width: 100%; }
  .site-footer__warning p { font-size: var(--fs-body); }
  .site-footer__links { width: 100%; flex-wrap: wrap; gap: 16px 32px; justify-content: flex-start; }
  .site-footer__une { flex-wrap: wrap; gap: 32px; padding: 24px; }
  .site-footer__une p { width: 100%; }
  .site-footer__badges { width: auto; grid-template-columns: repeat(4, auto); }
}

@media (max-width: 767px) {
  .site-footer__pleca { height: 60px; }
  .site-footer__pleca img { height: 120px; }
  .site-footer__badges { grid-template-columns: repeat(2, auto); }
}

/* ==========================================================================
   Botón flotante de WhatsApp — Figma "Isolation_Mode" 244x54.

   En Figma es un carril absoluto que arranca en y=395 y llega hasta el final
   de la página, con el botón en `sticky top:0` dentro. Es decir: empieza a la
   altura del hero y, al hacer scroll, sube hasta quedarse pegado arriba.
   ========================================================================== */
.whatsapp-float-wrap {
  position: absolute;
  /* 395/998: acompaña al escalado del hero para no montarse sobre el corazón */
  top: min(395px, 39.58svh);
  bottom: 0;
  right: 27px;
  z-index: 45;
  width: 244px;
  max-width: 45vw;
  pointer-events: none;   /* el carril no debe interceptar clics */
}

.whatsapp-float {
  position: sticky;
  top: 24px;
  display: block;
  width: 100%;
  pointer-events: auto;
  transition: transform 0.2s ease;
}
.whatsapp-float:hover { transform: translateX(-4px); }
.whatsapp-float img { display: block; width: 100%; height: auto; }

@media (max-width: 1023px) {
  .whatsapp-float-wrap { top: 300px; right: 16px; width: 200px; }
}

@media (max-width: 767px) {
  /* En móvil no hay sitio para el carril: se ancla abajo a la derecha. */
  .whatsapp-float-wrap {
    position: fixed;
    top: auto;
    bottom: 16px;
    right: 12px;
    width: 180px;
  }
  .whatsapp-float { position: static; }
}
