html {
  scroll-behavior: smooth;
}

/* Header Container */
.main-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95); /* Slight transparency */
    backdrop-filter: blur(5px); /* Modern blur effect */
    border-bottom: 1px solid #e1e1e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
  .main-header {
    transition: transform 0.24s ease;
    will-change: transform;
  }

  .main-header.header-hidden-mobile {
    transform: translateY(calc(-100% - 2px));
  }
}

.header-container {
  max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between; /* Pushes content to far left and far right */
    align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
}

/* Left Side: Logo/Text */
.header-logo-wrap {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.header-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    letter-spacing: 1px;
}

.header-all-cars-link {
  color: #475569;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.header-all-cars-link:hover {
  color: #0f172a;
  text-decoration: underline;
}

/* Right Side: Navigation */
.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.header-nav > span {
  color: #374151;
  font-size: 0.92rem;
  max-width: min(56vw, 380px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-nav form {
  margin: 0;
}

.header-nav form .nav-link {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.header-search-container {
    height: 70px;
    width: 100%;
    border-top: 1px solid #eaeaea;
    background-color: rgba(255, 255, 255, 0.95);
}

.header-search-form {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px 18px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.header-search-input {
    flex: 1;
    min-height: 46px;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 10px;
    font-size: 1rem;
    color: #2c2c2c;
}

.header-search-button {
    min-height: 46px;
    padding: 0 22px;
  border: 1px solid rgba(213, 186, 122, 0.45);
    border-radius: 10px;
  background: linear-gradient(135deg, #1f2937 0%, #0f172a 100%);
    color: white;
    font-weight: 700;
    cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.24);
}

.header-search-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(15, 23, 42, 0.28);
}

.nav-link:hover {
    color: #007bff; /* Primary blue color */
}

/* Styling for the Register button to make it stand out */
.btn-register {
  background: linear-gradient(135deg, #d5ba7a 0%, #b99858 100%);
  border: 1px solid rgba(15, 23, 42, 0.15);
    color: white !important;
    padding: 8px 18px;
    border-radius: 5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 16px rgba(185, 152, 88, 0.32);
  color: #111827 !important;
}

.btn-register:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(185, 152, 88, 0.38);
}

/* Mobile responsive header */
@media (max-width: 768px) {
  .header-container {
    padding: 12px 15px;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .header-nav {
    width: auto;
    justify-content: flex-end;
    gap: 10px;
  }

  .header-nav > span {
    max-width: min(42vw, 260px);
    font-size: 14px;
  }

  .header-search-container {
    height: auto;
  }

  .header-search-form {
    padding: 12px 15px 14px;
  }

  .header-logo a {
    font-size: 1.35rem;
    letter-spacing: 0.5px;
  }

  .header-nav {
    gap: 12px;
  }

  .nav-link {
    font-size: 15px;
    font-weight: 500;
    min-height: 42px;
  }

  .btn-register {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 4px;
    min-height: 42px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 10px 10px;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .header-logo a {
    font-size: 1.2rem;
    letter-spacing: 0px;
    flex: 1 0 auto;
  }

  .header-all-cars-link {
    font-size: 0.82rem;
  }

  .header-nav {
    gap: 8px;
    flex: 0 1 auto;
    justify-content: flex-end;
  }

  .header-search-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .nav-link {
    font-size: 14px;
    padding: 8px 12px;
    min-height: 42px;
  }

  .btn-register {
    padding: 10px 14px;
    font-size: 14px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-nav > span {
    display: none;
  }
}