/* NAVBAR */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 88px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 0 16px; /* Matched to hero-card mobile margin */
  z-index: 100;
  font-family: 'Google Sans Flex', 'Geist', sans-serif;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img { height: 40px; }

.nav-menu {
  display: none;
  list-style: none;
  align-items: center;
  gap: 32px;
}

.nav-menu a {
  color: var(--azul);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .2s;
}

.nav-menu a:hover { opacity: .68; }

.nav-cta {
  display: none;
}

.mobile-menu-toggle {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--azul);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.mobile-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 210;
  width: min(84vw, 360px);
  height: 100svh;
  padding: 24px;
  background: #fff;
  box-shadow: 24px 0 60px rgba(17,24,52,.16);
  transform: translateX(-104%);
  transition: transform .24s ease;
}

.mobile-menu-panel.is-open {
  transform: translateX(0);
}

.mobile-menu-panel__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 44px;
}

.mobile-menu-panel__top img {
  height: 36px;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #eef2fb;
  color: var(--azul);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-links a {
  display: block;
  border-bottom: 1px solid #edf0f6;
  color: var(--azul);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  padding: 18px 0;
  text-decoration: none;
}

.mobile-menu-socials {
  display: flex;
  gap: 14px;
  margin-top: 36px;
}

.mobile-menu-socials a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--azul);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-socials img {
  width: 25px;
  height: 25px;
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 205;
  border: 0;
  background: rgba(17,24,52,.34);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.mobile-menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 1024px) {
  .nav {
    height: 100px;
    padding: 0 max(16px, calc((100% - 1760px) / 2)); /* Dynamically aligns to hero-card width bounds */
    justify-content: flex-start;
  }

  .nav-logo {
    position: static;
  }

  .nav-logo img {
    height: 40px;
  }

  .nav-cta {
    display: flex;
    position: relative;
    top: auto;
    right: auto;
  }

  .mobile-menu-toggle,
  .mobile-menu-panel,
  .mobile-menu-backdrop {
    display: none;
  }
  .nav-menu {
    display: flex;
    position: static;
    margin-left: auto;
    margin-right: var(--nav-menu-cta-gap);
    gap: 40px;
  }

  .nav-menu a {
    font-size: 18px;
  }
}
@media (min-width: 1600px) {
  .nav-menu {
    gap: 57px;
  }
}

/* ==========================================================================
   DROPDOWN SUBMENUS (DESKTOP & MOBILE)
   ========================================================================== */

/* --- Mobile Submenus --- */
.mobile-dropdown {
  border-bottom: 1px solid #edf0f6;
  width: 100%;
}

.mobile-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  color: var(--azul);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.2;
  padding: 18px 0;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  outline: none;
}

.mobile-dropdown-toggle .chevron {
  display: inline-flex;
  align-items: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--azul);
}

.mobile-dropdown-toggle .chevron svg {
  width: 14px;
  height: 8px;
  display: block;
}

.mobile-dropdown.is-open .mobile-dropdown-toggle .chevron {
  transform: rotate(180deg);
}

.mobile-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
  border-radius: 12px;
  margin-bottom: 0;
  padding: 0;
}

.mobile-dropdown.is-open .mobile-dropdown-menu {
  max-height: 300px;
  margin-bottom: 16px;
  padding: 8px 0;
}

.mobile-menu-links .mobile-dropdown-menu a {
  border-bottom: none !important;
  font-size: 18px !important;
  padding: 12px 24px !important;
  color: var(--azul) !important;
  line-height: 1.2;
}

.mobile-menu-links .mobile-dropdown-menu a:hover {
  background-color: #eef2fb;
}

/* --- Desktop Submenus --- */
@media (min-width: 1024px) {
  .nav-dropdown {
    position: relative;
  }

  .nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
  }

  .nav-dropdown-toggle .chevron {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--azul);
  }

  .nav-dropdown-toggle .chevron svg {
    width: 10px;
    height: 6px;
    display: block;
  }

  .nav-dropdown:hover .nav-dropdown-toggle .chevron {
    transform: rotate(180deg);
  }

  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(28, 37, 69, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 12px 0;
    min-width: 260px;
    box-shadow: 0 16px 40px rgba(17, 24, 52, 0.24);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    list-style: none;
    z-index: 110;
    margin: 0;
  }

  /* Hover bridge to bridge the visual gap and prevent mouseleave firing */
  .nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
  }

  .nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
  }

  .nav-dropdown-menu li {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .nav-dropdown-menu a {
    display: block;
    padding: 12px 24px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 15px !important;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, padding-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    white-space: nowrap;
  }

  .nav-dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    padding-left: 28px !important;
    opacity: 1 !important;
  }
}

