/* СОСЕДИ Недвижимость — Современный дизайн карточки объекта */

:root {
  --primary: #E9435D;
  --primary-gradient: linear-gradient(135deg, #E9435D 0%, #F4A946 100%);
  --text-main: #111224;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 32px -4px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* Скрытие левого сайдбара каталога на детальной странице объявления для full-width PropTech опыта */
body.page-ad-view .row.middle > .menu.col-1 {
  display: none !important;
}
body.page-ad-view .row.middle > .content.col-2 {
  width: 100% !important;
  float: none !important;
  max-width: 1240px;
  margin: 0 auto !important;
  padding: 0 15px 40px !important;
  box-sizing: border-box;
}

/* Базовый контейнер карточки */
.realty-ad-wrapper {
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  padding-top: 10px;
}

/* Хлебные крошки и панель действий */
.realty-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.realty-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
}
.realty-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.realty-breadcrumbs a:hover {
  color: var(--primary);
}
.realty-breadcrumbs .sep {
  color: #cbd5e1;
}
.realty-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.realty-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s ease;
}
.realty-action-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.realty-action-btn.active {
  color: var(--primary);
  border-color: var(--primary);
  background: #fff5f5;
}
.realty-action-btn.btn-edit {
  background: #f1f5f9;
  color: #334155;
}
.realty-action-btn.btn-delete {
  color: #ef4444;
  border-color: #fecaca;
}
.realty-action-btn.btn-delete:hover {
  background: #fef2f2;
}

/* Заголовок и статусы */
.realty-title-block {
  margin-bottom: 22px;
}
.realty-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.realty-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-deal-sale {
  background: #dbeafe;
  color: #1e40af;
}
.badge-deal-rent {
  background: #fef3c7;
  color: #92400e;
}
.badge-deal-free {
  background: #dcfce7;
  color: #166534;
}
.badge-verified-item {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge-category-tag {
  background: #f1f5f9;
  color: #475569;
}
.realty-main-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin: 0 0 8px 0;
}
.realty-address-line {
  font-size: 15px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.realty-address-line .view-counter {
  margin-left: auto;
  font-size: 13px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Фотогалерея в стиле Airbnb Luxe */
.realty-gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 210px 210px;
  gap: 10px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 30px;
  position: relative;
  background: #f1f5f9;
}
.realty-gallery-item {
  position: relative;
  background: #e2e8f0;
  cursor: pointer;
  overflow: hidden;
}
.realty-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}
.realty-gallery-item:hover img {
  transform: scale(1.03);
}
.realty-gallery-main {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}
/* Если фото меньше 5 */
.realty-gallery-grid.photos-count-1 {
  grid-template-columns: 1fr;
  grid-template-rows: 420px;
}
.realty-gallery-grid.photos-count-2 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 420px;
}
.realty-gallery-grid.photos-count-2 .realty-gallery-main {
  grid-column: auto;
  grid-row: auto;
}
.realty-gallery-grid.photos-count-3 {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 205px 205px;
}
.realty-gallery-grid.photos-count-4 {
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 420px;
}

.realty-all-photos-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(17, 18, 36, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  z-index: 10;
}
.realty-all-photos-btn:hover {
  background: #111224;
}

/* Двухколоночный макет */
.realty-content-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* Карточки секций левой колонки */
.realty-card-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.realty-section-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Быстрые акцентные плашки (Quick highlight pills) */
.realty-quick-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
}
.realty-spec-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, transform 0.15s;
}
.realty-spec-pill:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.realty-spec-icon {
  font-size: 20px;
  margin-bottom: 2px;
}
.realty-spec-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.realty-spec-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

/* Группированные подробные характеристики */
.realty-specs-group {
  margin-bottom: 22px;
}
.realty-specs-group:last-child {
  margin-bottom: 0;
}
.realty-specs-group-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.realty-specs-table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.realty-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed #f1f5f9;
}
.realty-spec-dt {
  color: var(--text-muted);
  font-weight: 400;
}
.realty-spec-dd {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

/* Описание */
.realty-desc-text {
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-line;
}

/* Карта и инфраструктура */
.realty-map-box {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  z-index: 1;
  border: 1px solid var(--border-color);
}
.realty-nearby-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.realty-nearby-tag {
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Ипотечный калькулятор */
.realty-calc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 22px;
}
.realty-calc-row {
  margin-bottom: 18px;
}
.realty-calc-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
}
.realty-calc-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  -webkit-appearance: none;
}
.realty-calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(233, 67, 93, 0.4);
}
.realty-calc-result {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.realty-calc-monthly {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}

/* ПРАВЫЙ ПЛАВАЮЩИЙ САЙДБАР (STICKY SIDEBAR) */
.realty-sticky-card {
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
}
.realty-price-main {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.2;
}
.realty-price-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

/* Профиль продавца */
.realty-seller-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 20px;
}
.realty-seller-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.realty-seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.realty-seller-info h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px 0;
}
.realty-seller-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.realty-badge-owner {
  background: #ecfdf5;
  color: #047857;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
}

/* Кнопки действий (CTA) */
.realty-cta-phone-btn {
  width: 100%;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(233, 67, 93, 0.35);
  transition: all 0.2s ease;
  margin-bottom: 10px;
  text-decoration: none;
  box-sizing: border-box;
}
.realty-cta-phone-btn:hover {
  box-shadow: 0 6px 20px rgba(233, 67, 93, 0.5);
  transform: translateY(-1px);
  color: #fff;
}
.realty-cta-secondary-btn {
  width: 100%;
  background: #f8fafc;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  margin-bottom: 10px;
  text-decoration: none;
  box-sizing: border-box;
}
.realty-cta-secondary-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-main);
}
.realty-safe-deal-note {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  margin-top: 16px;
  line-height: 1.4;
}

/* Вопросы владельцу / Комментарии */
.realty-comments-section {
  margin-top: 10px;
}
.realty-comment-item {
  border-bottom: 1px solid #f1f5f9;
  padding: 14px 0;
}
.realty-comment-item:last-child {
  border-bottom: none;
}
.realty-comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.realty-comment-author {
  font-weight: 700;
  color: var(--text-main);
}
.realty-comment-body {
  font-size: 14px;
  line-height: 1.5;
  color: #334155;
}
.realty-comment-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  min-height: 90px;
  margin-bottom: 12px;
  font-family: inherit;
  box-sizing: border-box;
}
.realty-comment-form textarea:focus {
  border-color: var(--primary);
  outline: none;
}

/* Похожие объекты */
.realty-similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.realty-similar-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.realty-similar-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.realty-similar-thumb {
  height: 140px;
  background: #f1f5f9;
  overflow: hidden;
}
.realty-similar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.realty-similar-body {
  padding: 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.realty-similar-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}
.realty-similar-title {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
  margin-bottom: 6px;
}

/* МОДАЛЬНЫЕ ОКНА (LightBox & Viewing) */
.realty-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 18, 36, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.realty-modal-overlay.active {
  display: flex;
}
.realty-modal-content {
  background: #fff;
  border-radius: var(--radius-md);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.realty-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
  padding: 4px 8px;
}
.realty-modal-close:hover {
  color: #111224;
}

/* Lightbox фото */
.realty-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 20, 0.95);
  z-index: 2200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.realty-lightbox-overlay.active {
  display: flex;
}
.realty-lightbox-stage {
  position: relative;
  max-width: 1100px;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.realty-lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.realty-lightbox-prev,
.realty-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.realty-lightbox-prev { left: -60px; }
.realty-lightbox-next { right: -60px; }
.realty-lightbox-prev:hover,
.realty-lightbox-next:hover {
  background: rgba(255,255,255,0.4);
}
.realty-lightbox-counter {
  color: #cbd5e1;
  font-size: 14px;
  margin-top: 14px;
}
.realty-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: #fff;
  font-size: 36px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

/* Нижняя мобильная плашка */
.realty-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border-color);
  padding: 12px 20px;
  display: none;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.06);
}

/* Адаптивность */
@media (max-width: 992px) {
  .realty-content-layout {
    grid-template-columns: 1fr;
  }
  .realty-gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 280px;
  }
  .realty-gallery-item:not(.realty-gallery-main) {
    display: none;
  }
  .realty-sticky-card {
    position: static;
    margin-bottom: 24px;
  }
  .realty-mobile-bar {
    display: flex;
  }
  .realty-specs-table {
    grid-template-columns: 1fr;
  }
  .realty-lightbox-prev { left: 10px; }
  .realty-lightbox-next { right: 10px; }
}
