/* ========== Skip Link (Accessibility) ========== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #136972;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10001;
  font-family: "Work Sans", sans-serif;
  font-weight: 500;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #b1e723;
  outline-offset: 2px;
}

/* ========== Header & Footer (base) ========== */
.Header {
  position: fixed;
  top: 0;
  z-index: 10000;
  width: 100%;
  backdrop-filter: blur(24px);
  background-color: rgba(19, 26, 27, 0.1);
  will-change: width, left;
}

:root {
  --header-fg-on-dark: #eef4eb;
  --header-fg-on-light: #000;
}

/* Color de la línea de hover/activo (scoped al header) */
.Header {
  --hover-underline: #b1e723;
} /* default en on-dark */
.Header--on-light {
  --hover-underline: #208994;
} /* sobre fondo claro */

.Header,
.Header__Navegacion,
.Header__Burger {
  transition: color 200ms ease;
}
.Header__Img {
  transition: opacity 200ms ease;
  display: block;
}
.Header__Navegacion a {
  color: inherit;
  text-decoration: none;
}

.Header__Navegacion {
  color: var(--header-fg-on-dark);
}

/* Variante para fondos claros */
.Header--on-light .Header__Navegacion {
  color: var(--header-fg-on-light);
}
.Header--on-light .Header__Burger {
  color: var(--header-fg-on-light);
}

.Header--on-light .Button__Contacto {
  color: var(--header-fg-on-light);
}

.Header__Toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.Header__Burger {
  display: none;
}

.Header__List {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 16px 0;
  text-align: center;
}

.Header__Img {
  width: 175px;
  height: 51px;
}

.Header__Navegacion {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin: auto;
  font: 400 1rem/1 "Montserrat", system-ui, sans-serif;
  color: #eef4eb;
}

.Header__Buttons {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.Header .Button__Contacto {
  color: #fff;
}

/* -------- Footer -------- */
footer {
  color: #eef4eb;
  width: 100%;
  background: linear-gradient(
        0deg,
        rgba(97, 180, 63, 0.2),
        rgba(97, 180, 63, 0.2)
      )
      0 0/100% 100% no-repeat,
    linear-gradient(0deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)) 0 0/100% 100%
      no-repeat,
    url(/Inicio/Recursos_Inicio/Imagenes/Footer.png) center/cover no-repeat;
  margin-top: auto;
  padding: 64px var(--lap-px);
}

footer :where(a) {
  color: #eef4eb;
}
footer :where(a):hover {
  opacity: 0.7;
}

.ContainerFooter__1 {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 1fr;
  gap: 70px;
  align-items: start;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ContainerFooter__Secciones,
.ContainerFooter__Visitanos,
.ContainerFooter__Contacto,
.ContainerFooter__LogoYRedes {
  display: grid;
  align-content: start;
  gap: 16px;
}

.ContainerFooter__LogoYRedes {
  gap: 24px;
}

.LogoFooter {
  max-width: 257px;
  max-height: 63px;
  margin-bottom: 8px;
}

.ContainerFooter__LogoYRedes .LogoFooter img {
  width: 257px;
  max-height: 63px;
  height: auto;
  display: block;
}

footer img {
  max-width: 100%;
  height: auto;
}

.RedesList {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 12px;
}

.RedesFooter:link {
  color: #fff;
  display: inline-flex;
  width: 40px;
  height: 40px;
  font-size: 40px;
  align-items: center;
}

.FooterCopy {
  opacity: 0.8;
}

.ContainerFooter__Contacto {
  min-width: 202px;
}

/* ========== Animaciones generales ========== */
.rb-word {
  display: inline-block;
  will-change: transform, opacity;
}

/* ========== Header: subrayado animado ========== */
.Header__Navegacion .Header__Navegacion--Txt {
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}
.Header__Navegacion .Header__Navegacion--Txt::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background-color: var(--hover-underline);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease-out, background-color 0.18s ease-out;
}

/* Activo (dos variantes unificadas) */
.Header__Navegacion
  :is(
    .Header__Navegacion--Txt.is-current,
    li.is-current > .Header__Navegacion--Txt
  )::after {
  transform: scaleX(1);
}
/* No retraer la línea del activo salvo que pases el mouse por la barra */
.Header__Navegacion:hover
  :is(
    .Header__Navegacion--Txt.is-current,
    li.is-current > .Header__Navegacion--Txt
  ):not(:hover)::after {
  transform: scaleX(0);
}
/* Hover / foco */
.Header__Navegacion .Header__Navegacion--Txt:is(:hover, :focus-visible)::after {
  transform: scaleX(1);
}
.Header__Navegacion .Header__Navegacion--Txt:focus-visible {
  outline: 2px solid rgba(177, 231, 35, 0.6);
  outline-offset: 3px;
}
/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .Header__Navegacion .Header__Navegacion--Txt::after {
    transition: none;
  }
}

/* ========== Menú móvil (≤1450px) ========== */
@media (max-width: 1550px) {
  :root {
    --panel-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  }

  .Header {
    position: absolute;
  }

  .Header__Burger {
    position: absolute;
    right: 24px;
    top: 22px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #eef4eb;
    cursor: pointer;
    z-index: 11;
    -webkit-tap-highlight-color: transparent;
  }
  .Header__Burger:active {
    transform: scale(0.97);
  }
  .Header__Burger:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.25);
    outline-offset: 3px;
  }
  .Header__Burger i {
    display: none !important;
  }

  .Header__Burger::before,
  .Header__Burger::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 24px;
    height: 3px;
    background: currentColor;
    border-radius: 2px;
    transform: translateX(-50%) rotate(0deg);
    transform-origin: 50% 50%;
    transition: top 0.32s var(--panel-ease), transform 0.32s var(--panel-ease);
  }
  .Header__Burger::before {
    top: 16px;
  }
  .Header__Burger::after {
    top: 26px;
  }

  .Header__Toggle:checked + .Header__Burger::before {
    top: 22px;
    transform: translateX(-50%) rotate(45deg);
  }
  .Header__Toggle:checked + .Header__Burger::after {
    top: 22px;
    transform: translateX(-50%) rotate(-45deg);
  }

  .Header__List {
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    text-align: left;
  }
  .Header__List > li:first-child {
    align-self: flex-start;
    flex: 0 0 auto;
  }
  .Header__Img {
    display: block;
  }

  .Header__Navegacion,
  .Header__Buttons {
    display: flex !important;
  }

  .Header__List > li:nth-child(2),
  .Header__List > li:nth-child(3) {
    overflow: hidden;
    max-height: 0;
    padding-top: 0;
    flex: 0 0 100%;
    width: 100%;
    transition: max-height 0.45s var(--panel-ease) 0.16s,
      padding 0.3s var(--panel-ease) 0.16s;
    will-change: max-height;
  }

  .Header__List > li:nth-child(2) .Header__Navegacion,
  .Header__List > li:nth-child(3) .Header__Buttons {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    visibility: hidden;
    width: 100%;
    transition: opacity 0.28s var(--panel-ease),
      transform 0.28s var(--panel-ease), visibility 0s linear 0.28s;
    will-change: opacity, transform;
  }

  .Header__List > li:nth-child(2) .Header__Navegacion > li {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.28s var(--panel-ease),
      transform 0.28s var(--panel-ease);
  }

  .Header__Toggle:checked
    ~ .Header__List
    > li:nth-child(2)
    .Header__Navegacion
    > li:nth-child(1) {
    transition-delay: 0.02s;
  }
  .Header__Toggle:checked
    ~ .Header__List
    > li:nth-child(2)
    .Header__Navegacion
    > li:nth-child(2) {
    transition-delay: 0.06s;
  }
  .Header__Toggle:checked
    ~ .Header__List
    > li:nth-child(2)
    .Header__Navegacion
    > li:nth-child(3) {
    transition-delay: 0.1s;
  }
  .Header__Toggle:checked
    ~ .Header__List
    > li:nth-child(2)
    .Header__Navegacion
    > li:nth-child(4) {
    transition-delay: 0.14s;
  }
  .Header__Toggle:checked
    ~ .Header__List
    > li:nth-child(2)
    .Header__Navegacion
    > li:nth-child(5) {
    transition-delay: 0.18s;
  }
  .Header__Toggle:checked
    ~ .Header__List
    > li:nth-child(2)
    .Header__Navegacion
    > li:nth-child(6) {
    transition-delay: 0.22s;
  }

  /* === Abierto === */
  .Header__Toggle:checked ~ .Header__List > li:nth-child(2) {
    display: flex;
    justify-content: flex-end;
    max-height: clamp(160px, 50vh, 420px);
    padding-top: 8px;
    transition-delay: 0s, 0s;
  }
  .Header__Toggle:checked ~ .Header__List > li:nth-child(3) {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 200px;
    padding-top: 8px;
    transition-delay: 0s, 0s;
  }
  .Header__Toggle:checked ~ .Header__List > li:nth-child(2) .Header__Navegacion,
  .Header__Toggle:checked ~ .Header__List > li:nth-child(3) .Header__Buttons {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.28s var(--panel-ease),
      transform 0.28s var(--panel-ease), visibility 0s linear 0s;
  }
  .Header__Toggle:checked
    ~ .Header__List
    > li:nth-child(2)
    .Header__Navegacion
    > li {
    opacity: 1;
    transform: translateY(0);
  }

  .Header__Navegacion {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .Header__Navegacion > li {
    width: auto;
  }
  .Header__Navegacion > li > .Header__Navegacion--Txt,
  .Header__Navegacion > li.Header__Navegacion--Txt {
    display: inline-block;
    width: max-content;
    line-height: 1.1;
    padding-top: 14px;
    padding-bottom: 8px;
    margin-inline: auto;
  }

  .Header__Buttons {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: max-content;
    margin: 16px auto;
    padding: 0;
  }
  .Header__Buttons li {
    display: flex;
  }
  .Header__Buttons :is(a, .Button__Otros, .Button__Contacto) {
    width: auto;
    white-space: nowrap;
  }
  
  .Header__Navegacion > li + li {
    border-top: 1px solid color-mix(in oklab, #136972, white 85%);
    width: 100%;
  }
}

/* --- FIX burger dentro del padding (1025–1550px) --- */
@media (min-width: 1025px) and (max-width: 1550px) {
  .Header {
    padding-inline: var(--px-fluid);
  }
  .Header__Burger {
    right: var(--px-fluid);
  }
}

/* ========== Portátiles (1025–1450px) ========== */
@media (min-width: 1025px) and (max-width: 1550px) {
  .Header {
    padding-inline: var(--lap-px);
  }
  footer {
    padding-inline: var(--lap-px);
  }
}

/* ========== Tablets (≤1024px) ========== */
@media (max-width: 1024px) {
  .Header {
    padding-inline: var(--tab-px);
  }
  footer {
    padding-inline: var(--tab-px);
  }

  .ContainerFooter__1 {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }
  .ContainerFooter__Secciones {
    order: 1;
  }
  .ContainerFooter__Visitanos {
    order: 2;
  }
  .ContainerFooter__Contacto {
    order: 3;
    min-width: auto;
  }
  .ContainerFooter__LogoYRedes {
    grid-column: 1 / -1;
    order: 4;
  }
}

/* ========== Teléfonos (≤600px) ========== */
@media (max-width: 600px) {
  .Header {
    padding-inline: 24px;
  }
  .Header__Burger {
    padding-bottom: 16px;
  }

  footer {
    padding: 40px 24px;
  }
  .ContainerFooter__1 {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .ContainerFooter__LogoYRedes {
    order: 4;
    grid-column: auto;
  }
}
@media (min-width: 1025px) {
  footer,
  .Header {
    padding-inline: var(--px-fluid);
  }
}

@media (min-width: 1025px) and (max-width: 1550px) {
  .Header {
    padding-inline: var(--lap-px);
  }
  .Header__Burger {
    right: var(--lap-px);
  }
}

/* ========== Pantalla de Carga ========== */
.pantalla-carga {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #165545 !important;
  background-image: none !important;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.pantalla-carga.oculto {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pantalla-carga__contenido {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.pantalla-carga__spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #eef4eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.pantalla-carga__texto {
  color: #eef4eb !important;
  font-family: "Work Sans", sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Prevenir scroll durante la carga */
body.cargando {
  overflow: hidden;
}
