/* Custom animations and transitions */
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

.slide-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.show,
.slide-up.show {
  opacity: 1;
  transform: translateY(0);
}

/* Sticky navbar styles */
.sticky-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  .gradient-text {
    background: linear-gradient(to right, #2563eb, #14b8a6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
  }
  z-index: 50;
  transition: all 0.3s;
}

/* Custom gradient text */
.gradient-text {
  background: linear-gradient(to right, #2563eb, #14b8a6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Custom card hover effect */
.hover-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Hero section gradient background */
.hero-gradient {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

/* Hide products submenu on mobile by default */
.products-nav-group {
  position: relative;
}

.sub-nav {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: white;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 100;
  padding: 0.75rem 0;
  border-radius: 0.5rem;
  margin-top: 0; /* No gap! */
  border-top: 3px solid transparent; /* Invisible bridge */
}

.sub-nav-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.sub-nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  color: #1e40af;
  transition: all 0.3s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.sub-nav-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sub-nav-item:hover::before {
  opacity: 1;
}

.sub-nav-item i,
.sub-nav-item span {
  position: relative;
  z-index: 1;
}

.sub-nav-item i {
  margin-right: 0.75rem;
  font-size: 1.25rem;
}

.sub-nav-item span {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.sub-nav-item:hover {
  color: white;
}

.sub-nav-item:not(:last-child) {
  border-bottom: 1px solid #f1f5f9;
}

@media (max-width: 768px) {
  .sub-nav {
    position: static;
    transform: none;
    width: 100%;
    box-shadow: none;
    border-top: 1px solid #e5e7eb;
    padding: 0;
    border-radius: 0;
  }

  .sub-nav-items {
    gap: 0;
  }

  .sub-nav-item {
    padding: 0.75rem 1.5rem;
  }

  .products-nav-group:hover .sub-nav {
    transform: none;
  }

  .sub-nav-item:not(:last-child) {
    border-bottom: none;
  }
}

/* Add invisible hover area to prevent menu from disappearing */
.products-nav-group::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px; /* Bridge height */
  background: transparent;
  z-index: 99;
}

.products-nav-group:hover .sub-nav,
.products-nav-group:focus-within .sub-nav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sub-nav:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile styles - NOW WORKS LIKE DESKTOP */
@media (max-width: 768px) {
  .sub-nav {
    /* Keep absolute positioning like desktop */
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateX(-50%);
    width: 280px;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 0;
    margin-top: 0;
  }

  /* Make sure hover still works on mobile */
  .products-nav-group:hover .sub-nav,
  .products-nav-group:focus-within .sub-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Touch-friendly padding */
  .sub-nav-item {
    padding: 1rem 1.25rem;
  }

  /* Prevent off-screen issues */
  .sub-nav {
    max-width: calc(100vw - 2rem);
  }
}
