#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

#site-header.scrolled {
  background: rgba(13,31,53,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
}

.header-logo {
  flex-shrink: 0;
}

.header-logo img {
  height: auto;
  width: 250px;
  max-width: 250px;
  transition: opacity 0.3s;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  list-style: none;
}

.header-nav a {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.8);
  transition: color 0.25s;
  position: relative;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.header-nav a:hover { color: #fff; }
.header-nav a:hover::after { width: 100%; }

.header-nav .has-mega { position: relative; }

.nav-arrow { display: none; }

/* Mega menu */
.mega-menu {
  position: fixed;
  inset: 0;
  top: var(--nav-h);
  background: var(--bg);
  z-index: 700;
  display: grid;
  grid-template-columns: 55% 45%;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.6s cubic-bezier(0.16,1,0.3,1), visibility 0s linear 0.6s;
  pointer-events: none;
}

.mega-menu.is-open {
  clip-path: inset(0 0 0% 0);
  visibility: visible;
  transition: clip-path 0.6s cubic-bezier(0.16,1,0.3,1), visibility 0s;
  pointer-events: all;
}

/* Foco visible con teclado */
.mega-list a:focus-visible,
.mobile-nav-top a:focus-visible,
.mobile-menu-cta a:focus-visible,
.header-nav a:focus-visible,
.hamburger:focus-visible,
.lang-btn:focus-visible {
  outline: 2px solid #6aabff;
  outline-offset: 4px;
}

.mega-left {
  padding: 40px var(--gutter);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.mega-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mega-list li {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s, transform 0.4s var(--ease-out);
  border-bottom: 1px solid var(--border);
}

.mega-menu.is-open .mega-list li {
  opacity: 1;
  transform: translateY(0);
}
.mega-menu.is-open .mega-list li:nth-child(1) { transition-delay: 0.05s; }
.mega-menu.is-open .mega-list li:nth-child(2) { transition-delay: 0.1s; }
.mega-menu.is-open .mega-list li:nth-child(3) { transition-delay: 0.15s; }
.mega-menu.is-open .mega-list li:nth-child(4) { transition-delay: 0.2s; }
.mega-menu.is-open .mega-list li:nth-child(5) { transition-delay: 0.25s; }
.mega-menu.is-open .mega-list li:nth-child(6) { transition-delay: 0.3s; }
.mega-menu.is-open .mega-list li:nth-child(7) { transition-delay: 0.35s; }

.mega-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 300;
  color: rgba(255,255,255,0.7);
  transition: color 0.25s;
}

.mega-list a:hover { color: #fff; }
.mega-list .link-arrow { font-size: 18px; opacity: 0; transition: opacity 0.25s, transform 0.25s; }
.mega-list a:hover .link-arrow { opacity: 1; transform: translateX(4px); }

.mega-right {
  position: relative;
  overflow: hidden;
}

.mega-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.mega-img.is-active { opacity: 1; }

.mega-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

/* Acciones de cabecera: CTA + idioma + hamburguesa */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.32s cubic-bezier(0.16,1,0.3,1), opacity 0.25s, background 0.2s;
}

/* Hamburger → X animation */
.hamburger.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile nav injected into mega-left ── */
.mobile-nav-top {
  display: none;
  list-style: none;
  margin-bottom: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-top li {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
}
.mega-menu.is-open .mobile-nav-top li               { opacity: 1; transform: translateY(0); }
.mega-menu.is-open .mobile-nav-top li:nth-child(1)  { transition-delay: 0.03s; }
.mega-menu.is-open .mobile-nav-top li:nth-child(2)  { transition-delay: 0.07s; }
.mega-menu.is-open .mobile-nav-top li:nth-child(3)  { transition-delay: 0.11s; }
.mega-menu.is-open .mobile-nav-top li:nth-child(4)  { transition-delay: 0.15s; }
.mega-menu.is-open .mobile-nav-top li:nth-child(5)  { transition-delay: 0.19s; }

.mobile-nav-top a {
  display: block;
  padding: 13px 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: color 0.2s;
}
.mobile-nav-top a:hover,
.mobile-nav-top a:active { color: #fff; }

.mobile-services-label {
  display: none;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.4s 0.18s;
}
.mega-menu.is-open .mobile-services-label { opacity: 1; }

.mobile-menu-cta {
  display: none;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s 0.32s, transform 0.4s 0.32s var(--ease-out);
}
.mega-menu.is-open .mobile-menu-cta { opacity: 1; transform: translateY(0); }
.mobile-menu-cta a {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  transition: color 0.25s;
  letter-spacing: -0.01em;
}
.mobile-menu-cta a span { color: var(--gold); margin-left: 6px; }
.mobile-menu-cta a:hover { color: #fff; }

@media (max-width: 1360px) {
  .header-inner { gap: 24px; }
  .header-logo img { width: 200px; }
  .header-nav { gap: 24px; }
  .header-nav a { letter-spacing: 0.08em; }
  .header-actions .btn-pill { padding-left: 18px; font-size: 13px; }
  .header-actions .btn-pill .btn-dot-circle { margin-left: 10px; }
  .lang-selector { margin-left: 4px; }
}

@media (max-width: 1180px) {
  .header-logo img { width: 170px; }
  .header-nav { gap: 18px; }
  .header-actions .btn-pill .btn-label { display: none; }
  .header-actions .btn-pill { padding: 6px; }
  .header-actions .btn-pill .btn-dot-circle { margin-left: 0; }
}

@media (max-width: 1024px) {
  .header-nav { display: none; }
  .hamburger  { display: flex; }
  .header-inner { grid-template-columns: auto 1fr auto; }

  /* Hide the desktop CTA button — keep only hamburger (and lang selector) */
  .header-actions .btn-pill { display: none; }

  /* Reduce logo on tablet/mobile */
  .header-logo img { width: 180px; }

  .mega-menu {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .mega-right { display: none; }
  .mega-left  { padding: 40px 28px 48px; justify-content: flex-start; }

  /* Show mobile-only elements */
  .mobile-nav-top        { display: block; }
  .mobile-services-label { display: block; }
  .mobile-menu-cta       { display: block; }
}

@media (max-width: 480px) {
  .header-logo img { width: 150px; }
  .mega-left { padding: 32px 20px 40px; }
}

/* ── Language selector ── */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  transition: color 0.2s, background 0.2s;
}

.lang-btn:hover { color: #fff; background: rgba(255,255,255,0.07); }
.lang-btn.is-active { color: #fff; cursor: default; }
.lang-btn svg { border-radius: 2px; flex-shrink: 0; }
.lang-sep { color: rgba(255,255,255,0.2); font-size: 10px; }

/* Lang selector stays visible on mobile — only text label hidden to save space */
@media (max-width: 480px) {
  .lang-btn span { display: none; }
  .lang-selector { margin-left: 8px; }
}
