:root {
  --blue: #0b6aa9;
  --blue-dark: #174f7c;
  --blue-pale: #e7f0f8;
  --line: #afc3d2;
  --text: #172530;
  --muted: #617685;
  --page: #edf0f2;
  --green: #078b35;
  --yellow: #fff2bd;
  font-family: Arial, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--text); font-size: 12px; }
button, input, select { font: inherit; }
a { color: #075d9a; }

.site-header { height: 56px; background: var(--blue-dark); border-bottom: 4px solid var(--blue); }
.header-inner { height: 100%; max-width: 1540px; margin: auto; padding: 0 14px; display: flex; align-items: center; color: #fff; }
.brand { display: flex; align-items: center; padding-right: 16px; border-right: 1px solid rgba(255,255,255,.35); }
.brand img { display: block; width: 105px; max-height: 32px; object-fit: contain; }
.header-title { display: flex; flex-direction: column; gap: 1px; padding-left: 15px; }
.header-title strong { font-size: 14px; }
.header-title span { font-size: 10px; color: #d8e5ef; }
.private-label { margin-left: auto; border: 1px solid rgba(255,255,255,.65); padding: 5px 8px; font-size: 9px; font-weight: bold; }

.page-shell { max-width: 1540px; margin: 0 auto; min-height: calc(100vh - 90px); background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.12); }
.breadcrumb { height: 34px; padding: 10px 14px 7px; border-bottom: 1px solid #d5dfe7; color: #5b6c79; font-size: 11px; }
.catalog-panel { padding: 9px 12px 24px; }
.panel-tabs { height: 31px; display: flex; border-bottom: 3px solid var(--blue); }
.panel-tabs strong, .panel-tabs span { display: flex; align-items: center; padding: 0 24px; border: 1px solid var(--blue); border-bottom: 0; }
.panel-tabs strong { background: var(--blue); color: #fff; }
.panel-tabs span { margin-left: -1px; background: #eef6fc; color: #315b79; font-size: 10px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 8px 3px; border-bottom: 1px solid #d4e0e9; color: #536675; }
.stats-row b { color: #122b40; }
.result-counter { margin-left: auto; color: #223849; font-weight: bold; }

.filters { display: grid; grid-template-columns: minmax(260px,2fr) repeat(3,minmax(135px,1fr)) 68px; gap: 1px; margin-top: 9px; border: 1px solid #aebfcd; background: #aebfcd; }
.filters label { display: flex; flex-direction: column; min-width: 0; padding: 5px 7px; background: #f8fafc; }
.filters label span { margin-bottom: 3px; color: #567083; font-size: 9px; font-weight: bold; text-transform: uppercase; }
.filters input, .filters select { width: 100%; min-width: 0; height: 28px; padding: 3px 6px; border: 1px solid #9eb3c4; border-radius: 0; background: #fff; color: #1a2935; }
.filters button { border: 0; background: #e4edf4; color: #174f7c; font-weight: bold; cursor: pointer; }
.filters button:hover, .load-more:hover { background: #d2e5f3; }
.rate-note { margin: 7px 0; padding: 6px 8px; border: 1px solid #e2c96c; background: #fff8dd; color: #60501c; font-size: 10px; }

.car-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; }
.car-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid #a9bfd0; background: #fff; cursor: pointer; }
.car-card:hover { border-color: #1477b6; box-shadow: 0 0 0 1px #1477b6; }
.card-image { position: relative; height: 145px; overflow: hidden; border-bottom: 1px solid #a9bfd0; background: #dfe4e7; }
.card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.grade-badge { position: absolute; top: 5px; left: 5px; min-width: 60px; padding: 6px 8px; background: #174f7c; color: #fff; font-size: 11px; font-weight: 800; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.sold-badge { position: absolute; top: 5px; right: 5px; padding: 7px 12px; background: var(--green); color: #fff; font-size: 14px; font-weight: 900; letter-spacing: .04em; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.image-count { position: absolute; right: 5px; bottom: 5px; padding: 3px 5px; background: rgba(0,0,0,.76); color: #fff; font-size: 9px; font-weight: bold; }
.card-head { padding: 6px 7px 5px; border-bottom: 1px solid #c3d4e1; background: var(--blue-pale); }
.card-meta { display: flex; justify-content: space-between; gap: 6px; color: #526d80; font-size: 9px; }
.card-head h3 { margin: 3px 0 0; overflow: hidden; color: #0e4f7d; font-size: 12px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.card-trim { min-height: 12px; margin: 2px 0 0; overflow: hidden; color: #495e6d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.card-specs { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid #c9d7e1; }
.card-specs div { min-width: 0; padding: 4px 6px; border-right: 1px solid #c9d7e1; }
.card-specs div:last-child { border: 0; }
.card-specs span { display: block; color: #718492; font-size: 8px; }
.card-specs b { display: block; margin-top: 1px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.price-box { margin-top: auto; }
.price-title { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 3px; color: #5e7180; font-size: 8px; font-weight: bold; text-transform: uppercase; }
.price-title b { color: var(--green); font-size: 9px; }
.price-main { display: flex; justify-content: space-between; align-items: center; padding: 5px 7px; border-top: 1px solid #ead89b; border-bottom: 1px solid #ead89b; background: var(--yellow); }
.price-main span { color: #69560f; font-size: 9px; font-weight: bold; }
.price-main strong { color: #624a00; font-size: 14px; }
.currency-grid { display: grid; grid-template-columns: repeat(2,1fr); }
.currency-grid div { display: flex; justify-content: space-between; gap: 5px; padding: 3px 5px; border-right: 1px solid #d6e0e7; border-bottom: 1px solid #d6e0e7; font-size: 8px; }
.currency-grid div:nth-child(even) { border-right: 0; }
.currency-grid span { color: #657987; }
.currency-grid b { color: #1c3446; white-space: nowrap; }
.card-foot { display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; background: #f4f7f9; color: #607482; font-size: 8px; }
.load-more { display: block; margin: 14px auto 0; padding: 8px 20px; border: 1px solid #7da5c2; background: #edf6fc; color: #174f7c; font-weight: bold; cursor: pointer; }
.empty-state { padding: 45px; border: 1px solid #bccbd6; background: #f5f7f8; color: #617381; text-align: center; }

footer { max-width: 1540px; margin: 0 auto; padding: 10px 14px; background: #263746; color: #bcc8d1; font-size: 9px; }

.vehicle-dialog { width: min(1280px,96vw); max-height: 94vh; padding: 0; overflow: hidden; border: 2px solid #174f7c; background: #fff; color: #1c2730; }
.vehicle-dialog::backdrop { background: rgba(0,0,0,.78); }
.dialog-bar { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; height: 39px; padding-left: 12px; background: #174f7c; color: #fff; }
.dialog-bar button { width: 44px; height: 39px; border: 0; border-left: 1px solid rgba(255,255,255,.35); background: #174f7c; color: #fff; font-size: 25px; cursor: pointer; }
.dialog-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(310px,.75fr); max-height: calc(94vh - 39px); overflow: auto; }
.dialog-gallery { min-width: 0; background: #111; }
.gallery-stage { position: relative; display: grid; place-items: center; height: min(70vh,720px); overflow: hidden; background: #111; }
.gallery-stage > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-nav { position: absolute; top: 44%; z-index: 2; width: 40px; height: 56px; border: 1px solid #fff; background: rgba(0,0,0,.68); color: #fff; font-size: 32px; cursor: pointer; }
.gallery-nav.previous { left: 9px; }
.gallery-nav.next { right: 9px; }
.gallery-counter { position: absolute; top: 9px; left: 9px; padding: 5px 7px; background: rgba(0,0,0,.72); color: #fff; }
.gallery-thumbs { display: flex; gap: 5px; min-height: 61px; padding: 7px; overflow-x: auto; border-top: 1px solid #345165; background: #16232d; scrollbar-color: #617789 #16232d; }
.gallery-thumbs button { flex: 0 0 70px; width: 70px; height: 47px; padding: 0; border: 2px solid transparent; background: #222; opacity: .72; cursor: pointer; }
.gallery-thumbs button.active { border-color: #25a4ee; opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dialog-content { padding: 14px; overflow: auto; }
.dialog-content > p:first-child { margin: 0 0 4px; color: #60788a; font-size: 9px; }
.dialog-content h2 { margin: 0 0 10px; color: #174f7c; font-size: 19px; line-height: 1.1; }
.dialog-prices { margin-bottom: 10px; border: 1px solid #d8c16d; }
.dialog-prices .price-main { padding: 7px 8px; }
.dialog-prices .price-main strong { font-size: 17px; }
.dialog-prices .currency-grid div { padding: 5px 7px; font-size: 9px; }
.dialog-prices .price-title:not(:first-child) { margin-top: 5px; border-top: 2px solid #174f7c; }
.dialog-content dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; border: 1px solid #b7cada; }
.dialog-content dl div { padding: 6px 7px; border-right: 1px solid #c8d7e1; border-bottom: 1px solid #c8d7e1; }
.dialog-content dl div:nth-child(even) { border-right: 0; }
.dialog-content dt { color: #6d8292; font-size: 8px; }
.dialog-content dd { margin: 2px 0 0; font-size: 10px; font-weight: bold; }
.source-note { margin: 10px 0 0; color: #6b7e8c; font-size: 8px; line-height: 1.5; }

@media (max-width: 1220px) {
  .car-grid { grid-template-columns: repeat(4,1fr); }
}

@media (max-width: 960px) {
  .car-grid { grid-template-columns: repeat(3,1fr); }
  .filters { grid-template-columns: 1.5fr 1fr 1fr; }
  .filters .wide { grid-column: span 2; }
  .filters button { min-height: 43px; }
  .dialog-layout { grid-template-columns: 1fr; }
  .gallery-stage { height: min(62vh,620px); }
}

@media (max-width: 680px) {
  .car-grid { grid-template-columns: repeat(2,1fr); gap: 5px; }
  .result-counter { width: 100%; margin-left: 0; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .wide { grid-column: 1 / -1; }
  .header-title span, .private-label { display: none; }
  .card-image { height: 150px; }
  .vehicle-dialog { inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; }
  .dialog-bar { position: sticky; top: 0; height: 45px; }
  .dialog-bar button { height: 45px; }
  .dialog-layout { display: block; max-height: calc(100dvh - 45px); }
  .gallery-stage { height: 54vh; min-height: 330px; }
  .gallery-thumbs { min-height: 58px; padding: 6px; }
  .gallery-thumbs button { flex-basis: 64px; width: 64px; height: 43px; }
}

@media (max-width: 440px) {
  body { font-size: 11px; }
  .site-header { height: 50px; }
  .brand img { width: 86px; }
  .header-title strong { font-size: 12px; }
  .page-shell { box-shadow: none; }
  .catalog-panel { padding: 7px; }
  .breadcrumb { padding-left: 8px; }
  .panel-tabs span { display: none; }
  .panel-tabs strong { width: 100%; justify-content: center; }
  .stats-row span:nth-child(-n+2) { display: none; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label { padding: 4px; }
  .filters .wide, .filters label:nth-child(4), .filters button { grid-column: 1 / -1; }
  .filters button { min-height: 31px; }
  .car-grid { grid-template-columns: 1fr; }
  .card-image { height: 210px; }
  .currency-grid div { padding: 4px 6px; font-size: 9px; }
  .gallery-stage { height: 46vh; min-height: 280px; }
  .dialog-content dl { grid-template-columns: 1fr 1fr; }
}
