@charset "UTF-8";
/*
 * Каталог об'єктів. Еталон — Objects.dc.html.
 *
 * Макет — дві колонки по 720 px: зліва список, справа липка мапа. Тут це grid,
 * який на планшеті складається в одну колонку, а мапа ховається під кнопку
 * «Дивитись на карті» (бриф, розділ 4).
 */

.catalog {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 0;
}

.catalog__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px var(--gutter);
  min-width: 0;
}

.catalog__map {
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  min-height: 600px;
  overflow: hidden;
  background: var(--c-line);
}

.catalog__map-canvas {
  width: 100%;
  height: 100%;
}


/* --------------------------------------------------------------- фільтри -- */

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.catalog-filters__field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 180px;
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 49px;
  background: var(--c-bg);
  box-shadow: inset 0 0 0 1px var(--c-line);
}

.catalog-filters__field svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--c-muted);
}

.catalog-filters__field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-family: var(--f-ui);
  font-size: 14px;
  color: var(--c-ink);
}

.catalog-filters__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  border: 0;
  background: none;
  font-family: var(--f-ui);
  font-size: 14px;
  color: var(--c-ink);
  text-align: left;
  cursor: pointer;
}

.catalog-filters__toggle[data-placeholder="true"] {
  color: var(--c-muted);
}

.catalog-filters__toggle svg {
  width: 10px;
  height: 5px;
  transition: transform 0.25s ease;
}

.catalog-filters__toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.catalog-filters__menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  border-radius: 24px;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e6ddc5, 0 22px 22px rgba(0, 0, 0, 0.09), 0 5px 12px rgba(0, 0, 0, 0.1);
}

.catalog-filters__menu button,
.catalog-filters__menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.4;
  color: var(--c-ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease;
}

.catalog-filters__menu button:hover,
.catalog-filters__menu a:hover {
  background: var(--c-bg);
}

.catalog-filters__menu button,
.catalog-filters__menu a {
  justify-content: space-between;
  gap: 12px;
}

.catalog-filters__menu button.is-active,
.catalog-filters__menu a.is-active {
  background: var(--c-bg);
  color: var(--c-accent);
}

/* Значення без результатів не ховаємо, а гасимо — видно, що варіант існує. */
.catalog-filters__menu button[data-empty="true"] {
  opacity: 0.4;
}

.catalog-filters__menu small {
  font-size: 12px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------- панель «Більше фільтрів» --- */

/*
 * Сітка 12 колонок: тип і ціна на всю ширину, решта — парами. Групи мають
 * однакову структуру (шапка + вміст), тому підписи вирівняні по рядках
 * незалежно від того, що всередині — поля чи «пігулки».
 */
.catalog-panel {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px 24px;
  padding: 24px;
  border-radius: 24px;
  background: var(--c-bg);
  box-shadow: inset 0 0 0 1px var(--c-line);
}

.catalog-panel__row {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.catalog-panel__row--full {
  grid-column: 1 / -1;
}

/* Шапка фіксованої висоти в кожній групі — так підписи стоять на одній лінії. */
.catalog-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}

.catalog-panel__label {
  font-family: var(--f-ui);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.catalog-panel__clear {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--c-accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.catalog-panel__clear:hover {
  color: var(--c-ink);
}

/* Вибір типу */

.catalog-panel__types {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.catalog-panel__type-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.catalog-panel__type-cat {
  font-family: var(--f-ui);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--c-accent);
}

.catalog-panel__hint {
  max-width: 76ch;
  font-size: 13px;
  line-height: 1.45;
  color: var(--c-muted);
}

/* Пігулки */

.catalog-panel__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-panel__pills button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 40px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--c-line);
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1;
  color: var(--c-ink);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.catalog-panel__pills button:hover {
  box-shadow: inset 0 0 0 1px var(--c-line-strong);
}

.catalog-panel__pills button[aria-pressed="true"] {
  background: var(--c-navy);
  color: #fff;
  box-shadow: none;
}

.catalog-panel__pills button small {
  font-size: 11px;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.catalog-panel__pills button[aria-pressed="true"] small {
  color: rgba(255, 255, 255, 0.7);
}

/* Значення без результатів гасимо, але лишаємо клікабельними. */
.catalog-panel__pills button[data-empty="true"] {
  opacity: 0.45;
}

.catalog-panel__pills--rooms button {
  min-width: 56px;
  justify-content: center;
}

/* Діапазони */

.catalog-panel__stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-panel__range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-panel__sublabel {
  flex: 0 0 68px;
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--c-muted);
}

.catalog-panel__range label {
  flex: 1 1 0;
  min-width: 0;
}

.catalog-panel__range input {
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 40px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--c-line);
  font-family: var(--f-ui);
  font-size: 14px;
  color: var(--c-ink);
  outline: none;
  transition: box-shadow 0.2s ease;
}

.catalog-panel__range input:focus {
  box-shadow: inset 0 0 0 1px #e6ddc5, 0 0 0 3px rgba(230, 221, 197, 0.4);
}

/* Стрілки-лічильники в числових полях лише заважають — прибираємо. */
.catalog-panel__range input::-webkit-outer-spin-button,
.catalog-panel__range input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.catalog-panel__range input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.catalog-panel__dash {
  flex: 0 0 auto;
  color: var(--c-muted);
}

/* Перемикач валюти */

.catalog-panel__currency {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.75);
}

.catalog-panel__currency button {
  min-height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 40px;
  background: transparent;
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--c-body);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.catalog-panel__currency button[aria-pressed="true"] {
  background: var(--c-navy);
  color: #fff;
}

/* Підвал панелі */

.catalog-panel__footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  padding-top: 4px;
  border-top: 1px solid var(--c-line);
}

.catalog-panel__note,
.catalog-panel__found {
  padding-top: 12px;
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--c-muted);
}

.catalog-panel__found {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/*
 * Поки тип не обрано, залежні від нього поля лишаються видимими, але
 * неактивними — так видно, що фільтри існують, і зрозуміло, чому не працюють.
 */
.catalog-panel__row.is-locked {
  opacity: 0.4;
}

.catalog-panel__row.is-locked input {
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .catalog-panel {
    gap: 16px;
    padding: 20px 16px;
  }

  .catalog-panel__row {
    grid-column: 1 / -1;
  }

  .catalog-panel__types {
    gap: 12px 20px;
  }
}

/* --------------------------------------------------- стан завантаження --- */

.catalog__results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.18s ease;
}

/* Під час запиту список притлумлюємо, але не прибираємо — сторінка не стрибає. */
.catalog.is-loading .catalog__results {
  opacity: 0.45;
  pointer-events: none;
}

.catalog.is-loading .catalog-bar__count {
  opacity: 0.5;
}

/* Чипи додаткових фільтрів */

.catalog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 20px;
  border: 0;
  border-radius: 46px;
  background: var(--c-bg);
  font-family: var(--f-ui);
  font-size: 13px;
  color: #252525;
  cursor: pointer;
  transition: background 0.25s ease;
}

.chip:hover {
  background: #e4e2dc;
}

.chip[aria-pressed="true"] {
  background: var(--c-navy);
  color: #fff;
}

.chip svg {
  width: 17px;
  height: 18px;
}

/* Чип активної категорії: темний, з хрестиком — видно, що його можна зняти. */
.chip--removable {
  background: var(--c-navy);
  color: #fff;
  text-decoration: none;
}

.chip--removable:hover {
  background: #2f3a4a;
}

.chip--removable svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}

.catalog-reset {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--c-muted);
}

.catalog-reset:hover {
  color: var(--c-ink);
}

/* Панель сортування */

.catalog-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--c-line-strong);
  border-bottom: 1px solid var(--c-line-strong);
}

.catalog-bar__sort {
  position: relative;
  min-width: 220px;
}

.catalog-bar__count {
  font-family: var(--f-ui);
  font-size: 14px;
  color: var(--c-muted);
  white-space: nowrap;
}

/* ------------------------------------------------------- картка об'єкта --- */

.object-card {
  display: flex;
  gap: 0;
  padding: 4px;
  border-radius: 18px;
  background: var(--c-bg);
  transition: box-shadow 0.25s ease;
}

.object-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.object-card__media {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 300px;
  min-width: 300px;
  flex: 0 0 auto;
}

.object-card__cover {
  position: relative;
  display: block;
  height: 240px;
  overflow: hidden;
  border-radius: 16px 8px 8px 8px;
  background: var(--c-line);
}

.object-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.object-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 71%, rgba(0, 0, 0, 0.37) 100%);
}

.object-card__badge {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 4px;
  background: #fff;
  font-family: var(--f-ui);
  font-size: 10px;
  line-height: 1.12;
  color: var(--c-ink);
  text-transform: lowercase;
}

.object-card__thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  height: 80px;
}

.object-card__thumbs img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.object-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  padding: 24px 24px 32px;
}

.object-card__price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.object-card__price {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.12;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.object-card__price-unit {
  font-size: 14px;
  line-height: 1.48;
  color: var(--c-body);
  white-space: nowrap;
}

.object-card__address {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.27;
  color: var(--c-ink);
}

.object-card__district {
  font-size: 12px;
  line-height: 1.48;
  color: var(--c-muted);
}

.object-card__metro,
.object-card__spec {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.48;
  color: var(--c-ink);
}

.object-card__metro svg,
.object-card__spec svg {
  /*
   * Іконки з макета мають різні пропорції (12×11.9, 13.2×13.2, 14.5×11.2),
   * тому задаємо однаковий слот, а не квадрат: viewBox із типовим
   * preserveAspectRatio вписує вміст без спотворення, а текст лишається
   * вирівняним по одній вертикалі.
   */
  width: 16px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--c-body);
}

.object-card__specs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.object-card__excerpt {
  font-size: 11px;
  line-height: 1.48;
  color: var(--c-ink);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------------------- адаптив ---- */

@media (max-width: 1279px) {
  .catalog {
    grid-template-columns: minmax(0, 1fr);
  }

  /*
   * Мапа поруч зі списком не влазить — ховаємо її під кнопку, як просить бриф.
   * Атрибут виставляє Alpine на батьківському контейнері.
   */
  .catalog__map {
    position: static;
    height: 70vh;
    min-height: 420px;
    margin: 0 var(--gutter) 24px;
    border-radius: 20px;
  }

  .catalog[data-map="closed"] .catalog__map {
    display: none;
  }
}

@media (min-width: 1280px) {
  .catalog__map-toggle {
    display: none;
  }
}

@media (max-width: 767px) {
  .object-card {
    flex-direction: column;
  }

  .object-card__media {
    width: 100%;
    min-width: 0;
  }

  .object-card__cover {
    height: 220px;
  }

  .object-card__body {
    padding: 16px 12px 20px;
  }

  .catalog-filters__field {
    flex-basis: 100%;
  }
}


/* Два діапазони поверхів поруч — група займає весь рядок, тож місця вистачає. */
.catalog-panel__stack--split {
  flex-direction: row;
  gap: 24px;
}

.catalog-panel__stack--split > .catalog-panel__range {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 700px) {
  .catalog-panel__stack--split {
    flex-direction: column;
    gap: 8px;
  }
}
