/* 🔹 Navbar Unified Styles */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  /* Increased z-index for safety */
  color: #fff;
  background: #000;
  font-family: 'Segoe UI', sans-serif;
  /* Enforce consistent font */
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.logo-text-block {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-text {
  font-size: 20px;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
}

.logo-tagline {
  font-size: 12px;
  font-weight: 300;
  color: #ccc;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
}

.nav-links ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color .3s;
}

.nav-links a:hover {
  color: purple;
}

.call a {
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  transition: .3s;
  padding: 6px 10px;
  border-radius: 6px;
}

.call a:hover {
  color: #bb86fc;
  transform: scale(1.08);
  box-shadow: 0 0 8px #bb86fc88;
  background: rgba(255, 255, 255, .05);
}

.hamburger {
  display: none;
}

.nav-link {
  color: #fff;
  /* Ensure white text */
  text-decoration: none;
  padding: 5px 10px;
}

.nav-link.active {
  color: purple;
  font-weight: bold;
  border-bottom: 2px solid purple;
}

/* 🔹 Dropdown */
.dropdown {
  position: relative;
}

.dropdown>a i {
  display: inline-block;
  transform: translateY(1px);
  font-size: 0.75rem;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #000;
  border-radius: 6px;
  padding: 8px 0;
  z-index: 999;
}

.dropdown-menu li {
  list-style: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
}

.dropdown-menu li a {
  display: block;
  padding: 5px 12px;
  color: white;
  white-space: nowrap;
  /* Prevent wrapping */
}

.dropdown-menu li a:hover {
  background: #222;
  color: #a855f7;
  /* Accent color */
}

.dropdown:hover .dropdown-menu li a {
  /* display: block; - Removed as it is now always block */
}

.dropdown i {
  font-size: .75rem;
}

/* Responsive */
@media (max-width:768px) {
  .hamburger {
    display: block;
    position: absolute;
    right: 20px;
    top: 25px;
    z-index: 20;
    color: white;
    font-size: 24px;
    cursor: pointer;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background: rgba(0, 0, 0, .95);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 20px;
  }

  .nav-links ul {
    flex-direction: column;
    gap: 16px;
  }

  .nav-links.show {
    display: flex;
  }

  .dropdown-menu {
    position: static !important;
    display: block;
    height: 0;
    overflow: hidden;
    background: #111;
    border-radius: 6px;
    margin: 0;
    padding: 0;
    transition: height .3s ease;
  }

  .dropdown-menu.show {
    display: flex;
    /* Note: Original CSS had .dropdown-menu.show{display:flex} inside media query in one place and display:block in another. 
           In mobile view, standard behavior usually toggles height or display. 
           Keeping consistent with home.css logic. */
  }

  .dropdown-menu li {
    list-style: none;
  }

  .dropdown-menu li a {
    display: block;
    padding: 10px 16px;
    color: #fff;
  }

  .dropdown.open>.dropdown-menu,
  .dropdown-submenu.open>.dropdown-menu {
    height: auto;
  }

  .dropdown.open>a i {
    transform: rotate(180deg);
    transition: .3s;
  }
}

/* 🔹 Main Dropdown Positioning (Desktop) */
@media (min-width: 769px) {

  /* Position main dropdown below the header with a gap */
  .dropdown>.dropdown-menu {
    top: calc(100% + 20px);
    /* Pushes it below the header bar (clearing nav padding) */
    margin-top: 15px;
    /* Adds requested vertical space */
    display: none;
  }

  /* Ensure dropdown shows on hover (if not already handled) and bridge the gap */
  .dropdown:hover>.dropdown-menu {
    display: block;
  }

  /* Invisible bridge to maintain hover state across the gap */
  .dropdown>.dropdown-menu::before {
    content: "";
    position: absolute;
    top: -40px;
    /* Covers margin and offset to bridge gap to parent link */
    left: 0;
    width: 100%;
    height: 40px;
    background: transparent;
  }
}

/* 🔹 Nested Dropdown (Desktop) */
@media (min-width: 769px) {
  .dropdown-submenu {
    position: relative;
  }

  .dropdown-submenu .dropdown-menu {
    top: -8px;
    /* Offset for parent padding/border */
    left: 100%;
    margin-left: 0px;
    display: none;
    font-size: 14px;
    font-weight: 500;
    background: #000;
    /* Ensure solid background */
    z-index: 1001;
    /* Layer above main menu */
    position: absolute;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    /* distinct shadow */
    border-radius: 6px;
    min-width: 220px;
    /* Ensure width */
  }

  /* Bridge for nested dropdown */
  .dropdown-submenu .dropdown-menu::before {
    content: "";
    position: absolute;
    top: 0;
    right: 100%;
    /* Connect to the left (parent menu) */
    width: 20px;
    /* Bridge gap if any */
    height: 100%;
    background: transparent;
  }

  .dropdown-submenu:hover>.dropdown-menu {
    display: block;
  }

  .dropdown-submenu>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .dropdown-submenu>a::after {
    content: "\f0da";
    /* FontAwesome chevron-right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 10px;
    font-size: 12px;
  }
}

/* 🔹 Nested Dropdown (Mobile) */
@media (max-width: 768px) {
  .dropdown-submenu .dropdown-menu {
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dropdown-submenu>a::after {
    content: "\f078";
    /* chevron-down */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 10px;
    margin-left: auto;
    transform: rotate(0deg);
    transition: transform 0.3s;
  }

  .dropdown-submenu.open>a::after {
    transform: rotate(180deg);
  }
}