* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --surface: #ffffff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --container: 1240px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: #f1f5f9;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(var(--container), 92%);
  margin: 0 auto;
}

/* ===== Header ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(18px);
  background: rgba(4, 8, 14, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.header-inner {
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(220px, 280px) auto auto;
  align-items: center;
  gap: 30px;
}

.logo {
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  padding: 5px;
  min-height: 42px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.header-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0 12px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 400;
}

.header-search input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.header-search button {
  border: none;
  background: #111827;
  color: #ffffff;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.header-search button:hover {
  background: #1f2937;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.main-nav a:hover {
  color: #ffffff;
}

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

.login-dropdown {
  position: relative;
}

.login-toggle {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 0;
}

.login-toggle:hover {
  color: #ffffff;
}

.login-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  padding: 10px;
  display: none;
}

.login-menu a {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
}

.login-menu a:hover {
  background: #f8fafc;
}

.login-dropdown:hover .login-menu {
  display: block;
}

.header-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.2s ease;
  white-space: nowrap;
}

.header-link-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ===== Hero ===== */

.hero {
  position: relative;
  min-height: 600px;
  background-image: url("/images/hero1.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.45));
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-grid {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 20;
  color: #ffffff;
  overflow: visible;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(40px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  margin-bottom: 16px;
  max-width: 700px;
  font-weight: 750;
}

.hero-description {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 16px;
  margin-bottom: 24px;
}

/* ===== Hero search ===== */

.hero-search {
  position: relative;
  z-index: 50;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr auto;
  gap: 10px;
  align-items: stretch;
  background: #ffffff;
  padding: 8px;
  border-radius: 18px;
  max-width: 930px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
  overflow: visible;
}

.search-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  overflow: visible;
}

.search-field label {
  display: none;
}

.search-field input[type="hidden"] {
  display: none !important;
}

.custom-select {
  position: relative;
  width: 100%;
  overflow: visible;
}

.custom-select-trigger {
  width: 100%;
  height: 48px;
  min-height: 48px;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.custom-select-trigger:focus {
  outline: none;
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-ui {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.custom-select-clear {
  display: none;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}

.custom-select-clear.is-visible {
  display: inline-flex;
}

.custom-select-clear:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.custom-select-arrow {
  width: 9px;
  height: 9px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -2px;
  flex: 0 0 auto;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(225deg);
  margin-top: 3px;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  padding: 8px;
  display: none;
  z-index: 99999;
}

.custom-select.open .custom-select-menu {
  display: block;
}

.custom-select-option {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
}

.custom-select-option:hover {
  background: #f8fafc;
}

.search-button {
  min-width: 138px;
  height: 48px;
  min-height: 48px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  align-self: stretch;
}

.search-button:hover {
  background: var(--primary-dark);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-trust span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 500;
}

.hero-panel {
  display: flex;
  justify-content: flex-end;
}

.hero-panel-card {
  width: 100%;
  max-width: 390px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  padding: 24px;
  color: #ffffff;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}

.panel-label {
  color: #93c5fd;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.hero-panel-card h3 {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-panel-card ul {
  list-style: none;
  display: grid;
  gap: 12px;
}

.hero-panel-card li {
  position: relative;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.84);
}

.hero-panel-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #60a5fa;
}

/* ===== Stats strip ===== */

.stats-strip {
  margin-top: -22px;
  position: relative;
  z-index: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.stat-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.stat-card span {
  color: var(--muted);
  font-size: 15px;
}

/* ===== Sections ===== */

.section-kicker {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section-text {
  max-width: 520px;
  color: var(--muted);
}

/* ===== Cars ===== */

.cars-section {
  padding: 72px 0;
}

.cars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.loading-card,
.error-message,
.empty-message {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 24px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.car-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.car-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #dbe4ee;
}

.car-content {
  padding: 20px;
}

.car-title {
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 8px;
}

.car-meta {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 10px;
}

.car-price {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.car-price span {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
}

.car-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 12px;
  font-weight: 800;
}

.car-button:hover {
  background: var(--primary-dark);
}

/* ===== Footer ===== */

.site-footer {
  margin-top: 90px;
  background: #0c1322;
  color: #e5e7eb;
}

.footer-top-strip {
  height: 4px;
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
}

.footer-main {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 60px;
  padding: 64px 0 42px;
}

.footer-brand {
  max-width: 360px;
}

.footer-logo {
  display: inline-block;
  color: #ffffff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
}

.footer-description {
  color: rgba(229, 231, 235, 0.72);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 22px;
}

.footer-brand-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-brand-links a {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}

.footer-column h4 {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-column a,
.footer-note {
  display: block;
  color: rgba(229, 231, 235, 0.72);
  font-size: 14px;
  line-height: 1.9;
}

.footer-column a:hover,
.footer-brand-links a:hover,
.footer-legal a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-bottom-inner p {
  color: rgba(229, 231, 235, 0.6);
  font-size: 13px;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-legal a {
  color: rgba(229, 231, 235, 0.68);
  font-size: 13px;
  font-weight: 500;
}

/* ===== Responsive ===== */

@media (max-width: 1200px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 0;
  }

  .header-search {
    order: 2;
  }

  .main-nav {
    order: 3;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-actions {
    order: 4;
    justify-content: center;
  }
}

@media (max-width: 1100px) {
  .hero-grid,
  .footer-main {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    justify-content: flex-start;
  }

  .cars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .header-inner {
    min-height: auto;
    padding: 16px 0;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
  }

  .hero {
    padding: 48px 0 42px;
  }

  .hero-search {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .stats-grid,
  .cars-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .header-search {
    width: 100%;
  }

  .header-search input {
    font-size: 13px;
  }

  .footer-main {
    padding: 48px 0 30px;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-bottom-inner {
    min-height: auto;
    padding: 18px 0;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .logo {
    font-size: 21px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-description {
    font-size: 16px;
  }

  .hero-panel-card,
  .stat-card,
  .car-content {
    padding: 18px;
  }
}

/* prijsfilter iets breder maken */
.hero-search {
  grid-template-columns: 1.15fr 1.15fr 1.35fr auto;
}

/* gekozen tekst in trigger op 1 regel houden */
.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* prijs dropdown opties ook op 1 regel houden */
#priceMenu .custom-select-option {
  white-space: nowrap;
}

/* prijs trigger mag iets meer ruimte krijgen */
#priceCustomSelect .custom-select-trigger {
  min-width: 170px;
}
