/* Navigation Dropdown Styles */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: stretch;
}

.nav-dropdown-toggle {
  position: relative;
  padding-bottom: 0.4rem;
  cursor: pointer;
  display: inline-block;
  vertical-align: baseline;
}

.nav-dropdown-toggle::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--red, #d72638);
  transition: width 0.3s ease;
}

.nav-dropdown:hover .nav-dropdown-toggle::after {
  width: 100%;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(8,9,10,0.15);
  border: 1px solid rgba(215,38,56,0.1);
  padding: 1.5rem;
  min-width: 600px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  margin-top: 0.5rem;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-link {
  display: block;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(215,38,56,0.1);
  transition: all 0.2s ease;
}

.category-link:hover {
  background: rgba(215,38,56,0.05);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  margin: -0.25rem -0.5rem 0.5rem -0.5rem;
}

.dropdown-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--red, #d72638);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  padding: 0;
  border: none;
  white-space: nowrap;
}

.dropdown-section a {
  color: var(--black, #08090a);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  border-radius: 6px;
  padding-left: 0.75rem;
  position: relative;
}

.dropdown-section a:hover {
  color: var(--red, #d72638);
  background: rgba(215,38,56,0.05);
  padding-left: 1rem;
}

.dropdown-section a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 2px;
  background: var(--red, #d72638);
  transition: width 0.2s ease;
}

.dropdown-section a:hover::before {
  width: 3px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  /* Global mobile navigation improvements */
  .nav-menu a {
    font-size: 0.75rem !important;
    padding: 0.4rem 0 !important;
    font-weight: 500;
    text-align: left;
  }
  
  .nav-dropdown {
    width: 100%;
    display: contents;
  }
  
  .nav-dropdown-toggle {
    width: 100%;
    display: block;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(8,9,10,0.08);
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s ease;
    pointer-events: auto;
    color: var(--red, #d72638);
    text-align: left;
  }
  
  .nav-contact-btn {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  .nav-dropdown-toggle:hover {
    color: var(--red, #d72638);
  }
  
  .nav-dropdown-toggle::after {
    display: none;
  }
  
  .nav-dropdown.active .nav-dropdown-toggle::after {
    display: none;
  }
  
  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    min-width: auto;
    width: 100%;
    display: contents;
    max-height: none;
    overflow: visible;
    transition: none;
    background: transparent;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
  }
  
  .nav-dropdown.active .nav-dropdown-menu {
    display: contents;
  }
  
  .dropdown-section {
    display: contents;
  }
  
  .category-link {
    display: none;
  }
  
  .dropdown-section h4 {
    display: none;
  }
  
  .dropdown-section a:not(.category-link) {
    display: block;
    padding: 0.4rem 0;
    margin: 0;
    font-size: 0.75rem;
    color: rgba(8,9,10,0.85);
    background: transparent;
    border-bottom: 1px solid rgba(8,9,10,0.08);
    transition: color 0.2s ease;
    border-radius: 0;
    font-weight: 500;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    text-align: left;
  }
  
  .dropdown-section a:not(.category-link):hover {
    color: var(--red, #d72638);
  }
  
  .dropdown-section a:not(.category-link):active {
    color: var(--red, #d72638);
    background: transparent;
  }
  
  .dropdown-section a::before {
    display: none;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  /* Make all navigation items even smaller on small screens */
  .nav-menu a {
    font-size: 0.7rem !important;
    padding: 0.35rem 0 !important;
    text-align: left;
  }
  
  .nav-dropdown-toggle {
    font-size: 0.7rem;
    padding: 0.35rem 0;
    pointer-events: auto;
  }
  
  .nav-dropdown-toggle::after {
    display: none;
  }
  
  .nav-contact-btn {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  .nav-dropdown-menu {
    display: contents;
  }
  
  .nav-dropdown.active .nav-dropdown-menu {
    display: contents;
  }
  
  .dropdown-section {
    display: contents;
  }
  
  .dropdown-section h4 {
    display: none;
  }
  
  .dropdown-section a:not(.category-link) {
    font-size: 0.7rem;
    padding: 0.35rem 0;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    text-align: left;
    background: transparent;
    transition: color 0.2s ease;
  }
  
  .dropdown-section a:not(.category-link):hover {
    color: var(--red, #d72638);
  }
  
  .dropdown-section a:not(.category-link):active {
    color: var(--red, #d72638);
    background: transparent;
  }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  .nav-dropdown-toggle:hover {
    background: transparent;
    color: inherit;
    padding-left: 0;
    padding-right: 0;
    margin: 0;
  }
  
  .category-link:hover {
    background: rgba(215,38,56,0.08);
    transform: none;
  }
  
  .dropdown-section a:not(.category-link):hover {
    background: rgba(255,255,255,0.7);
    color: rgba(8,9,10,0.85);
    transform: none;
    border-color: rgba(8,9,10,0.05);
    box-shadow: none;
  }
}
