.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: transparent;
  z-index: 1000;
  transition: var(--transition);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(20px);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-menu {
  display: flex;
  gap: 50px;
}

.nav-link {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 1rem;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.search-btn {
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-dark);
}

.search-btn:hover {
  color: var(--primary-color);
}

.header-cta {
  font-size: 16px;
}

/* Search Sliding Top Bar */
.search-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  background: #ffffff;
  /* padding: 30px 0; */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  /* Above everything */
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: block;
  /* Always block, just hidden by transform */
  opacity: 1;
}

.search-container.active {
  transform: translateY(0);
}

.search-form {
  /* max-width: 800px; */
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 15px;
  position: relative;
  padding: 0 20px;
}

.search-input {
  flex: 1;
  max-width: 800px;
  padding: 15px 25px;
  border: 2px solid #eee;
  border-radius: 50px;
  outline: none;
  font-size: 1.1rem;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.search-form .btn {
  border-radius: 50px;
  padding: 0 35px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.close-search {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: #999;
  cursor: pointer;
  transition: color 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-search:hover {
  color: var(--primary-color);
  background: #f0f0f0;
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .nav-menu {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    gap: 0;
    padding: 20px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 999;
  }

  .nav-menu.active {
    display: flex; /* Ensure it stays flex in mobile */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-link {
    width: 100%;
    padding: 15px 30px;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-link::after {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }
  .logo img {
    height: 25px;
  }
  header .header-cta {
    padding: 15px;
  }
}

@media (max-width: 768px) {
  .header-actions {
    gap: 20px;
  }
  .search-input {
    width: 100%;
  }
  .search-form {
    padding: 0;
    align-items: center;
  }
  .search-form .btn {
    padding: 10px;
    border-radius: 15px;
  }
  .close-search {
    position: relative;
    transform: none;
  }
}
