/* Critical layout fixes — nav dropdowns, topbar offset, hero spacing */
:root {
  --topbar-height: 34px;
  --header-height: 64px;
}

#header {
  top: var(--topbar-height);
}

.institutional-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  height: var(--topbar-height);
}

#inicio {
  padding-top: calc(var(--topbar-height) + var(--header-height) + 1.5rem) !important;
}

.mobile-nav {
  display: none;
}

.mobile-nav.open {
  display: flex !important;
}

/* Bootstrap reset — mobile menu toggles */
.mobile-nav .mobile-nav-group-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.85) !important;
  padding: 0 !important;
  margin: 0;
  font-family: 'Sora', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}

.mobile-nav .mobile-nav-lang .mobile-nav-group-toggle {
  font-size: 1rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.mobile-nav .mobile-nav-close {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.nav-item-has-dropdown {
  position: relative;
}

header .nav-dropdown-toggle {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.75);
}

header.scrolled .nav-dropdown-toggle {
  color: var(--text-body);
}

.nav-dropdown {
  position: absolute !important;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 11.5rem;
  margin: 0;
  padding: 0.75rem 0.45rem 0.45rem;
  list-style: none !important;
  background: #fff;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(8, 18, 32, 0.06), 0 16px 40px rgba(8, 18, 32, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1200;
}

.nav-item-has-dropdown.is-open > .nav-dropdown,
.nav-item-has-dropdown:focus-within > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-dropdown li {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

.nav-dropdown a {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #4a5568 !important;
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-lang-switch .nav-dropdown {
  min-width: 5.5rem;
}

/* ── Mobile layout ── */
@media (max-width: 1024px) {
  #inicio {
    align-items: flex-start !important;
    overflow-x: hidden;
    overflow-y: visible;
    min-height: auto !important;
    padding-top: calc(var(--topbar-height) + var(--header-height) + 1.25rem) !important;
    padding-bottom: 3.5rem !important;
  }

  #inicio .container {
    width: 100%;
  }

  .hero-title {
    font-size: clamp(1.75rem, 7.5vw, 2.35rem) !important;
    line-height: 1.18 !important;
    margin-bottom: 1rem !important;
  }

  .hero-subtitle {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
    margin-bottom: 1.5rem !important;
  }

  .hero-seo-tags {
    justify-content: center;
    gap: 0.45rem;
  }

  .hero-tag {
    font-size: 0.68rem !important;
    padding: 0.28rem 0.6rem !important;
  }

  .hero-btns {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .hero-btns .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.88rem !important;
    padding: 0.75rem 1rem !important;
  }

  .nav-links {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  #inicio {
    padding-top: calc(var(--topbar-height) + var(--header-height) + 0.75rem) !important;
  }

  .hero-title {
    font-size: clamp(1.55rem, 8.2vw, 2rem) !important;
  }

  .nav-cta-mobile {
    font-size: 0.62rem !important;
    padding: 0.35rem 0.55rem !important;
  }
}

@media (min-width: 1025px) {
  .mobile-nav {
    display: none !important;
  }

  .mobile-nav.open {
    display: none !important;
  }

  .hamburger {
    display: none !important;
  }

  .nav-links {
    display: flex !important;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }
}

/* Casos — sin enlace inferior */
.caso-card .caso-list {
  margin-bottom: 0;
  flex: none;
}

.caso-card h3 {
  line-height: 1.35;
}

.caso-list li {
  align-items: flex-start;
}

.caso-list li::before {
  margin-top: 0.45em;
}
