/* ========================================================= 
   🎛️ Header Reutilizable — Grupo Sierra
========================================================= */
html, body{
  scroll-behavior: auto;
}
@media (prefers-reduced-motion: reduce){
  html, body{ scroll-behavior: auto; }
}

/* ========= Variables generales */
:root{
  --brand: #414141;        /* Neutro cálido / gris carbón */

  --text:  #111111;        /* Negro */
  --bg:    #181313;        /* Vino-negro */

  --header-bg: #FFFFFF;    /* Blanco */
  --header-stroke: rgba(0,0,0,0.10); /* Trazo oscuro suave */

  --header-height: 70px;
  --header-z: 1000;
  --header-offset: calc(var(--header-height) + 8px);
}

/* ========= Estructura base */
.container{
  max-width:1100px;
  margin:0 auto;
  padding:0 14px;
}
.gs-header, .gs-nav, .gs-nav__list{ box-sizing:border-box; }
.gs-nav__list{ list-style:none; margin:0; padding:0; }

/* ========= Header flotante */
.gs-header{
  position:fixed;
  top:16px; left:50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 1200px;
  z-index:var(--header-z);
  height:var(--header-height);
  background: #ffffff;                      /* Sólido blanco original */
  border: none;                             /* Sin bordes duros para evitar el efecto línea */
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(212, 60, 60, 0.08); /* Sombra flotante premium con brillo rojo tenue */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gs-header--scrolled{
  background: #ffffff !important;           /* Sólido blanco original */
  border: none !important;
  box-shadow: 0 15px 35px rgba(212, 60, 60, 0.12) !important;
}
.gs-header__wrap{
  height:var(--header-height);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
}

/* Nuevas secciones alineadas */
.gs-header__left{
  display: flex;
  align-items: center;
  gap: 14px;
}
.gs-header__right{
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Controles de navegación y título */
.gs-header__nav-arrows {
  display: flex;
  gap: 6px;
}
.gs-header__arrow {
  background: rgba(184, 24, 24, 0.06);
  color: #B81818;
  border: 1px solid rgba(184, 24, 24, 0.15);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  outline: none;
  padding: 0 0 2px 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none; /* Asegura que el enlace no tenga subrayado */
}
.gs-header__arrow--home {
  font-size: 0.95rem; /* Ajuste para el tamaño de la casita */
  padding: 0 !important; /* Centrado óptico exacto del icono */
}
.gs-header__arrow:hover {
  background: #B81818;
  color: #ffffff !important;
  border-color: #B81818;
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(184, 24, 24, 0.2);
}
.gs-header__arrow:active {
  transform: scale(0.95);
}
.gs-header__title {
  font-size: 1rem;
  font-weight: 800;
  color: #111111 !important;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

/* Buscador con icono de lupa */
.gs-header__search {
  position: relative;
  display: flex;
  align-items: center;
}
.gs-header__search-icon {
  position: absolute;
  left: 12px;
  color: #777777;
  font-size: 0.85rem;
  pointer-events: none;
  transition: color 0.3s ease;
}
.gs-header__search input {
  padding: 8px 12px 8px 34px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #111111 !important;
  font-size: 0.88rem !important;
  width: 180px !important;
  height: 36px !important;
  outline: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.gs-header__search input:focus {
  width: 240px !important;
  border-color: #B81818 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(184, 24, 24, 0.15) !important;
}
.gs-header__search input:focus + .gs-header__search-icon {
  color: #B81818;
}

/* ========= Logo (grande) */
.gs-logo{ display:flex; align-items:center; }
.gs-logo__img{
  height:58px;
  width:auto;
  display:block;
  object-fit:contain;
  filter: none !important;                  /* Conserva los colores originales exactos (S roja y texto negro) */
}

/* ========= Navegación (desktop) */
.gs-nav{ display:block; }
.gs-nav__list{ display:flex; gap:12px; }

/* ===== Enlaces ===== */
.gs-nav__link{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:5px;

  color: var(--text);
  text-decoration:none;
  font-family: 'Inter', system-ui, Arial;
  font-weight: 400;
  font-size: .95rem;
  line-height: 1.1;

  padding: 4px 6px;
  border-radius: 10px;

  transition: color .2s ease, transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.gs-nav__icon{
  font-size: .95rem;
  opacity:.9;
  color: var(--text);
}

.gs-nav__link:hover{
  color: var(--gold);
  transform: translateY(-1px);
}
.gs-nav__link:hover::after{ transform: scaleX(1); }

/* ===== Activo: solo línea roja, sin pill ===== */
.gs-nav__link.is-active{
  color: var(--text) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.gs-nav__link.is-active::after{ transform: scaleX(1) !important; }
.gs-nav__link.is-active:hover{ color: var(--text) !important; }
.gs-nav__link:active{ transform: translateY(0); }

/* =========================================================
   Hamburguesa → X con texto dinámico (Menú ⇄ Cerrar)
========================================================= */
.gs-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 60, 60, 0.25);
  background: rgba(255, 255, 255, 0.6);
  color: #111111;
  font-family: 'Inter', system-ui, Arial, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== Texto ===== */
.gs-burger__text {
  position: relative;
  display: inline-block;
  width: 60px;            /* 💡 ancho fijo para evitar movimiento */
  height: 1em;            /* asegura espacio vertical */
  overflow: hidden;
  text-align: center;
  line-height: 1em;
  color: inherit;
  transition: color 0.3s ease;
}

/* Animación interna (Menú ⇄ Cerrar) */
.gs-burger__text::before,
.gs-burger__text::after {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.gs-burger__text::before {
  content: "Menú";
  transform: translateY(0);
  opacity: 1;
}

.gs-burger__text::after {
  content: "Cerrar";
  transform: translateY(130%);
  opacity: 0;
}

/* El SVG no recorta los extremos redondeados del trazo */
.gs-burger__icon{
  width: 24px;
  height: 24px;
  display: block;
  overflow: visible;              /* ⬅️ evita clipping */
}

.gs-burger__icon .line{
  stroke: #111111;
  stroke-width: 2.6;              /* un pelín más grueso para legibilidad */
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .3s ease, opacity .3s ease, stroke .25s ease;
}

/* Estado ABIERTO: la X roja (con traslación acorde al nuevo grid) */
html.gs-nav-open .gs-burger__icon .line { stroke:#ff0000; }
html.gs-nav-open .gs-burger__icon .line.top { transform: translateY(6px) rotate(45deg); }
html.gs-nav-open .gs-burger__icon .line.mid { opacity: 0; }
html.gs-nav-open .gs-burger__icon .line.bot { transform: translateY(-6px) rotate(-45deg); }

/* toque de presencia a la X */
html.gs-nav-open .gs-burger__icon { transform: translateZ(0); }
html.gs-nav-open .gs-burger__icon .line.top,
html.gs-nav-open .gs-burger__icon .line.bot { will-change: transform; }

/* Cerrar */
/* Animación: cambia el texto al abrir el menú */
/* Animación: cambia el texto al abrir el menú */
html.gs-nav-open .gs-burger__text::before{transform:translateY(-130%);opacity:0;}
html.gs-nav-open .gs-burger__text::after{transform:translateY(0);opacity:1;color:#ff0000;}

/* ===== Ajuste móvil ===== */
@media (max-width: 900px) {
  .gs-burger {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  .gs-burger__text {
    width: 54px; /* se ajusta levemente */
  }
}

/* =========================================================
   📱 Responsive — móvil / tablet
========================================================= */
@media (max-width: 900px){
  :root{ --header-height: 60px; }
  :root{ --header-offset: calc(var(--header-height) + 8px); }

  .gs-logo__img{ height:52px; }
  .gs-burger{ display:flex; }

  /* Menú móvil oscuro (se mantiene) */
  .gs-nav{
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    height: 0;
    overflow: hidden;
    background: rgba(24,19,19,0.94);
    background: color-mix(in oklab, var(--bg) 88%, #000 12%);
    border-bottom: 0px solid transparent;
    transition: height .25s ease, border-color .25s ease;
  }
  html.gs-nav-open .gs-nav{
    height: calc(100dvh - var(--header-height));
    border-bottom: 1px solid var(--header-stroke);
  }

  .gs-nav__list{
    flex-direction: column;
    align-items: center;
    justify-content: start;
    padding: 22px 0 30px;
    gap: 16px;
    text-align: center;
  }

  .gs-nav__link{
    font-size: 1.05rem;
    font-weight: 400;
    padding: 6px 8px;
  }
  .gs-nav__icon{ font-size: 1.05rem; }
  .gs-nav__link:hover,
  .gs-nav__link.is-active{
    color: var(--text);
  }
}

/* ========= Offset global si tu contenido va debajo del header fijo */
.gs-offset{ padding-top: var(--header-offset); }

/* =========================================================
   Barra lateral vertical — glass gris claro
========================================================= */
.gs-social-rail {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: none;                              /* ⬅️ OCULTA por defecto */
  flex-direction: column;
  gap: 12px;
  padding: 12px 10px;
  border-radius: 22px;
  background: rgba(255,255,255,0.22);         /* glass casi transparente */
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 1200;
}

/* ==== Botones individuales ==== */
.gs-rail__btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(206, 199, 199, 0.55);
  text-decoration: none;
  transition: transform .2s ease, background .25s ease, box-shadow .25s ease;
}
.gs-rail__btn:hover {
  transform: translateY(-2px);
  background: rgba(245, 239, 239, 0.7);
}
.gs-rail__btn i {
  font-size: 22px;
  transition: transform .25s ease, color .25s ease;
}
.gs-rail__btn:hover i {
  transform: scale(1.1);
}

/* ==== Íconos con colores oficiales exactos ==== */
.gs-rail__btn--tiktok i {
  color: #000000;
  background: linear-gradient(90deg, #69C9D0 0%, #EE1D52 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gs-rail__btn--youtube i   { color: #FF0000; }
.gs-rail__btn--whatsapp i  { color: #0baa45; }
.gs-rail__btn--phone i     { color: #000000; }

/* ==== Responsive: visible solo en tablet/móvil ==== */
@media (max-width: 900px) {
  .gs-social-rail {
    display: flex;                           /* ⬅️ MOSTRAR en ≤900px */
    right: 10px;
    padding: 10px 8px;
    gap: 10px;
    background: rgba(255,255,255,0.3);
  }
  .gs-rail__btn {
    width: 42px;
    height: 42px;
  }
  .gs-rail__btn i {
    font-size: 20px;
  }
}

/* ===== PARCHE — Header compacto y offsets coherentes ===== */
:root{
  --header-height: 80px !important;
  --header-offset: calc(var(--header-height) + 8px) !important;
}
.gs-header,
.gs-header__wrap{ height: var(--header-height) !important; }

.gs-logo__img{
  height: calc(var(--header-height) - 6px) !important;
  width: auto;
}

/* Menú más junto (forzado) */
.gs-nav__list{ gap: 10px !important; }
.gs-nav__link{
  padding: 3px 6px !important;
  gap: 5px !important;
  font-size: .95rem !important;
  line-height: 1.1 !important;
}


:root{
  /* ya lo tienes, lo reutilizamos */
  --header-offset: calc(var(--header-height) + 8px);
  /* 👇 padding global para TODAS las anclas */
  scroll-padding-top: var(--header-offset);
}

/* inicio necesita un extra por la sombra/hero */
#inicio{
  scroll-margin-top: calc(var(--header-offset) + 15px) !important;
}

/* los demás usan el offset estándar */
#proyectos,
#servicios,
#quienes{
  scroll-margin-top: var(--header-offset) !important;
}
/* Anclas con offset correcto */
#inicio {
  scroll-margin-top: calc(var(--header-offset) + 15px) !important;
}

#proyectos,
#servicios,
#quienes {
  scroll-margin-top: var(--header-offset) !important;
}


.gs-hero{ margin-top: 0 !important; }

@media (max-width: 900px){
  :root{
    --header-height: 58px !important;
    --header-offset: calc(var(--header-height) + 8px) !important;
  }
  .gs-logo__img{ height: calc(var(--header-height) - 4px) !important; }
}

/* Desktop: separación final */
@media (min-width: 901px){
  .gs-nav__list{ gap: 12px !important; }
}

/* =========================================================
   📱 HAMBURGUESA — separación garantizada
========================================================= */
@media (max-width: 900px){
  html.gs-nav-open #gs-main-nav .gs-nav__list{
    display: block !important;
    padding: 44px 0 64px !important;
    text-align: center;
  }
  html.gs-nav-open #gs-main-nav .gs-nav__list > li{
    display: block !important;
    margin: 0 0 10px 0 !important;
  }
  html.gs-nav-open #gs-main-nav .gs-nav__list > li:last-child{
    margin-bottom: 0 !important;
  }
  html.gs-nav-open #gs-main-nav .gs-nav__link{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 22px !important;
    font-size: 1.2rem !important;
    line-height: 1.35 !important;
    letter-spacing: .4px !important;
    border-radius: 14px !important;
  }
  html.gs-nav-open #gs-main-nav .gs-nav__icon{
    font-size: 1.25rem !important;
    margin-right: 8px !important;
  }
}

/* =========================================================
   Margen lateral en header (espaciado visual)
========================================================= */
.gs-header__wrap {
  padding-left: 24px !important;
  padding-right: 24px !important;
}

@media (max-width: 900px){
  .gs-header__wrap {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
}

/* ===== Resalte en ROJO + sin botón en activo ===== */
.gs-nav__link::after{
  background: linear-gradient(
    90deg,
    rgba(255,0,0,0) 0%,
    rgba(255,0,0,1) 20%,
    rgba(255,0,0,1) 80%,
    rgba(255,0,0,0) 100%
  ) !important;
}
.gs-nav__link:hover{ color: #ff0000 !important; }
.gs-nav__link.is-active{
  color: var(--text) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.gs-nav__link.is-active::after{ transform: scaleX(1) !important; }
.gs-nav__link.is-active:hover{ color: var(--text) !important; }

/* ===== NAV flotante desplegable tipo tarjeta en móvil ===== */
  .gs-nav{
    position: absolute;
    top: calc(100% + 8px) !important;
    left: 8px;
    right: 8px;
    max-height: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #111111 !important;
    border-radius: 24px;
    border: none;                             /* Sin borde cuando está cerrado para evitar la línea horizontal */
    box-shadow: none;                         /* Sin sombra cuando está cerrado */
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, border 0.3s ease;
    z-index: 999;
    padding: 0 !important;
  }

  html.gs-nav-open .gs-nav{
    max-height: 450px !important;
    padding: 16px 0 !important;
    border: 1px solid rgba(212, 60, 60, 0.25); /* Borde visible solo al abrir el menú */
    box-shadow: 0 12px 36px rgba(212, 60, 60, 0.08);
  }

  /* Colores del texto dentro del menú */
  .gs-nav__link,
  .gs-nav__icon {
    color: #111111 !important;                  /* texto negro */
  }

  .gs-nav__link:hover{
    color: #ff0000 !important;                  /* hover rojo */
  }

  .gs-nav__link::after{
    background: linear-gradient(
      90deg,
      rgba(255,0,0,0) 0%,
      rgba(255,0,0,1) 20%,
      rgba(255,0,0,1) 80%,
      rgba(255,0,0,0) 100%
    ) !important;
  }
}

/* =========================================================
   🛠 Correcciones menú móvil + visibilidad hamburguesa
========================================================= */

/* 1) Por defecto, OCULTA la hamburguesa (desktop) */
.gs-burger{
  display: none !important;
}

/* 2) En móviles/tablets, muestra hamburguesa y ajusta menú */
@media (max-width: 900px){

  /* Altura fija y posicionamiento del header móvil flotante */
  :root{
    --header-height: 58px;
    --header-offset: calc(var(--header-height) + 20px);
    scroll-padding-top: var(--header-offset);
  }

  .gs-header{
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    transform: none;
    height: var(--header-height) !important;
    border-radius: 999px;
  }

  .gs-header__wrap{
    height: var(--header-height) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .gs-logo__img{
    max-height: 38px !important;
    width: auto;
    object-fit: contain;
  }

  /* muestra la hamburguesa en móvil/tablet */
  .gs-burger{
    display: flex !important;
  }

  /* (Estilos de .gs-nav unificados en la sección anterior) */

  /* ✅ Mantener la LISTA en COLUMNA con GAP */
  html.gs-nav-open #gs-main-nav .gs-nav__list{
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 16px !important;               /* conserva separación */
    padding: 44px 0 64px !important;
    text-align: center !important;
  }
  html.gs-nav-open #gs-main-nav .gs-nav__list > li{
    display: block !important;
    margin: 0 !important;               /* usamos gap, no margin */
  }

  /* Tocar una opción no cambia el layout; estilos de link */
  .gs-nav__link{
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 22px !important;
    font-size: 1.2rem !important;
    line-height: 1.35 !important;
    letter-spacing: .4px !important;
    border-radius: 14px !important;
    color: #111111 !important;          /* texto negro en móvil */
  }
  .gs-nav__icon{ 
    font-size: 1.25rem !important; 
    margin-right: 8px !important; 
    color: #111111 !important;
  }

  /* Hover / subrayado rojo coherente en móvil */
  .gs-nav__link:hover{ color:#ff0000 !important; }
  .gs-nav__link::after{
    background: linear-gradient(
      90deg,
      rgba(255,0,0,0) 0%,
      rgba(255,0,0,1) 20%,
      rgba(255,0,0,1) 80%,
      rgba(255,0,0,0) 100%
    ) !important;
  }
}

/* 3) En desktop (≥901px), forzamos navegación normal y sin hamburguesa */
@media (min-width: 901px){
  .gs-burger{ display: none !important; }  /* por si acaso */
  /* la nav de escritorio se queda tal cual (horizontal) */
}

/* Quitar completamente el subrayado */
.gs-nav__link::after{
  content: none !important;
  display: none !important;
}

/* Hover/focus: botón de cristal rojo muy tenue */
.gs-nav__link{
  border-radius: 999px !important;
  transition: all 0.25s ease !important;
  color: #2b2b2b !important;                /* Texto oscuro legible sobre el cristal claro */
}
.gs-nav__link:hover,
.gs-nav__link:focus-visible{
  background: rgba(212, 60, 60, 0.06) !important;
  color: #D43C3C !important;
  box-shadow: none !important;
  transform: translateY(-1px) !important;
}

/* Activo/seleccionado: botón de cristal rojo corporativo */
.gs-nav__link.is-active{
  background: #D43C3C !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(212, 60, 60, 0.30) !important;
  font-weight: 700 !important;
}
.gs-nav__link.is-active:hover{
  background: #ff3b30 !important;
}

/* Móvil/Tablet: mismo comportamiento usando rojo corporativo */
@media (max-width: 900px){
  .gs-nav__link::after{ content:none !important; display:none !important; }

  .gs-nav__link:hover,
  .gs-nav__link:focus-visible{
    background: rgba(212, 60, 60, 0.06) !important;
    color: #D43C3C !important;
    box-shadow: none !important;
  }

  .gs-nav__link.is-active{
    background: #D43C3C !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(212, 60, 60, 0.3) !important;
  }

  .gs-nav__link:hover{ color:#D43C3C !important; }

  /* Ajustes de header móvil */
  .gs-header__left {
    display: none !important; /* Oculta título y flechas en móvil para dar espacio */
  }
  .gs-header__search input {
    width: 130px !important;
    font-size: 0.82rem !important;
  }
  .gs-header__search input:focus {
    width: 160px !important;
  }
  .gs-logo__img {
    height: 48px !important;
  }
}

/* Fallback inmediato: si JS aún no fijó el alto, usa 80px */
:root{
  --header-height: 80px;
  --header-offset: calc(var(--header-height) + 8px);
  /* Esto hace que los anclajes nativos respeten el offset desde el inicio */
  scroll-padding-top: var(--header-offset);
}

/* Cubre cualquier sección con id como ancla (por si algún navegador ignora scroll-padding-top en algunos casos) */
[id] { scroll-margin-top: var(--header-offset); }

/* Si #inicio requiere un extra por la sombra/hero: */
#inicio { scroll-margin-top: calc(var(--header-offset) + 15px); }
