/* ============================================================
   AURUM FORT — шахматка квартир (flats-chess.html)
   Светлая дизайн-система сайта: белый фон, --ink/--navy текст,
   --gold/--gold-2 акценты. Статусы получают собственные акцентные
   цвета поверх этой палитры (не ломая общий светлый стиль).
   ============================================================ */

:root {
  /* контраст текста: тёмное золото для лейблов (≈6:1 на белом),
     тёплый графит для вторичного текста (≈7:1) — без opacity-бледноты */
  --chess-label: #7a5f2e;
  --chess-muted: #57524a;
  --chess-active: #1c4e89;
  --chess-active-bg: #eaf1f9;
  --chess-booked: #9a7a3c;
  --chess-booked-bg: #f7f1e3;
  --chess-sold: #a3433a;
  --chess-sold-bg: #f7ebe9;
  --chess-reserved: #6a5a8c;
  --chess-reserved-bg: #efecf5;
  --chess-unavailable: #9a9a9a;
  --chess-unavailable-bg: #f1f1f0;
}

/* ---------- filters ---------- */
.chess-filters {
  padding: 22px clamp(16px, 3vw, 28px) 14px;
  margin-bottom: 28px;
  background: var(--cream-2);
  border: 1px solid var(--grey-light);
  border-radius: 2px;
}
.chess-filters__groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px 36px;
}
.chess-filters__label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--chess-label);
  margin-bottom: 10px;
}
.chess-filters__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chess-filters__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--grey-light);
  margin-top: 18px;
  padding-top: 12px;
}
.chess-filters__summary {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--chess-muted);
}
.chess-filters__reset {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--gold-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.25s var(--ease);
}
.chess-filters__reset:hover { color: var(--gold); }

.chess-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--grey-light);
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--graphite);
  background: var(--white);
  transition: all 0.25s var(--ease);
}
.chess-chip:hover { border-color: var(--gold); }
.chess-chip.is-active {
  background: var(--graphite);
  color: #fff;
  border-color: var(--graphite);
}
.chess-chip__count {
  font-size: 0.72rem;
  opacity: 0.75;
}
.chess-chip__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.chess-chip__dot--active { background: var(--chess-active); }
.chess-chip__dot--booked { background: var(--chess-booked); }
.chess-chip__dot--sold { background: var(--chess-sold); }
.chess-chip__dot--reserved { background: var(--chess-reserved); }
.chess-chip__dot--unavailable { background: var(--chess-unavailable); }

/* ---------- legend ---------- */
.chess-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--graphite);
}
.chess-legend__item { display: inline-flex; align-items: center; gap: 7px; }
.chess-legend__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chess-legend__dot--active { background: var(--chess-active); }
.chess-legend__dot--booked { background: var(--chess-booked); }
.chess-legend__dot--sold { background: var(--chess-sold); }
.chess-legend__dot--reserved { background: var(--chess-reserved); }
.chess-legend__dot--unavailable { background: var(--chess-unavailable); }

/* ---------- board ---------- */
.chess-board {
  width: 100%;
  overflow-x: auto;
}
.chess-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 640px;
}
.chess-row--axis { margin-bottom: 0; }
.chess-row__floor {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gold-2);
  background: var(--cream-2);
  border: 1px solid var(--grey-light);
  border-radius: 2px;
}
.chess-row__floor--label {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--chess-muted);
}
.chess-row__cells {
  flex: 1;
  display: grid;
  gap: 10px;
}

.chess-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 96px;
  padding: 12px;
  text-align: left;
  border: 1px solid var(--grey-light);
  border-radius: 2px;
  background: var(--white);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.25s var(--ease);
}
.chess-cell:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(52,48,42,0.12);
  border-color: var(--gold);
}
.chess-cell.is-dimmed { opacity: 0.28; }
.chess-cell--empty {
  background: transparent;
  border: 1px dashed var(--grey-light);
  min-height: 96px;
}
.chess-cell--active { background: var(--chess-active-bg); border-color: rgba(28,78,137,0.25); }
.chess-cell--booked { background: var(--chess-booked-bg); border-color: rgba(154,122,60,0.3); }
.chess-cell--sold { background: var(--chess-sold-bg); border-color: rgba(163,67,58,0.25); cursor: default; }
.chess-cell--reserved { background: var(--chess-reserved-bg); border-color: rgba(106,90,140,0.25); }
.chess-cell--unavailable { background: var(--chess-unavailable-bg); border-color: var(--grey-light); opacity: 0.55; cursor: default; }

.chess-cell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}
.chess-cell__num { font-size: 0.78rem; font-weight: 700; color: var(--navy); }
.chess-cell__rooms {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(52,48,42,0.12);
  color: var(--graphite);
  white-space: nowrap;
}
.chess-cell__area { font-size: 0.74rem; font-weight: 400; color: var(--chess-muted); margin-top: 6px; }
.chess-cell__price { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-top: 2px; }
.chess-cell--sold .chess-cell__price { color: var(--chess-sold); }
.chess-cell--booked .chess-cell__price { color: var(--chess-booked); }

.chess-cell--sold .chess-cell__top,
.chess-cell--booked .chess-cell__top {
  justify-content: flex-start;
  gap: 6px;
}

.chess-cell__badge {
  position: absolute;
  top: 11px;
  right: -30px;
  width: 118px;
  padding: 2px 0;
  text-align: center;
  background: var(--chess-sold);
  font-size: 0.44rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  transform: rotate(35deg);
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(163,67,58,0.35);
  white-space: nowrap;
}
.chess-cell__badge--booked {
  background: var(--chess-booked);
  box-shadow: 0 2px 6px rgba(154,122,60,0.35);
}

@media (max-width: 720px) {
  .chess-board { overflow-x: visible; }
  .chess-row { min-width: 0; flex-wrap: wrap; }
  .chess-row__floor { flex: 0 0 100%; justify-content: flex-start; padding-left: 12px; }
  .chess-row__cells { grid-template-columns: repeat(2, 1fr) !important; flex-basis: 100%; }
  .chess-row--axis { display: none; }
}

/* ---------- details panel ---------- */
.chess-panel {
  position: fixed;
  inset: 0;
  z-index: 2300;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.chess-panel.is-open { visibility: visible; opacity: 1; }
.chess-panel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(52,48,42,0.45);
  backdrop-filter: blur(3px);
}
.chess-panel__dialog {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(480px, 100%);
  background: var(--white);
  box-shadow: -20px 0 50px rgba(0,0,0,0.18);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
}
.chess-panel.is-open .chess-panel__dialog { transform: translateX(0); }
.chess-panel__close {
  position: absolute;
  top: 18px; right: 20px;
  font-size: 1.5rem;
  color: var(--grey);
  z-index: 2;
  transition: color 0.25s var(--ease);
}
.chess-panel__close:hover { color: var(--gold); }
.chess-panel__body { padding: 56px 32px 40px; }

.chess-panel__eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chess-label);
  margin-bottom: 6px;
}
.chess-panel__title {
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--navy);
  margin-bottom: 12px;
}
.chess-panel__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.chess-panel__status {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 12px;
  border-radius: 2px;
  text-transform: uppercase;
}
.chess-panel__status--active { background: var(--chess-active-bg); color: var(--chess-active); }
.chess-panel__status--booked { background: var(--chess-booked-bg); color: var(--chess-booked); }
.chess-panel__status--sold { background: var(--chess-sold-bg); color: var(--chess-sold); }
.chess-panel__status--reserved { background: var(--chess-reserved-bg); color: var(--chess-reserved); }
.chess-panel__status--unavailable { background: var(--chess-unavailable-bg); color: var(--chess-unavailable); }
.chess-panel__floor { font-size: 0.85rem; font-weight: 500; color: var(--chess-muted); }

.chess-panel__price-block {
  background: var(--cream-2);
  border: 1px solid var(--grey-light);
  border-radius: 2px;
  padding: 18px 20px;
  margin-bottom: 28px;
}
.chess-panel__price-label { font-size: 0.72rem; font-weight: 600; color: var(--chess-label); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.chess-panel__price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chess-panel__price { font-family: var(--serif); font-size: 1.8rem; color: var(--navy); }
.chess-panel__price-old { font-size: 1rem; color: var(--grey); text-decoration: line-through; }
.chess-panel__discount { font-size: 0.78rem; font-weight: 700; color: var(--chess-sold); background: var(--chess-sold-bg); padding: 3px 8px; border-radius: 2px; }
.chess-panel__price-sqm { font-size: 0.8rem; font-weight: 500; color: var(--chess-muted); margin-top: 6px; }

.chess-panel__section { margin-bottom: 28px; }
.chess-panel__section-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chess-label);
  margin-bottom: 12px;
}

.chess-panel__plan {
  position: relative;
  border: 1px solid var(--grey-light);
  border-radius: 2px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--beige);
  padding: 14px;
  box-shadow: inset 0 1px 3px rgba(52,48,42,0.12);
}
.chess-panel__plan img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 1px;
  box-shadow: 0 2px 10px rgba(52,48,42,0.18);
}
.chess-panel__plan-hint {
  position: absolute;
  bottom: 10px; right: 10px;
  font-size: 0.68rem;
  padding: 5px 10px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
  color: var(--graphite);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.chess-panel__plan:hover .chess-panel__plan-hint { opacity: 1; }
.chess-panel__plan--empty {
  cursor: default;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}
.chess-panel__plan--empty span { font-size: 0.82rem; color: var(--chess-muted); }

.chess-panel__areas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chess-panel__area-box { border: 1px solid var(--grey-light); border-radius: 2px; padding: 10px 14px; }
.chess-panel__area-label { font-size: 0.7rem; font-weight: 500; color: var(--chess-muted); }
.chess-panel__area-value { font-size: 1rem; font-weight: 700; color: var(--navy); margin-top: 2px; }

.chess-panel__badges { display: flex; flex-wrap: wrap; gap: 8px; }
.chess-panel__badge {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--beige);
  border-radius: 2px;
  background: var(--cream-2);
  color: var(--graphite);
}

.chess-panel__comment {
  background: rgba(192,154,80,0.08);
  border: 1px solid rgba(192,154,80,0.25);
  border-radius: 2px;
  padding: 14px 18px;
  margin-bottom: 28px;
}
.chess-panel__comment p:last-child { font-size: 0.88rem; font-weight: 400; color: var(--graphite); margin-top: 4px; }

.chess-panel__cta { margin-top: 8px; }
.chess-panel__cta-note {
  text-align: center;
  padding: 16px;
  border-radius: 2px;
  background: var(--cream-2);
  border: 1px solid var(--grey-light);
  color: var(--graphite);
  font-size: 0.9rem;
  font-weight: 600;
}
.chess-panel__cta-note--sold { background: var(--chess-sold-bg); color: var(--chess-sold); border-color: rgba(163,67,58,0.25); }

/* ---------- lightbox ---------- */
.chess-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20,18,15,0.92);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.chess-lightbox.is-open { visibility: visible; opacity: 1; }
.chess-lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; }
.chess-lightbox__close {
  position: absolute;
  top: 24px; right: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  font-size: 1.6rem;
  color: #fff;
  transition: background 0.25s var(--ease);
}
.chess-lightbox__close:hover { background: rgba(255,255,255,0.22); }
