:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #686868;
  --line: #d9d9d9;
  --paper: #f5f3ef;
  --panel: #ffffff;
  --red: #c51f30;
  --gold: #c69749;
  --green: #0f6b4f;
  --blue: #263b6f;
  --shadow: 0 18px 45px rgba(18, 18, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 28px;
  background: rgba(245, 243, 239, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand,
nav,
.hero-actions,
.catalog-meta,
.dialog-header {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: white;
  background: var(--red);
  border-radius: 50%;
}

nav {
  gap: 22px;
  color: #343434;
  font-weight: 650;
}

.icon-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 1.08fr);
  gap: 28px;
  min-height: calc(100vh - 72px);
  padding: 72px 6vw 48px;
  background:
    linear-gradient(120deg, rgba(21, 21, 21, 0.86), rgba(21, 21, 21, 0.24)),
    radial-gradient(circle at 74% 44%, rgba(197, 31, 48, 0.36), transparent 32%),
    linear-gradient(135deg, #191919, #4f4a42 54%, #d5c9b4);
  color: white;
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.hero-copy p:not(.eyebrow),
.checkout-copy p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.65;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.primary-action,
.secondary-action,
.ghost-action,
.misleading-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  color: white;
  background: var(--red);
}

.secondary-action,
.ghost-action {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.misleading-action {
  width: 100%;
  color: #5f5f5f;
  background: #ededed;
  border-color: #d5d5d5;
}

.hero-media {
  position: relative;
  align-self: end;
  min-height: 420px;
}

.car-silhouette {
  position: absolute;
  right: 0;
  bottom: 12%;
  width: min(680px, 100%);
  aspect-ratio: 2.45;
  border-bottom: 34px solid #101010;
  border-radius: 56% 44% 12px 12px;
  background: linear-gradient(15deg, #111 0 42%, #c51f30 43% 70%, #2d2d2d 71%);
  box-shadow: var(--shadow);
}

.car-silhouette::before,
.car-silhouette::after {
  content: "";
  position: absolute;
  bottom: -58px;
  width: 92px;
  height: 92px;
  border: 15px solid #1d1d1d;
  background: #bfc5c7;
  border-radius: 50%;
}

.car-silhouette::before {
  left: 14%;
}

.car-silhouette::after {
  right: 12%;
}

.car-silhouette span {
  position: absolute;
  left: 38%;
  top: 16%;
  width: 23%;
  height: 34%;
  background: rgba(198, 225, 235, 0.76);
  transform: skewX(-22deg);
  border-radius: 8px 38px 8px 8px;
}

.search-band,
.compare-band,
.checkout-band {
  padding: 58px 6vw 28px;
}

.search-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1fr);
  gap: 26px;
  align-items: end;
  background: var(--panel);
}

.search-box label,
.filter-group label,
.checkout-panel label {
  display: grid;
  gap: 8px;
  color: #454545;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.catalog-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 26px;
  padding: 28px 6vw 72px;
}

.filters {
  position: sticky;
  top: 96px;
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(18, 18, 18, 0.06);
}

.filter-group {
  display: grid;
  gap: 8px;
}

.catalog-content {
  min-width: 0;
}

.catalog-meta {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.catalog-meta select {
  max-width: 220px;
}

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

.car-card {
  display: grid;
  gap: 14px;
  min-height: 430px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.car-art {
  min-height: 138px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--tone), #1d1d1d);
  position: relative;
  overflow: hidden;
}

.car-art::after {
  content: "";
  position: absolute;
  left: 13%;
  right: 9%;
  bottom: 20%;
  height: 38%;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 70% 38% 18% 16%;
}

.car-card h3 {
  margin: 0;
  font-size: 1.25rem;
}

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

.specs span {
  padding: 8px;
  background: #f2f2f2;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 750;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.card-actions .primary-action {
  grid-column: span 2;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 16px;
}

.compare-item,
.checkout-panel {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-item {
  min-height: 158px;
}

.checkout-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(300px, 1fr);
  gap: 32px;
  background: #1e1e1e;
  color: white;
}

.checkout-panel {
  display: grid;
  gap: 16px;
  color: var(--ink);
}

fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

fieldset label,
.consent {
  display: flex;
  align-items: center;
  gap: 10px;
}

fieldset input,
.consent input {
  width: auto;
  min-height: auto;
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.form-message.success {
  color: var(--green);
}

.full {
  width: 100%;
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.48);
}

.dialog-header {
  justify-content: space-between;
}

.cart-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 1020px) {
  .catalog-grid,
  .compare-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }

  nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.94rem;
  }

  .hero,
  .search-band,
  .catalog-layout,
  .checkout-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 48px;
  }

  .hero-media {
    min-height: 250px;
  }

  .catalog-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .catalog-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-meta select {
    max-width: none;
  }
}
