/* ============================================================
   Object Detail Page — object.css
   ============================================================ */

/* Loading */
.object-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding-top: 80px;
  gap: 16px;
  color: var(--gray-500);
  font-family: var(--font);
}
.object-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.object-error {
  padding: 120px 0 80px;
  text-align: center;
  font-family: var(--font);
}

/* Breadcrumb */
.object-breadcrumb {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  padding: 12px 0;
  font-family: var(--font);
  font-size: 13px;
}
.object-breadcrumb a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.object-breadcrumb a:hover { text-decoration: underline; }
.object-breadcrumb span {
  color: var(--gray-400);
  margin-left: 8px;
}

/* Main layout */
.object-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .object-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Info column */
.object-info { order: 1; }
.object-gallery { order: 2; }

@media (max-width: 900px) {
  .object-info { order: 2; }
  .object-gallery { order: 1; }
}

/* Badge */
.object-badge {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin-bottom: 12px;
}
.object-badge__item {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  font-family: var(--font);
}
.object-badge__sep {
  color: var(--gray-300);
  font-size: 11px;
}
.object-badge__exclusive {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #B45309;          /* warning-700 */
  background: #FEF3C7;     /* warning-100 */
  border: 1px solid #FDE68A;
  border-radius: 999px;
  font-family: var(--font);
}
.object-badge__exclusive svg {
  flex-shrink: 0;
}

/* Amenities pills */
.object-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 900px;
}
.amenity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(205, 35, 35, 0.06);
  color: #CD2323;
  border: 1px solid rgba(205, 35, 35, 0.18);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}
.amenity-pill svg { flex-shrink: 0; }

/* Title */
.object-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.2;
  margin: 0 0 8px;
  font-family: var(--font);
}

.object-address {
  font-size: 14px;
  color: var(--gray-500);
  margin: 0 0 24px;
  font-family: var(--font);
}

/* Specs grid */
.object-specs-grid {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  font-family: var(--font);
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.spec-row:last-child { border-bottom: none; }
.spec-row:nth-child(even) { background: var(--gray-50); }
.spec-label {
  color: var(--gray-500);
  font-weight: 500;
  flex-shrink: 0;
}
.spec-value {
  color: var(--gray-800);
  font-weight: 600;
  text-align: right;
}

/* Price block */
.object-price-block {
  margin-bottom: 28px;
}
.price-main {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.15;
  font-family: var(--font);
}
.price-sub {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-500);
  margin-top: 4px;
  font-family: var(--font);
}

/* CTA */
.object-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.object-cta .btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* ============================================================
   Gallery
   ============================================================ */
.object-gallery__main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-100);
  aspect-ratio: 4/3;
  cursor: zoom-in;
}
.object-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.object-gallery__main:hover img {
  transform: scale(1.02);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
  padding: 0;
}
.object-gallery__main:hover .gallery-nav { opacity: 1; }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-nav:hover { background: rgba(0, 0, 0, 0.72); }

.gallery-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  pointer-events: none;
  font-family: var(--font);
}

/* Thumbnails */
.object-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
  margin-top: 10px;
  max-height: 160px;
  overflow-y: auto;
}
.obj-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s, transform 0.15s;
  border: 2px solid transparent;
}
.obj-thumb:hover { opacity: 0.9; transform: scale(1.04); }
.obj-thumb.active {
  opacity: 1;
  border-color: var(--brand);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}
.lightbox__close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox__prev { left: 20px; }
.lightbox__next { right: 20px; }
.lightbox__counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-family: var(--font);
}

/* ============================================================
   Расширенные секции карточки объекта
   ============================================================ */

.object-section {
  padding: 48px 0;
  border-top: 1px solid var(--neutral-200, #e5e5e5);
}
.object-section:first-of-type { border-top: none; padding-top: 24px; }

.object-section__title {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--neutral-900, #1a1a1a);
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

/* Описание */
.object-description {
  font-family: var(--font, 'Alegreya Sans', sans-serif);
  font-size: 16px;
  line-height: 1.65;
  color: var(--neutral-700, #444);
  max-width: 760px;
}
.object-description p { margin: 0 0 12px; }
.object-description p:last-child { margin-bottom: 0; }

/* Метро */
.object-metros {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
}
.metro-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--neutral-50, #fafafa);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
}
.metro-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}
.metro-name { font-weight: 600; color: var(--neutral-900, #1a1a1a); }
.metro-time { color: var(--neutral-500, #888); margin-left: auto; font-size: 13px; }

/* Здание */
.object-building-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  max-width: 900px;
}
.building-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px;
  background: var(--neutral-50, #fafafa);
  border-radius: 10px;
  gap: 12px;
}
.building-label {
  color: var(--neutral-500, #888);
  font-size: 14px;
  font-family: var(--font);
}
.building-value {
  color: var(--neutral-900, #1a1a1a);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  text-align: right;
}

/* Инфраструктура / тех. характеристики — общая сетка фич */
.object-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-width: 1000px;
}
.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--neutral-50, #fafafa);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--neutral-800, #333);
}
.feature__check {
  color: var(--primary-600, #CD2323);
  font-weight: 700;
  font-size: 15px;
}
.feature--row { justify-content: space-between; }
.feature__label { color: var(--neutral-500, #888); font-size: 13px; }
.feature__value { color: var(--neutral-900, #1a1a1a); font-weight: 600; font-size: 14px; text-align: right; }

/* Планы помещений + здания */
.object-plans {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.plans-subgroup { display: block; }
.plans-subtitle {
  font-family: var(--font, 'Alegreya Sans', sans-serif);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neutral-500, #888);
  margin: 0 0 12px;
}
.object-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.plan-thumb {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--neutral-100, #f3f3f3);
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid var(--neutral-200, #e5e5e5);
  transition: transform 0.18s, box-shadow 0.18s;
}
.plan-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.plan-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
  padding: 12px;
}

@media (max-width: 600px) {
  .object-section { padding: 32px 0; }
  .object-section__title { font-size: 22px; }
  .metro-time { display: block; margin-left: 0; margin-top: 4px; }
  .metro-row { flex-wrap: wrap; }
}

/* ============================================================
   Консультант (визитка эксперта у CTA)
   ============================================================ */
.object-consultant {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.object-consultant__photo {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-200);
}
.object-consultant__ph {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 20px;
  font-family: var(--font-heading);
}
.object-consultant__label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--brand); font-family: var(--font);
}
.object-consultant__name { font-size: 16px; font-weight: 700; color: var(--black); font-family: var(--font); }
.object-consultant__role { font-size: 13px; color: var(--gray-500); font-family: var(--font); }

/* ============================================================
   Что мы проверяем (блок доверия)
   ============================================================ */
.object-trust__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  max-width: 900px;
}
.trust-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; background: var(--gray-50);
  border-radius: 10px; border-left: 3px solid var(--brand);
}
.trust-item__check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; margin-top: 1px;
}
.trust-item__title { font-weight: 700; font-size: 14px; color: var(--black); font-family: var(--font); margin-bottom: 3px; }
.trust-item__text { font-size: 13px; color: var(--gray-500); line-height: 1.5; font-family: var(--font); }
.object-trust__note { margin-top: 16px; font-size: 13px; color: var(--gray-400); font-style: italic; font-family: var(--font); max-width: 760px; }

/* ============================================================
   Карта расположения
   ============================================================ */
#objectMap {
  height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  z-index: 0;
}

/* ============================================================
   Похожие объекты
   ============================================================ */
.object-similar__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.similar-card {
  display: block;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: transform 0.18s, box-shadow 0.18s;
}
.similar-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.08); }
.similar-card__img {
  aspect-ratio: 4/3;
  background-size: cover; background-position: center;
  background-color: var(--gray-100);
}
.similar-card__body { padding: 14px; }
.similar-card__title {
  font-size: 15px; font-weight: 700; color: var(--black);
  font-family: var(--font); line-height: 1.3; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.similar-card__meta { font-size: 13px; color: var(--gray-500); font-family: var(--font); margin-bottom: 8px; }
.similar-card__price { font-size: 16px; font-weight: 800; color: var(--brand); font-family: var(--font); }

/* ============================================================
   Липкий мобильный CTA-бар
   ============================================================ */
.object-sticky-cta {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 200;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 -2px 18px rgba(0, 0, 0, 0.12);
  border-top: 1px solid var(--gray-200);
}
.object-sticky-cta .btn { flex: 1; padding: 13px 8px; font-size: 15px; }
@media (max-width: 767px) {
  .object-sticky-cta { display: flex; }
  .footer { padding-bottom: 84px; }
}

/* Стрелки галереи всегда видимы на тач-устройствах (нет hover) */
@media (hover: none) {
  .object-gallery__main .gallery-nav { opacity: 1; background: rgba(0, 0, 0, 0.4); }
}
