/* Menú de Navegación Premium - AgroLogistics */

/* Variable Reset / Ensure Access */
:root {
  --nav-bg-scrolled: rgba(255, 255, 255, 0.95);
  --nav-backdrop: blur(12px);
  --nav-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --primary-color: #1a5276;
  --secondary-color: #28b463;
  --accent-color: #f39c12;
  --text-dark: #2c3e50;
  --transition-speed: 0.4s;
}

/* Container fix if needed, but normally navbar is fixed */
.container-demo {
  /* Resetting potential layout interference */
  width: 100%;
  position: relative;
  z-index: 1030;
}

/* Navbar Base */
.navbar-custom {
  padding: 1.2rem 0;
  background: transparent;
  transition: all var(--transition-speed) ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrolled State (Requires JS to toggle .scrolled) */
.navbar-custom.scrolled {
  padding: 0.8rem 0;
  background: var(--nav-bg-scrolled);
  backdrop-filter: var(--nav-backdrop);
  -webkit-backdrop-filter: var(--nav-backdrop);
  box-shadow: var(--nav-shadow);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Brand */
.navbar-brand-custom {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  /* Initial state on dark hero */
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s ease;
}

.navbar-brand-custom i {
  color: var(--secondary-color);
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.scrolled .navbar-brand-custom {
  color: var(--primary-color);
}

.navbar-brand-custom span {
  color: var(--secondary-color);
}

/* Links */
.nav-link-custom {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  margin: 0 0.2rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.scrolled .nav-link-custom {
  color: var(--text-dark) !important;
}

.nav-link-custom:hover,
.nav-link-custom.active {
  color: white !important;
  background: rgba(255, 255, 255, 0.15);
}

.scrolled .nav-link-custom:hover,
.scrolled .nav-link-custom.active {
  color: var(--primary-color) !important;
  background: rgba(26, 82, 118, 0.08);
}

/* Dropdown */
.dropdown-menu-custom {
  border: none;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  padding: 0.8rem;
  margin-top: 15px;
  background: white;
  min-width: 220px;
  animation: dropdownFade 0.3s ease forwards;
  opacity: 0;
  transform: translateY(10px);
  display: block;
  /* Managed by bootstrap but we add animation hooks or use hover css if desired */
  /* Bootstrap 5 toggle manages display, but we can animate opacity */
  visibility: hidden;
  /* Fix for animation conflict */
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item-custom {
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-weight: 500;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.dropdown-item-custom i {
  width: 20px;
  text-align: center;
  color: var(--secondary-color);
  transition: transform 0.2s;
}

.dropdown-item-custom:hover {
  background: #f8f9fa;
  color: var(--primary-color);
  transform: translateX(5px);
}

.dropdown-item-custom:hover i {
  transform: scale(1.2);
}

/* Login Button */
.btn-login {
  background: white;
  color: var(--primary-color) !important;
  border: none;
  padding: 0.6rem 1.8rem !important;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-left: 1rem;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  background: var(--white-color);
  color: var(--secondary-color) !important;
}

.scrolled .btn-login {
  background: var(--primary-color);
  color: white !important;
}

.scrolled .btn-login:hover {
  background: var(--secondary-color);
  color: white !important;
}

/* Mobile Toggler */
.navbar-toggler-custom {
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 0;
}

.navbar-toggler-custom:focus {
  box-shadow: none;
  outline: none;
}

.scrolled .navbar-toggler-custom {
  color: var(--primary-color);
}

/* Mobile Menu Collapse */
@media (max-width: 991px) {
  .navbar-collapse-custom {
    background: white;
    margin-top: 15px;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  .nav-link-custom {
    color: var(--text-dark) !important;
    padding: 1rem !important;
    margin: 5px 0;
  }

  .nav-link-custom:hover {
    background: #f8f9fa;
    color: var(--primary-color) !important;
  }

  .btn-login {
    display: block;
    width: 100%;
    margin: 15px 0 0 0;
    text-align: center;
    background: var(--primary-color);
    color: white !important;
  }

  .btn-login:hover {
    background: var(--secondary-color);
  }
}