/* БРИВЕР 5.0.3.13 — карточки, плавные галереи и сохранённое разговорного поиска */

.property-results--detail .property-results__grid {
  grid-template-columns: minmax(0, 1fr);
}

.property-card--detail .property-card__full {
  max-height: none;
}

.property-card--detail .property-card__description {
  white-space: pre-line;
}

.property-card__detail-link {
  color: inherit;
  text-decoration: none;
}

.property-card__detail-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.property-card__detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin: 18px 0;
  font-size: 13px;
}

.property-card__detail-facts dt { color: var(--muted); }
.property-card__detail-facts dd { margin: 4px 0 0; font-weight: 650; }

.message-row--properties {
  align-items: flex-start;
}

.message-row--properties .message-body {
  width: min(100% - 54px, 820px);
  max-width: 820px;
}

.message.is-searching {
  color: var(--muted);
}

.message.is-searching::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: searchPulse 1s ease-in-out infinite alternate;
}

.property-results {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.property-results__summary {
  scroll-margin-top: 118px;
  padding: 19px 20px 18px;
  border: 1px solid rgba(23, 25, 29, 0.15);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 34px rgba(32, 29, 24, 0.075);
}

.property-results__summary-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.property-results__summary-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  display: grid;
  place-items: center;
}

.property-results__summary-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.property-results__summary-copy {
  min-width: 0;
}

.property-results__label {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.property-results__count {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(22px, 3.2vw, 28px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.property-results__conditions {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.property-results__status {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.property-results__note {
  margin: 0;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  line-height: 1.55;
}

.property-results__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 13px;
}

.property-results__grid:empty {
  display: none;
}

.property-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 34px rgba(32, 29, 24, 0.08);
  scroll-margin-top: 112px;
  transition: opacity 260ms ease, box-shadow 260ms ease, transform 260ms ease;
}

.property-card__full {
  max-height: 900px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 360ms ease, opacity 220ms ease;
}

.property-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  color: var(--muted);
  background: #dedbd5;
}

.property-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-carousel {
  overflow: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.photo-carousel__slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition: none;
  will-change: transform;
  -webkit-user-drag: none;
}

.photo-carousel__slide--support {
  z-index: 0;
  pointer-events: none;
}

.photo-carousel.is-animating .photo-carousel__slide {
  transition: transform 300ms cubic-bezier(0.22, 0.72, 0.24, 1);
}

.photo-carousel.is-dragging {
  cursor: grabbing;
}

.property-card__media .photo-carousel__slide--current {
  scale: 1;
  transition: scale var(--normal);
}

.property-card:hover .property-card__media:not(.is-dragging, .is-animating) .photo-carousel__slide--current {
  scale: 1.025;
}

.property-card__media.is-animating .photo-carousel__slide {
  transition:
    transform 300ms cubic-bezier(0.22, 0.72, 0.24, 1),
    scale var(--normal);
}

.property-card__media.is-dragging .photo-carousel__slide--current,
.property-card__media.is-animating .photo-carousel__slide--current {
  scale: 1;
}

.property-card__media--empty {
  padding: 18px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
}

.property-card__photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  color: var(--white);
  background: rgba(23, 25, 29, 0.76);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.property-card__gallery-button {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(23, 25, 29, 0.68);
  box-shadow: 0 8px 24px rgba(23, 25, 29, 0.18);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.property-card__gallery-button--previous { left: 10px; }
.property-card__gallery-button--next { right: 10px; }

.property-card__media img[role="button"] { cursor: zoom-in; }

.property-card__content {
  position: relative;
  padding: 16px;
  display: grid;
  gap: 9px;
}

.property-card__heading {
  min-width: 0;
  padding-right: 84px;
  display: grid;
  gap: 4px;
}

.property-card__quick-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}

.property-card__icon-action {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #666b72;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 16px rgba(32, 29, 24, 0.06);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color var(--fast), border-color var(--fast), background var(--fast), transform var(--fast);
}

.property-card__icon-action:hover {
  color: var(--ink);
  border-color: rgba(var(--ink-rgb), 0.28);
  transform: translateY(-1px);
}

.property-card__icon-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.property-card__icon-action--save.is-active {
  color: #4d805f;
  border-color: rgba(67, 165, 108, 0.34);
  background: rgba(67, 165, 108, 0.1);
}

.property-card__icon-action--save.is-active svg {
  fill: currentColor;
}

.property-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.property-card__price {
  color: var(--accent);
  font-size: 20px;
  line-height: 1.2;
}

.property-card__facts,
.property-card__address,
.property-card__description {
  margin: 0;
}

.property-card__facts {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.property-card__address {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.property-card__details {
  font-size: 12px;
}

.property-card__details-toggle {
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.property-card__description {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-line;
}

.property-card__footer {
  padding-top: 4px;
  display: grid;
  gap: 10px;
}

.property-card__rejected-summary {
  max-height: 0;
  padding: 0 16px;
  overflow: hidden;
  opacity: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 14px;
  transition: max-height 320ms ease, padding 320ms ease, opacity 180ms ease 80ms;
}

.property-card__rejected-address {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-card__rejected-heading {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.property-card__rejected-price {
  color: var(--ink);
  font-size: 17px;
}

.property-card__rejected-facts {
  color: var(--muted);
  font-size: 11px;
}

.property-card__restore {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(var(--ink-rgb), 0.18);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.property-card.is-rejected {
  opacity: 0.58;
  box-shadow: 0 6px 20px rgba(32, 29, 24, 0.045);
}

.property-card.is-rejected .property-card__full {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.property-card.is-rejected .property-card__rejected-summary {
  max-height: 180px;
  padding: 14px 16px;
  opacity: 1;
}

.property-results__toolbar {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}

.property-results__save {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.property-results__save svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  transition: fill var(--fast);
}

.property-results__save.is-active {
  border-color: rgba(45, 122, 85, 0.38);
  color: var(--success);
}

.property-results__save.is-active svg {
  fill: currentColor;
}

.property-gallery {
  width: min(1120px, calc(100vw - 28px));
  height: min(820px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  color: #fff;
  background: #121315;
}

.property-gallery::backdrop {
  background: rgba(12, 13, 15, 0.84);
  backdrop-filter: blur(8px);
}

.property-gallery__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.property-gallery__stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.property-gallery__close,
.property-gallery__previous,
.property-gallery__next {
  position: absolute;
  z-index: 2;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(23, 25, 29, 0.72);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.property-gallery__close {
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  font-size: 30px;
}

.property-gallery__previous,
.property-gallery__next {
  top: 50%;
  width: 48px;
  height: 48px;
  font-size: 34px;
  transform: translateY(-50%);
}

.property-gallery__previous { left: 14px; }
.property-gallery__next { right: 14px; }

.property-gallery__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  z-index: 2;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(23, 25, 29, 0.72);
  font-size: 12px;
  font-weight: 750;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

.property-card__source {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-results__more {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  color: var(--white);
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  text-decoration: none;
  transition: transform var(--fast), background var(--fast);
}

.property-results__more {
  width: 100%;
  padding: 0 18px;
  font-size: 14px;
}

.property-results__more:hover {
  background: #bd2f20;
  transform: translateY(-1px);
}

.property-card__contact-block,
.property-card__contact-info {
  display: grid;
  gap: 10px;
}

.property-card__contact-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.property-card__contact-qr {
  display: grid;
  scroll-margin-block: 110px calc(var(--composer-height, 72px) + 36px);
  width: 99px;
  margin: 0;
  justify-items: center;
  gap: 6px;
  text-align: center;
  color: var(--muted-soft);
  font-size: 11px;
  line-height: 1.4;
  text-decoration: none;
}

.property-card__contact-qr svg {
  display: block;
  width: 99px;
  height: 99px;
  background: #fff;
  stroke: none;
  stroke-width: 0;
}

.property-card--detail .property-card__contact-qr,
.property-card--detail .property-card__contact-qr svg {
  width: 132px;
}

.property-card--detail .property-card__contact-qr svg {
  height: 132px;
}

/* Shared icon styles must not add strokes, fill or clipping to QR modules. */
.property-card .property-card__contact-qr svg,
.property-card .property-card__contact-qr svg * {
  stroke: none;
  stroke-width: 0;
}

.property-card .property-card__contact-qr svg rect { fill: #fff; }
.property-card .property-card__contact-qr svg path { fill: #000; }

.property-card__contact-block--qr {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.property-card__contact-actions {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.property-card__contact-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #70757c;
  border-radius: 13px;
  color: #fff;
  background: #70757c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
}

.property-card__contact-button:hover {
  border-color: #5f646b;
  background: #5f646b;
  transform: translateY(-1px);
}

.property-card__contact-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.property-card__desktop-phone {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.property-card__details-toggle:focus-visible,
.property-card__gallery-button:focus-visible,
.property-card__icon-action:focus-visible,
.property-card__restore:focus-visible,
.property-results__save:focus-visible,
.property-card__contact-button:focus-visible,
.property-card__desktop-phone:focus-visible,
.property-card__contact-qr:focus-visible,
.property-results__more:focus-visible,
.property-gallery button:focus-visible {
  outline: 3px solid rgba(216, 59, 38, 0.28);
  outline-offset: 3px;
}

@media (hover: none) and (pointer: coarse) {
  .property-card__contact-actions {
    display: grid;
  }

  .property-card__desktop-phone {
    display: none;
  }
  .property-card__contact-qr { display: none; }
  .property-card__contact-block--qr { grid-template-columns: minmax(0, 1fr); }
}

.property-results__more:disabled {
  opacity: 0.62;
  cursor: wait;
  transform: none;
}

@keyframes searchPulse {
  from { opacity: 0.3; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 680px) {
  .property-card__contact-qr { display: none; }
  .property-card__contact-block--qr { grid-template-columns: minmax(0, 1fr); }

  .message-row--properties .message-avatar {
    display: none;
  }

  .message-row--properties .message-body {
    width: 100%;
    max-width: 100%;
  }

  .property-results__grid {
    grid-template-columns: 1fr;
  }

  .property-results__summary {
    scroll-margin-top: 14px;
    padding: 17px 16px 16px;
    border-radius: 18px;
  }

  .property-results__conditions {
    font-size: 13px;
  }

  .property-card__gallery-button {
    width: 34px;
    height: 34px;
  }

  .property-gallery {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

@media (max-width: 390px) {
  .property-card__content {
    padding: 14px;
  }

  .property-card__contact-button {
    padding: 0 8px;
    font-size: 11px;
  }
}
