nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  padding-block: 1rem;
  width: fit-content;
}

#v-nav {
  position: fixed;
  z-index: 1;
}

.nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: .75rem;
}

.nav-list a {
  color: var(--color-main);
  display: block;
  text-decoration: none;
}

.nav-list li {
  padding-block: .75rem;
  padding-inline: .75rem;
  margin-inline: .75rem 0;
  font-family: var("--font-icon");
  /* prevent animation glitch on right side */
  box-shadow: 2px 0 0 var(--color-main);
}

/* Enhanced active state styling */
.nav-list li.active {
  view-transition-name: nav;
  display: block;
  background: var(--color-main);
  position: relative;
  z-index: -1;
  border-radius: 100vw 0 0 100vw;
  /* Enhanced active state with glow effect */
  box-shadow: 2px 0 0 var(--color-main), 0 0 20px rgba(255, 81, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Enhanced active state animations */
::view-transition-group(nav) {
  animation-duration: 1s;
}

.nav-list li.active::before,
.nav-list li.active::after {
  --border-radius: 1rem;
  content: "";
  position: absolute;
  width: var(--border-radius);
  height: var(--border-radius);
  right: 0rem;
  background: var(--nav-bg);
}

.nav-list li.active::before {
  border-radius: 0 0 var(--border-radius);
  top: calc(var(--border-radius) * -1);
  box-shadow: 5px 5px 0 5px var(--color-main);
}

.nav-list li.active::after {
  border-radius: 0 var(--border-radius) 0 0;
  bottom: calc(var(--border-radius) * -1);
  box-shadow: 5px -5px 0 5px var(--color-main);
}

/* Enhanced view transitions for different nav items */
.nav-list li:nth-child(1) a {
  view-transition-name: nav-home;
}

.nav-list li:nth-child(2) a {
  view-transition-name: nav-facturar;
}

.nav-list li:nth-child(3) a {
  view-transition-name: nav-consultar;
}

.nav-list li:nth-child(4) a {
  view-transition-name: nav-contacto;
}

.nav-list li:nth-child(5) a {
  view-transition-name: nav-aviso;
}

.nav-list li.active a {
  color: var(--color-black);
  font-weight: bold;
  /* Enhanced text styling for active state */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.025em;
}

/* Enhanced hover states for non-active items */
.nav-list li:not(.active) a:hover {
  color: var(--color-primary);
  transform: translateX(4px);
  transition: all 0.3s ease;
}

/* Enhanced icon styling for active state */
.nav-list li.active .nav-icon {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  transform: scale(1.05);
}

/* Active state indicator line */
.nav-active-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-primary-light));
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px rgba(255, 81, 0, 0.4);
}

/* Enhanced mobile menu styling */
.menu-nav-bar {
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mobile active state enhancements */
.menu-nav-bar .nav-item.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  box-shadow: 0 4px 12px rgba(255, 81, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transform: scale(1.02);
}

/* Enhanced focus states for accessibility */
.nav-list a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Smooth transitions for all nav elements */
.nav-list li,
.nav-list a,
.menu-nav-bar a {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced active state pulse animation */
@keyframes nav-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 81, 0, 0.4);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(255, 81, 0, 0);
  }
}

.nav-list li.active {
  animation: nav-pulse 2s infinite;
}

/* Image wrapper enhancements */
.image-wrapper {
  display: flex;
  position: relative;
}

.image-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.image-wrapper img {
  width: 80%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Enhanced mobile menu button */
.menu-btn {
  position: relative;
  overflow: hidden;
}

.menu-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 81, 0, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.menu-btn:hover::before {
  width: 100%;
  height: 100%;
}

/* Enhanced close button styling */
.close {
  position: relative;
  overflow: hidden;
}

.close::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(239, 68, 68, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
}

.close:hover::before {
  width: 100%;
  height: 100%;
}

/* Mobile menu slide animation enhancement */
.menu-nav-bar.open {
  transform: translateX(0);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
}

/* Enhanced typography for active states */
.nav-list li.active span,
.menu-nav-bar .nav-item.active span {
  font-weight: 700;
  letter-spacing: 0.025em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Responsive enhancements */
@media (max-width: 1125px) {
  .nav-list li.active {
    animation: none;
    /* Disable pulse on mobile for performance */
  }

  .menu-nav-bar {
    width: min(320px, 90vw);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .nav-list li.active {
    border: 2px solid var(--color-primary);
    background: var(--color-primary);
  }

  .nav-list li.active a {
    color: white;
    font-weight: 900;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

  .nav-list li,
  .nav-list a,
  .menu-nav-bar a {
    transition: none;
  }

  .nav-list li.active {
    animation: none;
  }
}