:root {
  --red: #e30613;
  --red-dark: #b9000a;
  --ink: #17181c;
  --graphite: #24262d;
  --steel: #747985;
  --line: #e6e7ea;
  --paper: #ffffff;
  --soft: #f5f5f6;
  --silver: #c9cbd1;
  --gold: #b49a68;
  --shadow: 0 18px 45px rgba(19, 20, 24, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.is-loading {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(140deg, rgba(227, 6, 19, 0.22), transparent 38%),
    linear-gradient(180deg, #07080b, #181a20 58%, #0f1014);
  color: var(--paper);
  transition: opacity 220ms ease, visibility 220ms ease;
}

body.is-ready .page-loader {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loader-card {
  position: fixed;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(300px, calc(100vw - 32px));
  padding: 26px 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.loader-card img {
  width: 190px;
  max-width: 82%;
  height: auto;
  filter: brightness(0) invert(1) drop-shadow(0 16px 28px rgba(0, 0, 0, 0.34));
}

.loader-card span {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.loader-track {
  overflow: hidden;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.loader-track i {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  animation: loaderSlide 1100ms ease-in-out infinite;
}

@keyframes loaderSlide {
  0% {
    transform: translateX(-115%);
  }

  50% {
    transform: translateX(80%);
  }

  100% {
    transform: translateX(245%);
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 96px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-logo {
  overflow: visible;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 132px;
  height: 78px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: translateY(-8px);
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand > span:last-child {
  min-width: 0;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
}

.nav-tabs a {
  min-width: 0;
  overflow: hidden;
  padding: 9px 14px;
  border-radius: 6px;
  color: var(--steel);
  font-size: 0.92rem;
  font-weight: 800;
  text-overflow: ellipsis;
}

.nav-tabs a.is-active {
  background: var(--ink);
  color: var(--paper);
}

.catalog-shell {
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr;
  min-height: calc(100vh - 73px);
}

.catalog-panel {
  position: sticky;
  top: 73px;
  align-self: start;
  min-height: calc(100vh - 73px);
  padding: clamp(22px, 4vw, 42px);
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.18), transparent 34%),
    linear-gradient(180deg, #101115, #202229);
  color: var(--paper);
}

.panel-mark {
  display: grid;
  gap: 8px;
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.panel-mark span,
.catalog-heading p,
.section-title p {
  margin: 0;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-mark strong {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 0.95;
}

.filter-stack,
.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field small {
  color: var(--steel);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.35;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.password-control {
  position: relative;
  display: block;
}

.password-control input {
  padding-right: 76px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--red);
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.field select option {
  background: var(--paper);
  color: var(--ink);
}

.field select option:checked {
  background: var(--ink);
  color: var(--paper);
}

.field select.is-native-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.custom-select {
  position: relative;
}

.custom-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  text-align: left;
}

.custom-select-button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.custom-select.is-open .custom-select-button {
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 25;
  overflow: hidden;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #202127;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.28);
}

.custom-select-options button {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--paper);
  text-align: left;
}

.custom-select-options button:hover,
.custom-select-options button.is-selected {
  background: rgba(255, 255, 255, 0.1);
}

.custom-select-options button.is-selected {
  color: #ffffff;
  font-weight: 900;
}

.field textarea {
  resize: vertical;
}

.catalog-panel .field input,
.catalog-panel .field select {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

.catalog-panel .field select option {
  color: var(--ink);
}

.catalog-panel .field select option:checked {
  background: var(--ink);
  color: var(--paper);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--silver);
  box-shadow: 0 0 0 3px rgba(201, 203, 209, 0.18);
}

#carMileage,
#carPrice {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

#carPrice {
  color: var(--red);
}

.catalog-panel .field input:focus,
.catalog-panel .field select:focus {
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.catalog-view {
  padding: clamp(18px, 4vw, 48px);
}

.catalog-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 24px;
}

.catalog-heading p {
  grid-column: 1 / -1;
}

.catalog-heading h1,
.section-title h1,
.section-title h2 {
  margin: 0;
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 0.92;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.section-title h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.heading-actions {
  justify-self: end;
}

.ghost-link,
.quiet-button,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
  text-transform: uppercase;
}

.quiet-button {
  color: var(--steel);
}

.secondary-button {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.primary-button,
.deal-button,
.details-button {
  border-color: var(--red);
  background: var(--red);
  color: var(--paper);
}

.primary-button:hover,
.deal-button:hover,
.details-button:hover {
  background: var(--red-dark);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding-block: 14px;
  border-block: 1px solid var(--line);
}

.catalog-toolbar span {
  color: var(--steel);
  font-weight: 800;
}

.brand-showcase {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.075), transparent 34%),
    linear-gradient(180deg, #ffffff, #fbfbfc),
    var(--paper);
  box-shadow: 0 18px 42px rgba(17, 18, 22, 0.08);
}

.brand-showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-showcase-head div:first-child {
  display: grid;
  gap: 5px;
}

.brand-showcase-head span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-showcase-head strong {
  font-size: 1.32rem;
  line-height: 1;
  text-transform: uppercase;
}

.type-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f1f4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.type-switch button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--steel);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.type-switch button.is-active {
  background: var(--ink);
  color: var(--paper);
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 12px;
  max-height: 318px;
  overflow: auto;
  padding-right: 2px;
}

.brand-mobile-select {
  display: none;
}

.brand-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff, #fbfbfc);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(17, 18, 22, 0.045);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease;
}

.brand-card:hover,
.brand-card.is-active {
  border-color: rgba(227, 6, 19, 0.38);
  box-shadow: 0 14px 28px rgba(17, 18, 22, 0.1);
  transform: translateY(-2px);
}

.brand-card.is-active {
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.1), transparent 45%),
    #ffffff;
}

.brand-logo-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f6f8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.brand-logo-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-logo-mark span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-card-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.brand-card-copy strong,
.brand-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-card-copy strong {
  font-size: 0.9rem;
  line-height: 1.08;
  text-transform: uppercase;
  white-space: normal;
}

.brand-card-copy small {
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.vehicle-brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vehicle-brand-row span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.vehicle-brand-row span:last-child {
  background: rgba(227, 6, 19, 0.1);
  color: var(--red);
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 420px));
  align-items: stretch;
  justify-content: start;
  gap: 18px;
}

.vehicle-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  min-height: 650px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(17, 18, 22, 0.08);
}

.vehicle-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #d8dbe0;
}

.vehicle-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 1;
  backface-visibility: hidden;
  transition: opacity 170ms ease, transform 220ms ease;
  will-change: opacity, transform;
}

.vehicle-card:hover .vehicle-media:not(.is-changing) .vehicle-card-photo {
  transform: scale(1.025);
}

.vehicle-media.is-changing .vehicle-card-photo {
  opacity: 0;
  transform: scale(1.015);
}

.status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(23, 24, 28, 0.84);
  color: var(--paper);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.photo-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.photo-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.76);
  color: var(--paper);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 180ms ease, border-color 180ms ease;
}

.photo-arrow:hover,
.photo-arrow:focus-visible {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(227, 6, 19, 0.92);
}

.photo-arrow-prev {
  left: 12px;
}

.photo-arrow-next {
  right: 12px;
}

.vehicle-body {
  display: grid;
  grid-template-rows: auto auto minmax(31px, auto) 1fr auto;
  gap: 16px;
  padding: 18px;
}

.vehicle-title {
  display: grid;
  gap: 8px;
}

.vehicle-title h2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  min-height: 2.1em;
  font-size: clamp(1.2rem, 2vw, 1.72rem);
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.vehicle-title p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  min-height: 2.9em;
  color: var(--graphite);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.45;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.spec-list div {
  display: grid;
  gap: 2px;
  padding: 9px;
  background: var(--soft);
  border-radius: 6px;
}

.spec-list dt {
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.spec-list dd {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 900;
}

.highlight-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.highlight-row span {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(180, 154, 104, 0.14);
  color: #6e5830;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-actions {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-self: end;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.price-row span {
  min-width: 178px;
  flex: 1;
  color: var(--steel);
  font-weight: 900;
}

.price-row strong {
  display: block;
  color: var(--red);
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1;
}

.deal-button,
.details-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 134px;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--red);
  border-radius: 6px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}

.details-button {
  border-color: var(--line);
  background: var(--paper);
  color: var(--ink);
}

.details-button:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.details-dialog {
  width: min(980px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.details-dialog::backdrop {
  background: rgba(9, 10, 14, 0.7);
}

.details-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  max-height: inherit;
  overflow: auto;
}

.details-gallery {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: var(--soft);
}

.details-main-photo {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: var(--soft);
}

.details-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
  padding: 8px;
  background: #111217;
}

.details-thumb {
  overflow: hidden;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.details-thumb.is-active {
  border-color: var(--red);
}

.details-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.details-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 24, 28, 0.88);
  color: var(--paper);
  font-size: 1.7rem;
  line-height: 1;
}

.details-copy {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(22px, 4vw, 38px);
}

.details-copy > span {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.details-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.details-copy p {
  margin: 0;
  color: var(--graphite);
  font-weight: 800;
  line-height: 1.45;
}

.details-copy strong {
  color: var(--red);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.details-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.details-list div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 6px;
  background: var(--soft);
}

.details-list dt {
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.details-list dd {
  margin: 0;
  font-weight: 900;
}

.details-description {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.empty-state {
  display: grid;
  gap: 7px;
  place-items: center;
  min-height: 210px;
  padding: 26px;
  border: 1px dashed var(--silver);
  border-radius: 8px;
  color: var(--steel);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 1.25rem;
}

.empty-state.compact {
  min-height: 150px;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  align-items: start;
  gap: 24px;
  padding: clamp(18px, 4vw, 44px);
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.05), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(23, 24, 28, 0.08), transparent 28%);
}

body.admin-login-mode .admin-shell {
  grid-template-columns: minmax(320px, 640px);
  justify-content: center;
  align-content: center;
  min-height: calc(100vh - 96px);
}

body.admin-login-mode .admin-panel {
  width: 100%;
}

body.admin-login-mode .section-title {
  text-align: center;
}

body.admin-login-mode .section-title h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
}

.admin-panel,
.inventory-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(19, 20, 24, 0.1);
}

.admin-panel {
  overflow: hidden;
  padding: 0;
}

.inventory-panel {
  position: sticky;
  top: 116px;
  align-self: start;
  padding: clamp(18px, 3vw, 28px);
}

.section-title {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
  padding: clamp(22px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff, #fafafa);
}

.inventory-panel .section-title {
  padding: 0 0 18px;
  margin-bottom: 18px;
  background: transparent;
}

.settings-line {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 22px clamp(18px, 3vw, 30px);
  border-bottom: 1px solid var(--line);
  background: #fbfbfc;
}

.login-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 14px;
  margin: clamp(18px, 3vw, 30px);
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(23, 24, 28, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.07), transparent 36%),
    var(--soft);
}

.login-heading {
  display: grid;
  gap: 5px;
  grid-column: 1 / -1;
  padding-bottom: 6px;
}

.login-heading span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-heading strong {
  font-size: 1.35rem;
}

.login-panel .secondary-button,
.login-panel .quiet-button {
  width: 100%;
}

.admin-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: clamp(18px, 3vw, 30px);
  padding: 14px 16px;
  border: 1px solid rgba(23, 24, 28, 0.08);
  border-radius: 8px;
  background: #17181c;
  color: var(--paper);
}

.admin-status div {
  display: grid;
  gap: 4px;
}

.admin-status span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-status strong {
  font-size: 1rem;
}

.admin-status .quiet-button {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

.setup-notice {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid rgba(227, 6, 19, 0.18);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: rgba(227, 6, 19, 0.06);
}

.setup-notice strong {
  font-size: 1.1rem;
  text-transform: uppercase;
}

.setup-notice p {
  margin: 0;
  color: var(--graphite);
  line-height: 1.5;
}

.setup-notice code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--red);
  font-weight: 900;
}

.form-grid {
  padding: 0 clamp(18px, 3vw, 30px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section-title {
  display: grid;
  gap: 5px;
  margin: 0 clamp(18px, 3vw, 30px) 16px;
  padding-top: 24px;
}

.form-section-title span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-section-title strong {
  font-size: 1.15rem;
}

.span-2 {
  grid-column: span 2;
}

.photo-manager {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(23, 24, 28, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(227, 6, 19, 0.055), transparent 36%),
    #fbfbfc;
}

.photo-manager-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.photo-manager-head div {
  display: grid;
  gap: 5px;
}

.photo-manager-head span {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-manager-head strong {
  font-size: 1.18rem;
}

.photo-manager-head small,
.photo-drop small {
  color: var(--steel);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.photo-drop {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  border: 1px dashed rgba(227, 6, 19, 0.38);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.photo-drop:hover,
.photo-drop:focus-within {
  border-color: var(--red);
  box-shadow: 0 12px 28px rgba(227, 6, 19, 0.08);
  transform: translateY(-1px);
}

.photo-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-drop-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--red);
  color: var(--paper);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.photo-drop > span:last-child {
  display: grid;
  gap: 4px;
}

.photo-drop strong {
  font-size: 1.08rem;
  text-transform: uppercase;
}

.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.photo-preview-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.photo-preview-card img {
  width: 100%;
  aspect-ratio: 1.15 / 1;
  object-fit: cover;
  background: var(--soft);
}

.photo-preview-card span {
  display: block;
  padding: 8px;
  color: var(--steel);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.photo-cover-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(23, 24, 28, 0.86);
  color: var(--paper);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.photo-url-field {
  padding-top: 4px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding: 22px clamp(18px, 3vw, 30px);
  border-top: 1px solid var(--line);
  background: #fbfbfc;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-card {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfbfc);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.admin-card:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 24, 28, 0.14);
  box-shadow: 0 12px 26px rgba(19, 20, 24, 0.08);
}

.admin-card img {
  width: 116px;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

.admin-card-content {
  display: grid;
  gap: 8px;
}

.admin-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.admin-card p {
  margin: 0;
  color: var(--steel);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-photo-count {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  padding: 5px 7px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--steel);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-card strong {
  color: var(--red);
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-button.danger {
  border-color: rgba(227, 6, 19, 0.2);
  background: rgba(227, 6, 19, 0.08);
  color: var(--red);
}

body.toast-visible::after {
  content: attr(data-toast);
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  padding: 13px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .vehicle-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 420px));
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .inventory-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  body[data-page="catalog"] {
    background: #101115;
  }

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

  body[data-page="catalog"] .topbar {
    position: static;
    min-height: auto;
    padding: 12px 16px;
    background: #0f1014;
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: var(--paper);
  }

  body[data-page="catalog"] .brand {
    justify-content: center;
  }

  body[data-page="catalog"] .brand-logo {
    width: 118px;
    height: 64px;
  }

  body[data-page="catalog"] .brand-logo img {
    filter: brightness(0) invert(1);
  }

  body[data-page="catalog"] .brand > span:last-child {
    display: none;
  }

  .nav-tabs {
    align-self: stretch;
    width: auto;
  }

  .nav-tabs a {
    flex: 1;
    text-align: center;
  }

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

  .catalog-panel {
    position: static;
    min-height: auto;
  }

  body[data-page="catalog"] .catalog-shell {
    display: block;
    min-height: auto;
    background:
      linear-gradient(180deg, #0f1014 0, #17181c 320px, var(--soft) 321px);
  }

  body[data-page="catalog"] .catalog-panel {
    margin: 0 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background:
      linear-gradient(140deg, rgba(227, 6, 19, 0.18), transparent 42%),
      #1a1c22;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.25);
  }

  body[data-page="catalog"] .panel-mark {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 16px;
  }

  body[data-page="catalog"] .panel-mark strong {
    font-size: 1.4rem;
    text-align: right;
  }

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

  body[data-page="catalog"] .filter-stack {
    gap: 10px;
  }

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

  body[data-page="catalog"] .catalog-view {
    padding: 28px 14px 20px;
    background: var(--soft);
  }

  body[data-page="catalog"] .catalog-heading {
    position: relative;
    margin: 0 -14px 16px;
    padding: 22px 14px 76px;
    background:
      linear-gradient(180deg, rgba(15, 16, 20, 0.08), transparent),
      #17181c;
    color: var(--paper);
  }

  body[data-page="catalog"] .catalog-heading h1 {
    max-width: 100%;
    font-size: 2.08rem;
    line-height: 1;
    overflow-wrap: anywhere;
  }

  body[data-page="catalog"] .catalog-heading p {
    color: #ff3540;
  }

  body[data-page="catalog"] .catalog-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 0;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 12px 34px rgba(17, 18, 22, 0.12);
  }

  body[data-page="catalog"] .catalog-toolbar span {
    text-align: center;
  }

  body[data-page="catalog"] .brand-showcase {
    margin-top: -58px;
    margin-bottom: 16px;
    gap: 12px;
    padding: 12px;
    box-shadow: 0 12px 34px rgba(17, 18, 22, 0.12);
  }

  .brand-showcase-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-showcase-head div:first-child {
    gap: 2px;
  }

  .brand-showcase-head span {
    font-size: 0.66rem;
  }

  .brand-showcase-head strong {
    font-size: 1.08rem;
  }

  .type-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .type-switch button {
    min-height: 38px;
    padding-inline: 6px;
    font-size: 0.74rem;
  }

  .heading-actions {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .brand-logo {
    width: 92px;
    height: 60px;
  }

  .brand span {
    font-size: 0.9rem;
  }

  .nav-tabs a {
    padding-inline: 8px;
    font-size: 0.86rem;
  }

  .catalog-heading h1,
  .section-title h1 {
    font-size: 2.12rem;
    line-height: 1;
  }

  .section-title h2 {
    font-size: 1.65rem;
    line-height: 1.05;
  }

  .filter-stack,
  .vehicle-grid,
  .form-grid,
  .settings-line {
    grid-template-columns: 1fr;
  }

  body[data-page="catalog"] .catalog-panel {
    transform: translateY(-1px);
  }

  body[data-page="catalog"] .panel-mark {
    grid-template-columns: 1fr;
  }

  body[data-page="catalog"] .panel-mark strong {
    text-align: left;
  }

  body[data-page="catalog"] .field input,
  body[data-page="catalog"] .field select,
  body[data-page="catalog"] .custom-select-button {
    min-height: 50px;
    border-radius: 8px;
  }

  .admin-status,
  .login-panel {
    margin-inline: 16px;
  }

  .admin-status,
  .settings-line {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-status {
    display: grid;
  }

  .vehicle-card {
    min-height: auto;
    max-width: none;
  }

  body[data-page="catalog"] .vehicle-grid {
    gap: 16px;
  }

  body[data-page="catalog"] .vehicle-card {
    border-radius: 8px;
    border-color: rgba(23, 24, 28, 0.12);
    box-shadow: 0 16px 34px rgba(17, 18, 22, 0.14);
  }

  body[data-page="catalog"] .vehicle-media {
    aspect-ratio: 1.16 / 1;
  }

  body[data-page="catalog"] .vehicle-body {
    gap: 13px;
    padding: 15px;
  }

  body[data-page="catalog"] .vehicle-title h2 {
    min-height: 0;
    font-size: 1.32rem;
  }

  body[data-page="catalog"] .vehicle-title p {
    min-height: 0;
    font-size: 0.82rem;
  }

  .brand-grid {
    display: flex;
    gap: 8px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .brand-card {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 40px;
    max-width: 170px;
    padding: 0 14px;
    border-radius: 999px;
    box-shadow: none;
    scroll-snap-align: start;
  }

  .brand-card:hover,
  .brand-card.is-active {
    transform: none;
    box-shadow: 0 8px 18px rgba(17, 18, 22, 0.1);
  }

  .brand-logo-mark,
  .brand-card-copy small {
    display: none;
  }

  .brand-card-copy {
    display: block;
  }

  .brand-card-copy strong {
    display: block;
    overflow: hidden;
    max-width: 138px;
    font-size: 0.78rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-page="catalog"] .spec-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-page="catalog"] .spec-list div {
    min-height: 58px;
    padding: 7px 5px;
    text-align: center;
  }

  body[data-page="catalog"] .spec-list dt {
    font-size: 0.58rem;
  }

  body[data-page="catalog"] .spec-list dd {
    font-size: 0.72rem;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  body[data-page="catalog"] .price-row {
    align-items: start;
    gap: 8px;
    padding-top: 14px;
  }

  body[data-page="catalog"] .price-row span {
    min-width: 0;
  }

  body[data-page="catalog"] .price-row strong {
    font-size: 1.58rem;
  }

  body[data-page="catalog"] .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .span-2 {
    grid-column: auto;
  }

  .catalog-toolbar,
  .price-row,
  .card-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .deal-button,
  .details-button,
  .quiet-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  body[data-page="catalog"] .deal-button,
  body[data-page="catalog"] .details-button {
    min-width: 0;
    height: 46px;
    padding-inline: 8px;
    font-size: 0.75rem;
  }

  .details-card {
    grid-template-columns: 1fr;
  }

  .details-gallery {
    min-height: 260px;
    max-height: 340px;
  }

  .details-main-photo {
    min-height: 0;
  }

  .details-list,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .admin-card {
    grid-template-columns: 88px 1fr;
  }

  .admin-card img {
    width: 88px;
    height: 78px;
  }

  body:not([data-page="catalog"]) .vehicle-media {
    aspect-ratio: 4 / 3;
  }
}
