/* --- NAVBAR SHARED STYLES --- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 5% 0 5%;
  display: flex;
  align-items: flex-start;
  z-index: 1000;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
}

nav.scrolled {
  background: rgba(4, 75, 171, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(4, 75, 171, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  margin-right: auto;
  margin-top: -10px;
  position: relative;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo-img {
  height: 100px;
  width: auto;
  object-fit: contain;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

nav.scrolled .logo-img {
  height: 70px;
}

.nav-links {
  display: flex;
  gap: 3rem;
  list-style: none;
  margin-right: 3rem;
  margin-top: 25px;
}

.nav-links a {
  text-decoration: none;
  color: var(--white);
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.1rem;
  opacity: 0.9;
  position: relative;
  padding-bottom: 5px;
}

.nav-links a::before {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: var(--accent-yellow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--accent-yellow);
}

.nav-links a:hover {
  opacity: 1;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.nav-links a:hover::before {
  width: 100%;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  bottom: -5px;
  left: 0;
  background: var(--accent-yellow);
  box-shadow: 0 0 10px var(--accent-yellow);
  animation: glow 2s ease-in-out infinite;
}

.nav-links a.active::before {
  display: none;
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 10px var(--accent-yellow);
  }

  50% {
    box-shadow: 0 0 20px var(--accent-yellow), 0 0 30px rgba(243, 209, 54, 0.5);
  }
}

.cart-icon-link {
  text-decoration: none;
  display: block;
  margin-top: 23px;
  position: relative;
  z-index: 1001;
}

.cart-icon {
  position: relative;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-icon:hover {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--accent-yellow);
  color: var(--primary-dark);
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Responsividad básica para el navbar */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 100%;
    background: rgba(4, 75, 171, 0.98);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    transition: 0.4s;
    z-index: 999;
    margin: 0;
    padding: 0;
  }

  .nav-links.active {
    right: 0;
  }

  .menu-toggle {
    display: block;
    font-size: 1.5rem;
    color: var(--white);
    cursor: pointer;
    margin-right: 20px;
    z-index: 1002;
  }

  nav {
    background: var(--primary-blue);
    align-items: center;
  }

  .logo-img {
    height: 60px;
  }

  .cart-icon-link {
    margin-right: 50px; /* Espacio para el menu toggle */
  }
}
