/* ==========================
   Floating Navbar
========================== */
.floating-navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 80px);
  max-width: 1200px;
  padding: 12px 40px;
  border-radius: 30px;
  background: var(--nav-bg);
  box-shadow: 0 10px 30px rgba(2, 90, 122, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Visible solo en home */
body:not(.on-home) .floating-navbar {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
}

/* ==========================
   Logo
========================== */
.nav-logo {
  background-image: url(../images/logos/logo-color.svg);
  background-size: contain;
  background-repeat: no-repeat;
  width: 130px;
  height: 56px;
}

/* ==========================
   Links
========================== */
.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav-item {
  position: relative;
}

/* ==========================
   Buttons
========================== */
.nav-item button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: var(--link-bg);
  color: var(--primary);
  font-family: var(--nav-font);
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.nav-item button img {
  width: 16px;
  height: 16px;
}

.nav-item.special button {
  background: var(--primary);
  color: #fff;
}

/* ==========================
   Tooltip Desktop
========================== */
.nav-tooltip {
  position: absolute;
  top: 100%;
  left: -16px;
  transform: translateY(14px);
  width: 360px;
  padding: 22px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-tooltip::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 48px;
  width: 20px;
  height: 20px;
  background: #fff;
  transform: rotate(45deg);
}

.nav-item:hover .nav-tooltip,
.nav-item:focus-within .nav-tooltip {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-tooltip h4 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 20px;
}

.nav-tooltip p {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.nav-tooltip a {
  color: var(--secondary);
  text-decoration: none;
  font-weight: 500;
}

/* ==========================
   Toggle (Burger)
========================== */
.nav-toggle {
  display: none;
  font-size: 26px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary);
}

@media (max-width: 768px) {
  .floating-navbar {
    top: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 12px;
    border-radius: 20px;
    position: fixed;
  }

  /* LOGO */
  .nav-logo {
    background-image: url(../images/logos/C-logo-only.svg);
    width: 56px;
    height: 56px;
    flex-shrink: 0;
  }

  /* CTA */
  .nav-item.special {
  }

  .nav-item.special button {
    padding: 10px 36px;
    font-size: 15px;
    white-space: nowrap;
  }

  /* BURGER */
  .nav-toggle {
    display: block;
    font-size: 26px;
    margin-left: 8px;
    flex-shrink: 0;
  }

  /* ==========================
     MENÚ OVERLAY (LA CLAVE)
  ========================== */
  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 16px;
    border-radius: 20px;
    background: var(--nav-bg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);

    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;

    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .floating-navbar.open .nav-links {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-item,
  .nav-item button {
    width: 100%;
  }

  .nav-item button {
    justify-content: flex-start;
  }

  /* Tooltips mobile */
  .nav-tooltip {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-tooltip {
    display: none;
    position: relative;
    margin-top: 6px;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
  }

  .nav-item.is-open .nav-tooltip {
    display: block;
  }
}
