/* Карточка объявления — структура как на Авито */

.listing-avito {
  max-width: 1100px;
}

.listing-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 13px;
  color: #757575;
}

.listing-crumb a {
  color: #757575;
  text-decoration: none;
}

.listing-crumb a:hover {
  color: #00aaff;
}

.listing-crumb__sep {
  opacity: 0.5;
}

.listing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.listing-head__title {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.25;
  flex: 1 1 280px;
  max-width: 640px;
}

.listing-head__price-wrap {
  text-align: right;
  flex: 0 0 auto;
}

.listing-head__price {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  white-space: nowrap;
}

.listing-head__price-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: #71717a;
}

@media (max-width: 900px) {
  .listing-head__price--mobile-hide {
    display: none;
  }
}

.listing-avito__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px 28px;
  align-items: start;
}

@media (max-width: 900px) {
  .listing-avito__grid {
    grid-template-columns: 1fr;
  }
  .listing-head__price-wrap {
    text-align: left;
    width: 100%;
  }
  .listing-aside {
    order: 2;
  }
  .listing-main {
    order: 1;
  }
}

.listing-gallery-main {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
  line-height: 0;
}

.listing-gallery-main--nav .listing-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  font-size: 28px;
  line-height: 1;
  color: #111;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.listing-gallery-main--nav .listing-gallery__arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}

.listing-gallery__arrow--prev {
  left: 12px;
}

.listing-gallery__arrow--next {
  right: 12px;
}

.listing-gallery__counter {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
}

.listing-gallery-main img {
  width: 100%;
  max-height: 520px;
  min-height: 280px;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}

body.listing-lightbox-open {
  overflow: hidden;
}

body.listing-lightbox-open .listing-gallery__arrow,
body.listing-lightbox-open .listing-gallery__counter {
  visibility: hidden;
  pointer-events: none;
}

.listing-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-items: center;
  padding: 16px 8px;
  box-sizing: border-box;
  pointer-events: none;
}

.listing-lightbox[hidden] {
  display: none !important;
}

.listing-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
  pointer-events: auto;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  z-index: 0;
}

.listing-lightbox__stage {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: min(1200px, 92vw);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.listing-lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #111;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.listing-lightbox__img--loading {
  opacity: 0.4;
}

.listing-lightbox__close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.listing-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.listing-lightbox__arrow {
  position: relative;
  z-index: 3;
  align-self: center;
  grid-row: 1;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transform: none;
}

.listing-lightbox__arrow--prev {
  grid-column: 1;
}

.listing-lightbox__arrow--next {
  grid-column: 3;
}

.listing-lightbox__counter {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  margin: 8px 0 0;
  z-index: 3;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}

.listing-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.listing-gallery-thumbs__btn {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.listing-gallery-thumbs__btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.listing-gallery-thumbs__btn img.irr-photo--placeholder {
  object-fit: contain;
  background: #fff;
}

.listing-gallery-thumbs__btn.is-active {
  border-color: #00aaff;
}

.listing-block {
  margin-top: 28px;
}

.listing-block__title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
}

.listing-attrs--avito {
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 0;
}

@media (min-width: 640px) {
  .listing-attrs--avito {
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
  }
}

.listing-attrs--avito .listing-attrs__row {
  border-bottom: 1px solid #ebebeb;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
  grid-template-columns: 140px 1fr;
}

.listing-attrs--avito .listing-attrs__row:nth-child(odd) {
  background: transparent;
}

@media (min-width: 640px) {
  .listing-attrs--avito .listing-attrs__row:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 12px);
  }
}

.listing-attrs--avito .listing-attrs__vin {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
}

.listing-desc--avito {
  font-size: 15px;
  line-height: 1.55;
  color: #1a1a1a;
  margin: 0;
  white-space: pre-wrap;
}

.listing-location {
  font-size: 15px;
  margin: 0;
}

.listing-location a {
  color: #00aaff;
}

.listing-foot-meta {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #ebebeb;
  font-size: 13px;
  color: #999;
}

/* Боковая колонка */
.listing-vin-check {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f7f9fb;
  border: 1px solid #e8edf2;
  font-size: 13px;
  line-height: 1.45;
}

.listing-vin-check__title {
  margin: 0 0 8px;
  font-weight: 600;
  color: #1a1a1a;
}

.listing-vin-check__summary--ok {
  color: #047857;
  font-weight: 600;
}

.listing-vin-check__summary--warn {
  color: #b45309;
  font-weight: 600;
}

.listing-vin-check__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.listing-vin-check__item {
  margin: 0 0 6px;
  padding-left: 1.1em;
  position: relative;
  color: #333;
}

.listing-vin-check__item::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #999;
}

.listing-vin-check__item--ok::before {
  content: '✓';
  color: #059669;
}

.listing-vin-check__item--error::before {
  content: '!';
  color: #dc2626;
  font-weight: 700;
}

.listing-vin-check__item--warn::before {
  content: '○';
  color: #d97706;
}

.listing-aside {
  position: sticky;
  top: calc(var(--home-topbar-offset, var(--header-h, 64px)) + 10px);
  align-self: start;
  z-index: 5;
}

.listing-aside__card {
  border: 1px solid #ebebeb;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.listing-aside__price {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 14px;
}

.listing-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.listing-btn--call {
  background: #04a446;
  color: #fff;
}

.listing-btn--call:hover {
  background: #038a3a;
  color: #fff;
  text-decoration: none;
}

.listing-btn--msg {
  background: #00aaff;
  color: #fff;
}

.listing-btn--msg:hover {
  background: #0095e0;
  color: #fff;
  text-decoration: none;
}

.listing-phone__revealed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.listing-phone__number {
  display: block;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
}

.listing-phone__number:hover {
  color: #00aaff;
}

.listing-phone__hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #e4002b;
  text-align: center;
}

.listing-chat[hidden] {
  display: none !important;
}

.listing-chat-open {
  overflow: hidden;
}

.listing-chat {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.listing-chat__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.listing-chat__dialog {
  position: relative;
  width: min(440px, 100%);
  max-height: min(90vh, 640px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.listing-chat__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #757575;
  z-index: 1;
}

.listing-chat__head {
  padding: 16px 40px 12px 16px;
  border-bottom: 1px solid #ebebeb;
}

.listing-chat__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.listing-chat__subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: #757575;
}

.listing-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 360px;
  background: #f4f6f8;
}

.listing-chat__dialog--no-compose .listing-chat__messages {
  min-height: 260px;
  max-height: none;
  flex: 1 1 auto;
}

.listing-chat__empty {
  margin: auto;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: #757575;
  max-width: 300px;
}

.listing-chat__state {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  max-width: 300px;
  padding: 8px 4px 16px;
}

.listing-chat__state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}

.listing-chat__state--loading .listing-chat__state-icon {
  background: #e8f4fc;
  color: #00aaff;
}

.listing-chat__state--blocked .listing-chat__state-icon {
  background: #eef0f3;
  color: #5c6570;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
}

.listing-chat__state--error .listing-chat__state-icon {
  background: #ffebee;
  color: #e4002b;
}

.listing-chat__state-title {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

.listing-chat__state-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #757575;
}

.listing-chat__load {
  margin: auto;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.listing-chat__skeleton-bubble {
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    #e8ebef 0%,
    #f3f5f8 45%,
    #e8ebef 90%
  );
  background-size: 200% 100%;
  animation: listing-chat-shimmer 1.2s ease-in-out infinite;
}

.listing-chat__skeleton-bubble--left {
  width: 72%;
  align-self: flex-start;
  border-radius: 14px 14px 14px 4px;
}

.listing-chat__skeleton-bubble--right {
  width: 58%;
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
}

.listing-chat__load-caption {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: #5c6570;
}

@keyframes listing-chat-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.listing-chat__notice {
  margin: auto;
  width: 100%;
  max-width: 320px;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid #e4e8ec;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(10, 10, 11, 0.06);
  text-align: center;
}

.listing-chat__notice--info {
  border-color: #c5e9ff;
  background: linear-gradient(180deg, #f8fcff 0%, #fff 100%);
}

.listing-chat__notice--warn {
  border-color: #ffe0b2;
  background: linear-gradient(180deg, #fffaf3 0%, #fff 100%);
}

.listing-chat__notice-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 800;
  color: #1a1a1a;
}

.listing-chat__notice-text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #5c6570;
}

.listing-chat__notice-text strong {
  color: #1a1a1a;
  font-weight: 700;
}

.listing-chat__notice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: #00aaff;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.listing-chat__notice-btn:hover {
  background: #0095e0;
}

.listing-chat__spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0, 170, 255, 0.25);
  border-top-color: #00aaff;
  border-radius: 50%;
  animation: listing-chat-spin 0.7s linear infinite;
}

@keyframes listing-chat-spin {
  to {
    transform: rotate(360deg);
  }
}

.listing-chat__bubble {
  align-self: flex-start;
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  background: #fff;
  border: 1px solid #e8e8e8;
}

.listing-chat__bubble--mine {
  align-self: flex-end;
  background: #e8f7ff;
  border-color: #c5e9ff;
  border-radius: 12px 12px 4px 12px;
}

.listing-chat__bubble-text {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.listing-chat__bubble-time {
  font-size: 11px;
  color: #999;
}

.listing-chat__footer {
  border-top: 1px solid #ebebeb;
  background: #fff;
  padding: 0 16px 16px;
}

.listing-chat__footer.is-hidden,
.listing-chat__footer[aria-hidden='true'] {
  display: none !important;
}

/* старый красный текст под чатом — не показываем */
.listing-chat__error {
  display: none !important;
}

.listing-chat__form-error {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #c62828;
  background: #ffebee;
  border-radius: 8px;
  border: 1px solid #ffcdd2;
}

.listing-chat__form-error[hidden] {
  display: none !important;
}

.listing-chat__footer:not(:has(.listing-chat__form-error:not([hidden]))) .listing-chat__form {
  padding-top: 12px;
}

.listing-chat__form-error:not([hidden]) + .listing-chat__form {
  padding-top: 10px;
}

.listing-chat__form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.listing-chat__form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.listing-chat__form textarea:focus {
  outline: none;
  border-color: #00aaff;
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.12);
}

.listing-chat__send {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #00aaff;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.listing-chat__send:hover {
  background: #0095e0;
}

.listing-seller {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #ebebeb;
}

.listing-seller__ava {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8e986, #6dd400);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.listing-seller__name {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 15px;
}

.listing-seller__meta {
  margin: 0;
  font-size: 13px;
  color: #757575;
  line-height: 1.4;
}

.listing-quick {
  margin-top: 16px;
}

.listing-quick__label {
  margin: 0 0 8px;
  font-size: 13px;
  color: #757575;
}

.listing-quick__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.listing-quick__chip {
  padding: 8px 12px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: #3f3f46;
  cursor: pointer;
}

.listing-quick__chip:hover {
  border-color: #00aaff;
  color: #0077b6;
}

.listing-recs {
  margin-top: 40px;
  padding-top: 8px;
}

.listing-recs__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-bottom: 16px;
}

.listing-recs__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.listing-recs__tabs {
  display: flex;
  gap: 16px;
  font-size: 15px;
}

.listing-recs__tab {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #757575;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
}

.listing-recs__tab.is-active {
  color: #111;
  font-weight: 600;
  border-bottom-color: #111;
}

.listing-recs__more {
  margin-left: auto;
  font-size: 14px;
}

@media (max-width: 900px) {
  .listing-aside__card .listing-aside__price {
    display: none;
  }
}