/* Desktop comfort scale matches the preferred 125% reference at browser 100%. */
@media (min-width: 1100px) {
  body.catalog-v3-page { zoom: 1.25; }

  /* The whole catalogue is intentionally enlarged to match the approved
     desktop mock-up. Native dialog viewport units are not reduced by CSS
     zoom, so compensate here: 80vh * 1.25 = the real viewport height. */
  body.catalog-v3-page .vehicle-modal,
  body.catalog-v3-page .vehicle-modal__content {
    max-height: calc(80vh - 24px);
  }
}
/* Match the image panel to normal vehicle photography, not a panoramic strip. */
.catalog-v3-page .vehicle-card {
  grid-template-columns: minmax(260px, 29%) minmax(0, 1fr);
  height:auto;
  min-height:240px;
}
.catalog-v3-page .vehicle-photo {
  height:auto;
  min-height:0;
  aspect-ratio:4 / 3;
  align-self:center;
  background:#edf1f3;
}
.catalog-v3-page .vehicle-photo img {
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:contain; object-position:center;
}
@media (max-width:850px) {
  .catalog-v3-page .vehicle-card {grid-template-columns:minmax(220px,36%) minmax(0,1fr)}
}
@media (max-width:620px) {
  .catalog-v3-page .vehicle-card {grid-template-columns:1fr}
  .catalog-v3-page .vehicle-photo {height:auto;min-height:0;aspect-ratio:4 / 3}
}
.catalog-v3-page .vehicle-grid.is-grid .vehicle-photo {height:auto;aspect-ratio:4 / 3}
.catalog-v3-page .vehicle-photo[data-photo-unavailable]::after {content:'Фото недоступно';position:absolute;inset:0;display:grid;place-items:center;color:#72808a;font-size:14px}
.vehicle-gallery__thumb[data-photo-unavailable]::after {content:'Нет фото';color:#627074;font-size:10px}
.vehicle-gallery__pending [data-retry-photo] {padding:10px 14px;border:1px solid #b4c2c6;border-radius:8px;background:white;color:#193c49;cursor:pointer}
.catalog-v3-page .listing-count {display:grid;gap:3px;min-width:0}
.catalog-v3-page .listing-count strong {white-space:normal}

/* Keep the gallery counter independent of the horizontally scrolling
   thumbnail rail. It remains readable with any number of photographs. */
.catalog-v3-page .vehicle-gallery__count {
  top: 30px;
  bottom: auto;
  right: 30px;
  z-index: 4;
}
/* Stable loading layout and removable applied filters. */
.catalog-skeleton{display:flex;gap:24px;padding:20px;margin-bottom:16px;border:1px solid #e1e9ec;border-radius:18px;background:#fff;min-height:210px}
.catalog-skeleton__photo{width:28%;min-width:160px;border-radius:12px;background:#edf3f5}
.catalog-skeleton__body{flex:1;padding:20px 0}
.catalog-skeleton i{display:block;height:18px;width:70%;margin:0 0 22px;border-radius:6px;background:#edf3f5}
.catalog-skeleton i:nth-child(2){width:50%}
.catalog-skeleton i:nth-child(3){width:85%}
.catalog-active-filters{display:flex;gap:8px;flex-wrap:wrap;padding:0 0 18px}
.catalog-active-filters[hidden]{display:none}
.catalog-active-filters button{border:1px solid #d9e7eb;border-radius:20px;padding:7px 12px;background:#f0f8fa;color:#183743;font:inherit;font-size:13px;cursor:pointer}
.catalog-active-filters button:hover{border-color:#06a9b9;background:#e0f6f8}
.catalog-active-filters button span{padding-left:8px;font-size:18px}
.vehicle-grid.is-loading{opacity:.55;pointer-events:none;transition:opacity .15s}
.catalog-error button{margin:10px;border:0;border-radius:8px;background:#10b8c3;color:#fff;padding:10px 16px;font:inherit;cursor:pointer}
.vehicle-grid.is-grid .catalog-skeleton{flex-direction:column}
.vehicle-grid.is-grid .catalog-skeleton__photo{width:100%;min-height:180px}
@media(max-width:650px){.catalog-skeleton{min-height:170px;gap:16px;padding:12px}.catalog-skeleton__photo{min-width:110px}.catalog-skeleton__body{padding:10px 0}.catalog-skeleton i{width:90%}}

/* Searchable, keyboard-friendly brand/model inputs. */
.catalog-input-shell{position:relative;display:block;min-width:0}
.catalog-v3-page .catalog-input-shell input{padding-right:58px;background-image:none;cursor:text}
.catalog-v3-page .catalog-input-shell.has-logo input{padding-left:39px}
.catalog-input-logo{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:24px;height:24px;object-fit:contain;pointer-events:none}
.catalog-input-shell button{position:absolute;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:26px;height:30px;margin:0;padding:0;border:0;border-radius:5px;background:transparent;color:#55717c;font:inherit;font-size:20px;line-height:1;cursor:pointer}
.catalog-input-clear{right:28px}.catalog-input-toggle{right:3px}
.catalog-input-shell button:hover{background:#e5f7f8;color:#087d86}
.catalog-input-shell button:focus-visible{outline:2px solid #0cabb7;outline-offset:1px}
.catalog-input-shell [hidden]{display:none}
.catalog-select-popover{display:flex;flex-direction:column;min-width:0;max-width:none}
.catalog-select-popover__head,.catalog-select-popover__hint{flex-shrink:0}
.catalog-select-popover__list{min-height:0;flex:1;overscroll-behavior:contain;scrollbar-gutter:stable}
.catalog-select-popover__hint{padding:6px 12px;border-top:1px solid #e7eff0;color:#72808a;font:11px/1.4 Inter,sans-serif}
.catalog-select-popover__option.is-active{background:#e5f9fa;color:#087d86;outline:0}
.catalog-select-popover__selected{margin-left:auto;color:#087d86}
.catalog-select-popover__logo{flex-basis:32px;width:32px;height:28px;border-radius:6px;background:#fff}
.catalog-select-popover__logo img{display:block;width:29px;height:24px;object-fit:contain}
.catalog-v3-page .vehicle-body h2{display:flex;align-items:center;gap:9px}
.vehicle-brand-logo{flex:0 0 28px;width:28px;height:28px;object-fit:contain}
.catalog-v3-page .vehicle-spec strong{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
@media(max-width:1100px){.catalog-v3-page .vehicle-spec{display:block}.catalog-v3-page .vehicle-spec span{margin-bottom:3px}}
@media(max-width:720px){
  .catalog-v3-page .vehicle-card{grid-template-columns:1fr}
  .catalog-v3-page .vehicle-photo{width:100%;max-height:350px;aspect-ratio:4/3}
  .catalog-v3-page .vehicle-card__top{grid-template-columns:1fr}
  .catalog-v3-page .vehicle-price__note{text-align:left;max-width:none}
  .catalog-v3-page .vehicle-card__footer{flex-wrap:wrap}
}
@media(max-width:850px){
  .catalog-v3-page .vehicle-detail{grid-template-columns:1fr}
  .catalog-v3-page .vehicle-gallery{padding:18px}
  .catalog-v3-page .vehicle-gallery__main{max-height:48vh;aspect-ratio:4/3}
  .catalog-v3-page .vehicle-info{padding:24px}
  .catalog-v3-page .vehicle-gallery__count{top:26px;right:26px}
}
.vehicle-card[href]{color:inherit;text-decoration:none}
.vehicle-card[href]:focus-visible{outline:3px solid #168dba;outline-offset:3px}
.power-shortcut{border:1px solid #bde5ed;border-radius:6px;background:#e7f8fb;color:#126982;padding:2px 7px;font:600 11px Inter,sans-serif;line-height:16px;cursor:pointer}
.filter-control--power legend{display:flex;align-items:center;justify-content:space-between;gap:6px;width:100%}
#catalog-filters>.filter-control--mileage,#catalog-filters>.filter-control--power,#catalog-filters>.filter-control--body,#catalog-filters>.filter-control--fuel{grid-column:span 4}
@media(max-width:1380px){#catalog-filters>.filter-control--mileage,#catalog-filters>.filter-control--power,#catalog-filters>.filter-control--body,#catalog-filters>.filter-control--fuel{grid-column:span 2}}
@media(max-width:820px){#catalog-filters>.filter-control--mileage,#catalog-filters>.filter-control--power,#catalog-filters>.filter-control--body,#catalog-filters>.filter-control--fuel{grid-column:span 1}}
