.navbar {
  z-index: 1056;
  background: transparent;
  border-bottom: 1px solid transparent;
  overflow: visible;
  isolation: isolate;
}

.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #1702028c;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 0;
  pointer-events: none;
}

.navbar:has(+ *:not(:first-child))::before {
  animation: navbar-fade-in 0.1s linear both;
  animation-timeline: scroll();
  animation-range: 0 150px;
}

@keyframes navbar-fade-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.navbar .container,
.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-toggler,
.offcanvas {
  position: relative;
  z-index: 1;
}

/* Botón principal */

.navbar .nav-link {
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 16px;
  border: 1px solid transparent;
  text-align: left;
  background: transparent;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

@media (min-width: 1200px) {
  .navbar .nav-link {
    justify-content: center;
    min-width: 100px;
  }
}

.navbar .nav-link:hover,
.navbar .nav-link.show {
  color: #fff;
  background: rgba(255, 57, 57, 0.05);
  border-color: rgba(255, 57, 57, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Dropdown */

.dropdown-menu {
  background: transparent !important;
  border: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-radius: 16px;
  overflow: visible;
  padding: 0;
  text-align: left;
}

/* Items del dropdown */

.dropdown-item {
  color: #dcdcdc;
  padding: 0.8rem 1.2rem;
  transition: all 0.25s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dropdown-item:active {
  background: rgba(255, 0, 0, 0.1);
}

.dropdown-item:focus {
  background: rgba(255, 0, 0, 0.2);
}

/* Evita que el dropdown se salga visualmente */

.dropdown-menu.show {
  display: block;
}

@media (max-width: 1200px) {
  #navbar {
    --bs-offcanvas-transition: none;
    opacity: 0;
  }
}

@media (max-width: 1200px) {
  #navbar.show {
    opacity: 1;
    transition: opacity .15s ease;
  }
}

/* LINKS – estado cerrado */

@media (max-width: 1200px) {
  #navbar .nav-item {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(6px);
    transition: opacity .2s ease, transform .2s ease, filter .2s ease;
  }
}

/* LINKS – estado abierto */

@media (max-width: 1200px) {
  #navbar.show .nav-item {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Delay SOLO al abrir */

@media (max-width: 1200px) {
  #navbar.show .nav-item:nth-child(1) {
    transition-delay: .04s;
  }
}

@media (max-width: 1200px) {
  #navbar.show .nav-item:nth-child(2) {
    transition-delay: .08s;
  }
}

@media (max-width: 1200px) {
  #navbar.show .nav-item:nth-child(3) {
    transition-delay: .12s;
  }
}

@media (max-width: 1200px) {
  #navbar.show .nav-item:nth-child(4) {
    transition-delay: .16s;
  }
}

/* Sin delay al cerrar */

@media (max-width: 1200px) {
  #navbar .nav-item {
    transition-delay: 0s;
  }
}