/* NAVBAR */
header.site {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
}

header.site .wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Estado transparente - sin scroll */
header.site:not(.scrolled) .brand .brand-name { color: #FFFFFF; }
header.site:not(.scrolled) .brand .brand-name small { color: rgba(255,255,255,0.8); }
header.site:not(.scrolled) nav ul a {
  color: rgba(255,255,255,0.85);
  border-bottom-color: transparent;
}
header.site:not(.scrolled) nav ul a:hover { color: #FFFFFF; }
header.site:not(.scrolled) nav ul a.active {
  color: #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
}
header.site:not(.scrolled) .nav-cta {
  background: var(--brand-gradient);
  color: #FFFFFF;
  border: 1px solid transparent;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
header.site:not(.scrolled) .nav-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
header.site:not(.scrolled) .burger span { background: #FFFFFF; }

/* Estado con scroll - fondo blanco */
header.site.scrolled {
  background: rgba(246,247,250,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}
header.site.scrolled .brand .brand-name { color: var(--ink); }
header.site.scrolled .brand .brand-name small { color: var(--muted); }
header.site.scrolled nav ul a { color: var(--muted); }
header.site.scrolled nav ul a:hover { color: var(--ink); }
header.site.scrolled nav ul a.active {
  color: var(--ink);
  border-bottom: 2px solid var(--brand);
}
header.site.scrolled .burger span { background: var(--ink); }
header.site.scrolled .nav-cta {
  background: var(--brand-gradient);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(47,166,160,.28);
}
header.site.scrolled .nav-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}

.brand .brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand .brand-name small {
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 3px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 26px;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  font-weight: 600;
}

nav ul a {
  text-decoration: none;
  color: var(--muted);
  transition: color .15s;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

nav ul a:hover { color: var(--ink); }
nav ul a.active {
  color: var(--ink);
  border-bottom: 2px solid var(--brand);
}

#mobileMenu a.active { color: var(--brand); }

.nav-cta {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: filter .15s, transform .15s, box-shadow .15s;
}

.nav-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

.burger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
}

.burger span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
  border-radius: 2px;
}

/* DROPDOWN */
.nav-dropdown { position: relative; }
.nav-dropdown a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.icon {
  width: 17px;
  height: 17px;
  display: inline-block;
  vertical-align: -3px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

.caret-ic {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
  transition: transform .15s;
}

.nav-dropdown.open .caret-ic { transform: rotate(180deg); }

.dropdown-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 196px;
  z-index: 60;
}

.dropdown-panel.open { display: flex; }
.dropdown-panel a {
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  border: none;
}
.dropdown-panel a:hover { background: var(--bg-2); }

/* Dropdown transparente */
header.site:not(.scrolled) .dropdown-panel {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
  border-color: rgba(255,255,255,0.15);
}
header.site:not(.scrolled) .dropdown-panel a { color: #ffffff; }
header.site:not(.scrolled) .dropdown-panel a:hover {
  background: rgba(255,255,255,0.15);
}

/* Dropdown con scroll */
header.site.scrolled .dropdown-panel {
  background: var(--surface);
  border-color: var(--border);
}
header.site.scrolled .dropdown-panel a { color: var(--ink); }
header.site.scrolled .dropdown-panel a:hover { background: var(--bg-2); }

/* Separador dentro del dropdown "Sobre Nosotros" (arriba de "Sistema") */
.dropdown-panel .nav-separator {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
  border: none;
}
header.site:not(.scrolled) .dropdown-panel .nav-separator {
  background: rgba(255,255,255,0.2);
}

/* Mobile Accordion */
.mobile-accordion { border-bottom: 1px solid var(--border); }
.mobile-accordion button {
  background: none;
  border: none;
  font: inherit;
  color: var(--ink);
  padding: 12px 4px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.mobile-accordion .caret-ic-mobile {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.mobile-accordion.open .caret-ic-mobile { transform: rotate(180deg); }

.mobile-accordion-panel {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 12px 20px;
}

.mobile-accordion-panel.open { display: flex; }
.mobile-accordion-panel a {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: none !important;
  border-radius: 8px;
  transition: background 0.15s;
}
.mobile-accordion-panel a:hover {
  background: var(--bg-2);
  color: var(--ink);
}

/* Separador dentro del acordeón móvil "Sobre Nosotros" (arriba de "Sistema") */
.mobile-accordion-panel .nav-separator {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

header.site:not(.scrolled) .mobile-accordion button { color: #111010; }
header.site:not(.scrolled) .mobile-accordion {
  border-bottom-color: rgba(255,255,255,0.1);
}
header.site:not(.scrolled) .mobile-accordion-panel a {
  color: rgba(255,255,255,0.8);
}
header.site:not(.scrolled) .mobile-accordion-panel a:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}
header.site:not(.scrolled) .mobile-accordion-panel .nav-separator {
  background: rgba(255,255,255,0.15);
}

header.site.scrolled .mobile-accordion button { color: var(--ink); }
header.site.scrolled .mobile-accordion { border-bottom-color: var(--border); }
header.site.scrolled .mobile-accordion-panel a { color: var(--muted); }
header.site.scrolled .mobile-accordion-panel a:hover {
  background: var(--bg-2);
  color: var(--ink);
}