/* ШИКАВТО — stock page shares the catalogue visual system.
   Scoped overrides only: the catalogue, AI chat and calculator remain untouched. */

/* Six destinations are rendered in the shared mobile navigation, so it must
   have six columns. The previous five-column override wrapped Contacts onto
   a second row and covered the content. */
@media (max-width:899px) {
  .bottom-nav {
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:2px !important;
  }
  .bottom-nav .nav-item {min-width:0!important; padding-inline:0!important; gap:4px!important;}
  .bottom-nav .nav-item span:last-child {
    display:block; min-width:0; max-width:100%;
    font-size:clamp(8px,2.25vw,10px)!important;
    font-weight:730; white-space:nowrap; line-height:1.15!important;
  }
  .bottom-nav .nav-icon {width:21px!important;height:23px!important;}
  .bottom-nav .nav-icon svg {width:20px;height:20px;}
}
@media (max-width:345px) {
  .bottom-nav .nav-item span:last-child {font-size:7.5px!important;letter-spacing:-.025em;}
  .bottom-nav .nav-icon svg {width:19px;height:19px;}
}

.stock-page {color:var(--text); min-width:0; padding-bottom:10px;}
.stock-page .catalog-title {padding-bottom:16px;}
.stock-toolbar {
  display:flex;flex-wrap:wrap;align-items:stretch;gap:10px;
  margin:10px 0 22px;min-width:0;
}
.stock-chips {display:flex;flex:0 1 auto;align-items:center;gap:7px;flex-wrap:wrap;}
.stock-chip {
  display:inline-flex;align-items:center;justify-content:center;
  min-height:46px;padding:0 15px;
  border:1px solid #dfe5ed;border-radius:13px;
  background:#fff;color:#394351;
  font-size:12px;font-weight:760;line-height:1.2;
  cursor:pointer;transition:border-color .16s ease,background .16s ease,color .16s ease;
}
.stock-chip:hover {background:#f0f5fc;border-color:#b8d0ed;}
.stock-chip.is-selected {background:var(--accent);color:#fff;border-color:var(--accent);}
.stock-chip:focus-visible,.stock-search-form input:focus-visible,
.stock-search-form button:focus-visible,
.stock-pagination button:focus-visible {
  outline:2px solid var(--accent);outline-offset:3px;
}
.stock-search-form {
  display:flex;flex:1 1 245px;min-width:0;gap:8px;
}
.stock-search-form input {
  min-width:0;min-height:46px;border:1px solid #dfe5ed;border-radius:13px;
  background:#fff;color:var(--text);padding:0 13px;
  font:inherit;font-size:13px;
  box-shadow:0 7px 17px rgba(34,43,57,.035);
}
.stock-search-form input {flex:1 1 auto;width:100%;}
.stock-search-form input::placeholder {color:#969da8;}
.stock-search-form input:focus {
  border-color:#94b7e5;box-shadow:0 0 0 3px rgba(0,71,160,.075);outline:0;
}
.stock-search-form button {
  flex:0 0 auto;min-height:46px;padding:0 16px;
  border:0;border-radius:13px;background:var(--accent);color:#fff;
  font-weight:790;font-size:12px;cursor:pointer;
}
.stock-search-form button:hover {background:#125bb4;}
/* Reuse catalogue's trigger, menu, options and typography for sort. */
.stock-page .stock-results-toolbar {
  position:relative;z-index:18;
  margin:7px 2px 15px;align-items:center;
  flex-wrap:wrap;gap:10px 16px;
  overflow:visible;
}
.stock-results-caption {min-width:0;flex:1 1 160px;}
.stock-results-toolbar strong {color:var(--text);}
.stock-results-toolbar .stock-results-caption > span {color:var(--muted);}
.stock-results-sort {margin-left:auto;flex:0 0 auto;}
.stock-results-toolbar .catalog-sort-caption {
  color:#7b848f;font-size:12px;font-weight:660;white-space:nowrap;
}
.stock-results-toolbar .catalog-sort-trigger > span {
  color:#313946!important;font-size:12px!important;
}
.stock-results-toolbar .catalog-sort-trigger {cursor:pointer;}
.stock-results-toolbar .catalog-sort-option {cursor:pointer;}
.stock-results-toolbar .catalog-sort-menu {z-index:85;}

/* A stock card is a regular vehicle-card: same grid, cover, media ratio,
   typography, spec chips and price preview as the Korean catalogue. */
.stock-grid {margin:0;}
.stock-car {position:relative;min-width:0;cursor:pointer;}
.stock-car:focus-visible {outline:3px solid var(--accent);outline-offset:3px;}
.stock-car .vehicle-media {cursor:pointer;}
.stock-car .vehicle-media-label {top:10px;bottom:auto;left:10px;}
.stock-car .vehicle-trim {min-height:13px;}
.stock-car .spec-row {margin-top:12px;}
.stock-car .stock-card-price {margin-top:13px;}
.stock-car .stock-card-price .svh-preview-value {overflow-wrap:anywhere;white-space:normal;}
.stock-state {
  padding:46px 20px;margin-top:12px;
  color:var(--muted);text-align:center;font-size:13px;line-height:1.6;
  background:rgba(255,255,255,.62);border:1px dashed var(--line-strong);
  border-radius:24px;
}
.stock-state button {margin-top:13px;}
.stock-pagination {margin:25px 0 8px;}

/* Stock detail: one stationary media surface instead of the old image-derived
   blurred pseudo-layer. On desktop only the information pane scrolls; on
   mobile the whole detail continues to scroll naturally. */
#stockVehicleView.stock-detail-view {z-index:1300;background:var(--bg);}
#stockVehicleContent {width:100%;min-width:0;}
.stock-detail-view .stock-detail-hero,
.stock-detail-view .stock-detail-gallery,
.stock-detail-view .stock-photo-slide {background:#e9edf2;}
.stock-detail-view .stock-detail-gallery {
  width:100%;overflow-x:auto;scrollbar-width:none;
  scroll-snap-type:x mandatory;touch-action:pan-x pan-y pinch-zoom;
}
.stock-detail-view .stock-photo-slide {
  position:relative;flex:0 0 100%;width:100%;min-width:0;
  height:100%;overflow:hidden;
  scroll-snap-align:center;
}
.stock-detail-view .stock-photo-slide > img {
  position:relative;display:block;
  width:100%;height:100%;min-height:0;max-height:none;
  aspect-ratio:auto;object-fit:contain!important;
  object-position:center!important;background:transparent!important;
  cursor:zoom-in;
}
.stock-detail-view .stock-photo-slide > img:focus-visible {
  outline:3px solid var(--accent);outline-offset:-4px;
}
.stock-detail-view .stock-photo-slide .media-placeholder {
  display:grid;place-items:center;
  width:100%;height:100%;min-height:290px;
  background:transparent;color:#687382;
}
.stock-detail-view .stock-detail-hero .detail-hero-shade {display:none!important;}
.stock-detail-view .detail-toolbar {justify-content:flex-start;}
.stock-detail-view .detail-toolbar button,
.stock-detail-view .detail-desktop-gallery-controls button,
#stockPhotoViewer .photo-viewer-close,
#stockPhotoViewer .photo-viewer-desktop-controls button {
  display:grid!important;place-items:center!important;
  padding:0!important;line-height:0!important;
}
.stock-detail-view .detail-toolbar .ui-control-icon,
.stock-detail-view .detail-desktop-gallery-controls .ui-control-icon,
#stockPhotoViewer .ui-control-icon {
  display:block;width:24px;height:24px;
  min-width:24px;min-height:24px;margin:0;
}
.stock-detail-view .detail-hero-shade {pointer-events:none;}
.stock-detail-view .detail-desktop-gallery-controls {z-index:14;}
.stock-detail-view .detail-metric-icon svg {width:19px;height:19px;}
.stock-detail-view .detail-metric strong {white-space:normal;overflow-wrap:anywhere;}
.stock-detail-body {padding-bottom:calc(30px + var(--safe-bottom));}
.stock-detail-price {min-width:0;}
.stock-detail-price .svh-preview-value {white-space:normal!important;overflow-wrap:anywhere;}
.stock-description {
  padding:16px 17px;border:1px solid var(--line);border-radius:18px;
  background:linear-gradient(145deg,#fff,#f7f8fa);
  color:var(--text);font-size:13px;line-height:1.65;
  white-space:pre-line;overflow-wrap:anywhere;
}
.stock-detail-actions {margin-bottom:24px;}
.stock-contact {
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;min-height:50px;margin-top:12px;
  border:0;border-radius:14px;padding:13px 17px;
  background:var(--accent);color:#fff!important;
  text-decoration:none;font-weight:800;font-size:13px;
  transition:background .16s ease,transform .16s ease;
}
.stock-contact:hover {background:#125bb4;}
.stock-contact:active {transform:scale(.99);}
.stock-contact:focus-visible {outline:3px solid var(--accent);outline-offset:3px;}
.stock-source-note {color:var(--muted);font-size:11px;line-height:1.5;margin:12px 1px 0;}

@media (min-width:900px) {
  .stock-toolbar {margin:13px 0 25px;gap:12px;}
  .stock-chip,.stock-search-form input,.stock-search-form button {
    min-height:50px;font-size:13px;border-radius:14px;
  }
  .stock-search-form input {font-size:14px;}
  .stock-car .vehicle-media-label {top:12px;left:12px;}

  /* Give the stock detail two independent columns. Scrolling the right-hand
     content no longer repositions or repaints anything behind the photo. */
  #stockVehicleView.stock-detail-view {
    position:fixed;inset:0;display:block;
    overflow:hidden;
    padding:28px 28px 32px!important;
    background:rgba(30,37,49,.58);backdrop-filter:blur(9px);
    scroll-behavior:auto;
  }
  #stockVehicleContent {
    width:100%;height:100%;max-width:1320px;
    margin:0 auto;overflow:visible;
  }
  #stockVehicleContent>.stock-detail-shell {
    width:100%!important;max-width:1320px!important;
    height:100%;min-height:0;max-height:100%;
    margin:0 auto!important;
    grid-template-rows:minmax(0,1fr);
    align-items:stretch;overflow:hidden;
  }
  .stock-detail-view .stock-detail-hero {
    position:relative;top:auto;align-self:stretch;
    height:100%;min-height:0;
    overflow:hidden;
  }
  .stock-detail-view .stock-detail-gallery,
  .stock-detail-view .stock-photo-slide {height:100%;min-height:0;}
  .stock-detail-view .stock-detail-body {
    height:100%;min-height:0;
    overflow-y:auto;overflow-x:hidden;
    overscroll-behavior-y:contain;
    scrollbar-width:thin;
    scrollbar-color:#c9d1dc transparent;
    padding-bottom:46px;
  }
  .stock-detail-view .stock-detail-body::-webkit-scrollbar {width:8px;}
  .stock-detail-view .stock-detail-body::-webkit-scrollbar-thumb {
    background:#c9d1dc;border-radius:12px;
  }
}
@media (min-width:900px) and (max-width:1199px) {
  #stockVehicleView.stock-detail-view {padding:16px 18px 22px!important;}
}
@media (max-width:899px) {
  #stockVehicleView.stock-detail-view {padding:0!important;}
  #stockVehicleContent>.detail-shell {width:100%;margin:0!important;max-width:none!important;}
  .stock-detail-view .stock-detail-gallery {height:clamp(290px,90vw,390px);}
  .stock-detail-view .stock-photo-slide {height:100%;}
  .stock-detail-price {margin-top:0;}
  .stock-detail-price .svh-preview-value {font-size:25px;}
  .stock-detail-body {padding-bottom:calc(24px + var(--safe-bottom));}
}
@media (max-width:599px) {
  .stock-toolbar {margin:9px 0 19px;gap:9px;}
  .stock-chips {width:100%;flex-wrap:nowrap;}
  .stock-chip {min-height:42px;flex:1 1 auto;padding:0 9px;font-size:11px;}
  .stock-search-form {flex:1 1 100%;}
  .stock-search-form input {font-size:16px!important;}
  .stock-search-form button {min-width:70px;}
  .stock-results-sort {justify-content:space-between;width:100%;}
  .stock-results-toolbar .catalog-sort-control {flex:0 1 auto;}
  .stock-results-toolbar .catalog-sort-trigger {min-width:155px;}
  .stock-car .vehicle-trim {min-height:0;}
  .stock-detail-price .svh-preview-value {font-size:23px;}
}
@media (max-width:380px) {
  .stock-detail-view .gallery-progress {bottom:44px;}
}
@media (prefers-reduced-motion:reduce) {
  .stock-car,.stock-contact {transition:none;}
  .stock-detail-view .detail-gallery {scroll-behavior:auto;}
}

/* Stock action: a real 24×24 vector car icon, not a platform emoji. */
.chat-stock-quick {display:flex;justify-content:flex-start;padding:0 2px 12px;}
.chat-stock-quick button,.chat-stock-all {
  border:1px solid rgba(0,71,160,.16);border-radius:12px;
  background:var(--accent-soft);color:#064a98;cursor:pointer;
  font-size:12px;font-weight:800;padding:10px 13px;min-height:40px;
}
.chat-stock-quick button {
  display:inline-flex;align-items:center;justify-content:center;
  gap:9px;text-align:left;
}
.chat-stock-quick-icon {display:block;width:19px;height:19px;flex:0 0 19px;}
.chat-stock-quick button:focus-visible,.chat-stock-all:focus-visible,
.chat-stock-card:focus-visible {outline:2px solid var(--accent);outline-offset:3px;}
.chat-stock-quick button:hover,.chat-stock-all:hover {border-color:var(--accent);}
.chat-stock-card {cursor:pointer;}
.chat-stock-card .chat-vehicle-meta {margin:12px 0 0;}
.chat-stock-all {width:100%;margin-top:13px;text-align:center;}
@media (min-width:900px) {.chat-stock-quick button {font-size:13px;padding:10px 15px;}}

/* Inventory offers inside the AI carousel use the same caption/value rhythm
   as the Encar AI card's existing SVH price preview. */
.chat-stock-card .chat-stock-price {
  display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;
  gap:5px 10px;margin-top:13px;padding-top:12px;
  border-top:1px solid rgba(36,47,58,.085);
  color:#212833;font-size:16px;line-height:1.2;
  font-weight:850;letter-spacing:-.025em;
  font-variant-numeric:tabular-nums;
}
.chat-stock-card .chat-stock-price::before {
  content:'Цена в Беларуси';color:#787f8b;
  font-size:10px;font-weight:590;line-height:1.4;letter-spacing:0;
}
@media (max-width:599px) {
  .chat-stock-card .chat-stock-price {align-items:flex-start;flex-direction:column;}
}
@media (min-width:900px) {
  .chat-stock-card .chat-stock-price {font-size:18px;}
  .chat-stock-card .chat-stock-price::before {font-size:11px;}
}

/* Stock gallery and compact cards — 2026-11-09. */
.stock-car > .stock-car-info { display:flex; flex:1 1 auto; flex-direction:column; height:auto; min-height:0; }
.stock-car .stock-card-price { margin-top:auto; flex:0 0 auto; min-height:0; align-content:normal; }
.stock-car .stock-card-open { flex:0 0 auto; }
.stock-car .stock-card-price strong { max-width:100%; overflow-wrap:anywhere; white-space:normal; }
.chat-stock-card .chat-stock-price { flex:0 0 auto; margin-top:auto; }
.stock-detail-view .detail-hero-shade { display:none!important; }
.stock-detail-view .stock-detail-hero,
.stock-detail-view .stock-detail-gallery,
.stock-detail-view .stock-detail-gallery img { background:#e9edf2; }
.stock-detail-view .stock-detail-gallery img { object-fit:contain!important; }
.stock-detail-view .stock-detail-gallery img:focus-visible { outline:3px solid var(--accent); outline-offset:-4px; }
@media (min-width:900px) {
  #stockVehicleView.stock-detail-view {
    position:fixed; inset:0; display:block; overflow:hidden;
    padding:28px 28px 32px!important; background:rgba(30,37,49,.58);
  }
  #stockVehicleContent { height:100%; max-width:1320px; margin:0 auto; overflow:hidden; }
  #stockVehicleContent > .stock-detail-shell {
    width:100%!important; max-width:1320px!important;
    height:100%; max-height:100%; min-height:0; margin:0 auto!important;
    grid-template-rows:minmax(0,1fr); align-items:stretch; overflow:hidden;
  }
  .stock-detail-view .stock-detail-hero {
    position:relative; top:auto; align-self:stretch; min-height:0; height:100%;
    overflow:hidden; background:#e9edf2;
  }
  .stock-detail-view .stock-detail-gallery { height:100%; overflow-x:auto; }
  .stock-detail-view .stock-detail-gallery img,
  .stock-detail-view .stock-detail-gallery .media-placeholder {
    height:100%; max-height:none; aspect-ratio:auto;
    object-fit:contain!important; background:#e9edf2;
  }
  .stock-detail-view .stock-detail-body {
    min-height:0; height:100%; max-height:100%; overflow-y:auto;
    overscroll-behavior:contain; scrollbar-gutter:stable;
    -webkit-overflow-scrolling:touch;
  }
}

/* Official NBRB estimate, visually secondary to the BYN selling price. */
.stock-usd-price {
  display:block;
  margin-top:5px;
  font-size:12px;
  line-height:1.38;
  font-weight:650;
  letter-spacing:0;
  color:#64748b;
  font-variant-numeric:tabular-nums;
}
.stock-card-price .stock-usd-price {font-size:12px;}
.stock-detail-price .stock-usd-price {font-size:14px;margin-top:7px;}
.chat-stock-usd {
  margin-top:5px;
  font-size:12px;
  color:#68798b;
  font-weight:650;
}
@media (max-width:599px) {
  .stock-detail-price .stock-usd-price {font-size:13px;}
}

/* Fix 2026-11-20: USD MUST sit directly below BYN, right-aligned.
   The shared .svh-preview uses wrapping flex; that can put USD under the
   left-hand "Цена в Беларуси" caption instead of under the main number. */
.stock-car .stock-card-price {
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,auto);
  align-items:baseline;
  gap:4px 10px;
}
.stock-car .stock-card-price .svh-preview-label {grid-column:1;grid-row:1;align-self:baseline;}
.stock-car .stock-card-price .svh-preview-value {
  grid-column:2;grid-row:1;text-align:right;justify-self:end;
}
.stock-car .stock-card-price .stock-usd-price {
  grid-column:2;grid-row:2;justify-self:end;text-align:right;
  color:#677587;font-size:12px;font-weight:650;line-height:1.3;
  margin:0;
}
.stock-detail-price .stock-usd-price {text-align:right;}
.chat-stock-card .chat-stock-usd {text-align:right;min-height:16px;}
@media (max-width:899px) {
  .stock-detail-price .stock-usd-price {text-align:left;}
}
@media (max-width:400px) {
  .stock-car .stock-card-price {column-gap:6px;}
  .stock-car .stock-card-price .stock-usd-price {font-size:11px;}
}
