/* Header, footer, hero animation */

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  padding: 22px 0;
  transition: padding .3s var(--ease-out), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  padding: 14px 0;
  background: rgba(250,250,247,0.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
}
.site-header.is-dark {
  color: var(--warm-white);
}
.site-header.is-dark.is-scrolled {
  background: rgba(37, 40, 37, 0.86);
  border-bottom-color: var(--line-invert);
}
.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.site-header__logo {
  display: inline-flex; align-items: center;
  line-height: 1;
  /* Hide any inline text/SVG fallbacks if present */
  font-size: 0;
  letter-spacing: 0;
  color: transparent;
}
.site-header__logo .brand-img {
  height: 16px;
  width: auto;
  display: block;
  /* PNG is solid black; invert when header is on dark surfaces */
  transition: filter .2s;
}
.site-header.is-dark .site-header__logo .brand-img,
body[data-variant="v2"] .site-header .site-header__logo .brand-img,
body[data-variant="v3"] .site-header .site-header__logo .brand-img {
  filter: invert(1);
}
/* Hide legacy mark + text nodes in case any pages still have them */
.site-header__logo .mark { display: none; }
.site-nav {
  display: flex; justify-content: center; gap: 36px; list-style: none; padding: 0; margin: 0;
}
.site-nav a {
  font-size: 14px; font-weight: 400; color: inherit; opacity: 0.86;
  padding: 6px 0; position: relative;
  transition: opacity .2s;
}
.site-nav a:hover { opacity: 1; }
.site-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--verde);
}
.site-header__actions {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
}
.lang-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  border: 1px solid var(--line-strong);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: all .25s;
}
.site-header.is-dark .lang-toggle { border-color: var(--line-invert); }
.lang-toggle:hover { background: var(--ink); color: var(--warm-white); border-color: var(--ink); }
.site-header.is-dark .lang-toggle:hover { background: var(--warm-white); color: var(--ink); }
.lang-toggle { text-transform: uppercase; }
.header-cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: var(--verde);
  color: var(--warm-white);
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  border-radius: var(--r-sm);
  transition: background .25s;
}
.site-header.is-dark .header-cta { background: var(--warm-white); color: var(--verde); }
.header-cta:hover { background: var(--verde-oscuro); }
.site-header.is-dark .header-cta:hover { background: var(--crema); }

/* ---------- Mobile nav (hamburger) ---------- */
.nav-toggle { display: none; position: relative; width: 44px; height: 44px; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6)); }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease-out), opacity .2s; }
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .site-header__inner { display: flex; justify-content: space-between; align-items: center; }
  .nav-toggle { display: block; z-index: 3; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-toggle { color: var(--warm-white); position: fixed; top: 14px; right: 12px; }
  /* Con el menú abierto, anular el backdrop-filter del header (crea containing-block
     y rompía el overlay fixed cuando la página estaba scrolleada) */
  body.nav-open .site-header,
  body.nav-open .site-header.is-scrolled {
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    background: transparent !important; border-color: transparent !important;
  }
  /* Logo visible por encima del menú abierto */
  body.nav-open .site-header__logo { position: relative; z-index: 3; }
  body.nav-open .site-header__logo .brand-img { filter: invert(1); }
  .site-nav {
    display: flex; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100dvh; z-index: 2; margin: 0;
    flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    background: var(--verde-deep);
    opacity: 0; visibility: hidden; pointer-events: none; overflow-y: auto;
    transition: opacity .3s var(--ease-out), visibility .3s;
  }
  body.nav-open .site-nav { opacity: 1; visibility: visible; pointer-events: auto; }
  .site-nav a { color: var(--warm-white); opacity: 1; font-family: var(--font-display); font-weight: 300; font-size: 30px; padding: 14px 0; }
  .site-nav a::after { display: none; }
  .lang-toggle { display: none; }
  .header-cta { display: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--carbon);
  color: var(--warm-white);
  padding: 96px 0 32px;
}
.site-footer .footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line-invert);
}
.site-footer .brandblock .display {
  font-family: var(--font-display); font-weight: 300; font-size: clamp(40px, 5vw, 72px); line-height: 0.95; letter-spacing: -0.02em;
}
.site-footer .brandblock .sub {
  margin-top: 20px;
  color: rgba(250,250,247,0.65);
  font-size: 15px;
  line-height: 1.6;
  max-width: 36ch;
}
.site-footer .col h4 {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(250,250,247,0.55);
  margin: 0 0 22px;
  font-weight: 500;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.site-footer ul a { font-size: 15px; color: rgba(250,250,247,0.85); transition: color .2s; }
.site-footer ul a:hover { color: var(--verde-tint); }
.site-footer .footer-bottom {
  padding-top: 32px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: 12px; color: rgba(250,250,247,0.55);
  font-family: var(--font-mono); letter-spacing: 0.04em;
}
.site-footer .footer-bottom a:hover { color: var(--verde-tint); }
@media (max-width: 880px) {
  .site-footer .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 520px) {
  .site-footer .footer-top { grid-template-columns: 1fr; }
}

/* ---------- Hero words animation ---------- */
.hero-title { hyphens: manual !important; -webkit-hyphens: manual !important; word-break: normal; }
.hero-title .word { display: inline-block; overflow: hidden; vertical-align: top; hyphens: manual; -webkit-hyphens: manual; }
.hero-title .word-inner {
  display: inline-block;
  transform: translateY(0);
  animation: wordUp .9s var(--ease-out) backwards;
}
@keyframes wordUp { from { transform: translateY(110%); } to { transform: translateY(0); } }

.hero-sub {
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) forwards;
  animation-delay: 0.9s;
}
.hero-action {
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) forwards;
  animation-delay: 1.2s;
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- WhatsApp float ---------- */
.wa-float {
  position: fixed; right: 24px; bottom: 24px; z-index: 70;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: white;
  display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  transition: transform .3s var(--ease-out);
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 26px; height: 26px; }

/* ===== Botón volver arriba ===== */
.to-top { position: fixed; left: 24px; bottom: 24px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--warm-white); color: var(--verde-deep); font-size: 20px; line-height: 1; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .3s, transform .3s, background .2s, color .2s; z-index: 60; box-shadow: 0 4px 16px rgba(0,0,0,0.28); }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--verde); color: var(--warm-white); border-color: var(--verde); }
@media (max-width: 600px) { .to-top { left: 16px; bottom: 16px; } }

/* Evitar el zoom automático de iOS al enfocar campos (requiere >=16px) */
@media (max-width: 600px) {
  input, select, textarea { font-size: 16px !important; }
}
