/* Диваныч — подбор дивана.
   Каркас: слева панель-инструмент, справа лента моделей.

   ВАЖНО про отстройку от Мебель Парка: у них тёмный сайт, лаймово-зелёный акцент
   и антиква в заголовках. Поэтому здесь всё наоборот — светлый лист, малиновый
   с логотипа, широкий гротеск Unbounded. Зелёный не используем вообще,
   он читается как фирменный цвет мебельного центра. */

:root {
  --paper: #ffffff;
  --bg: #fbf4f7;          /* лист с малиновым подмесом */
  --panel: #ffffff;       /* панель подбора — светлая */
  --field: #f7eef2;
  --ink: #1d1218;
  --muted: #7c6a72;
  --muted-2: #9c8a92;
  --accent: #d43987;      /* малиновый с логотипа */
  --accent-dark: #ad2a6c;
  --accent-soft: #fae0ee;
  --line: #ead9e2;
  --line-strong: #1d1218;
  --panel-w: 400px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Rubik", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
  font-family: "Unbounded", "Segoe UI", Arial, sans-serif;
  font-weight: 700; line-height: 1.14; letter-spacing: -.04em;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.app { display: flex; min-height: 100vh; }

/* ===================== ПАНЕЛЬ ПОДБОРА ===================== */
.panel {
  width: var(--panel-w); flex: 0 0 var(--panel-w);
  background: var(--panel); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 24px 30px 20px;
  overflow-y: auto;
}

.panel__top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { font-size: 24px; }
.brand span { color: var(--accent); }
.panel__phone { font-weight: 600; font-size: 15px; }
.panel__phone:hover { color: var(--accent); }

.panel__body { flex: 1; padding: 30px 0 24px; }
.panel__title { font-size: 25px; }
.panel__sub { color: var(--muted); font-size: 14.5px; margin-top: 12px; }

.q { margin-top: 26px; }
.q__label {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 14.5px; font-weight: 600; color: var(--muted); margin-bottom: 12px;
}
.q__label output {
  font-family: "Unbounded", sans-serif; font-weight: 700;
  font-size: 18px; color: var(--ink); letter-spacing: -.03em;
}
.q__hint { font-size: 12.5px; color: var(--muted-2); margin-top: 9px; line-height: 1.45; }

/* формы диванов */
.shapes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.shape {
  background: var(--field); border: 1.5px solid transparent; border-radius: 4px;
  padding: 13px 10px 10px; color: var(--muted); transition: .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.shape svg { width: 42px; height: 31px; fill: currentColor; }
.shape span { font-size: 13px; font-weight: 500; }
.shape:hover { border-color: var(--accent); color: var(--ink); }
.shape.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* слайдер */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--field); border-radius: 2px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 4px solid var(--panel); cursor: grab;
  box-shadow: 0 0 0 1.5px var(--accent);
}
input[type="range"]::-moz-range-thumb {
  width: 17px; height: 17px; border-radius: 50%; background: var(--accent);
  border: 3px solid var(--panel); cursor: grab;
}

/* чекбоксы */
.check {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
  font-size: 14.5px; cursor: pointer; border-bottom: 1px solid var(--line);
}
.check:last-child { border-bottom: 0; }
.check input { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; }

.counter {
  margin-top: 24px; padding: 15px 16px; border-radius: 4px;
  background: var(--accent-soft); font-size: 14px; color: var(--ink);
}
.counter b {
  font-family: "Unbounded", sans-serif; font-size: 21px; letter-spacing: -.04em;
  color: var(--accent-dark); display: block;
}

.link-reset {
  margin-top: 12px; background: none; border: 0; color: var(--muted);
  font-size: 13.5px; text-decoration: underline; padding: 0;
}
.link-reset:hover { color: var(--accent); }

.panel__foot {
  border-top: 1px solid var(--line); padding-top: 16px;
  font-size: 13px; color: var(--muted-2); line-height: 1.55;
}
.panel__hours { margin-top: 5px; }

/* ===================== ЛЕНТА МОДЕЛЕЙ ===================== */
.results { flex: 1; min-width: 0; padding: 42px 46px 0; }

.results__head { margin-bottom: 26px; }
.results__head h2 { font-size: 30px; }
.results__head p { color: var(--muted); margin-top: 5px; font-size: 15px; }

/* Не карточки: плоские блоки-спецификации, разделённые линейками.
   Белые прямоугольники с тенью — приём Мебель Парка, здесь его нет. */
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 34px 30px; }

.item { cursor: pointer; display: flex; flex-direction: column; border-top: 2px solid var(--line-strong); padding-top: 14px; }
.item__media { aspect-ratio: 16 / 11; background: var(--accent-soft); position: relative; overflow: hidden; }
.item__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.item:hover .item__media img { transform: scale(1.04); }

.ph {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 7px; color: #c07ba1;
  background: var(--accent-soft);
}
.ph__ico { font-size: 28px; opacity: .5; }
.ph__txt { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }

.item__wall {
  position: absolute; left: 0; bottom: 0;
  background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 600; padding: 6px 11px;
}

/* полоска «сколько займёт от вашей стены» */
.fit { margin-top: 10px; }
.fit__bar { height: 6px; background: var(--field); overflow: hidden; }
.fit__bar span { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.fit__txt { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.fit--tight .fit__bar span { background: var(--ink); }
.fit--tight .fit__txt { color: var(--ink); font-weight: 500; }

.item__body { padding-top: 11px; flex: 1; display: flex; flex-direction: column; }
.item__name { font-size: 19px; }
.item__name.is-todo { color: var(--accent); }
.item__type { font-size: 13px; color: var(--muted); margin-top: 2px; }
.item__facts { list-style: none; margin-top: 12px; font-size: 13.5px; }
.item__facts li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.item__facts li:last-child { border-bottom: 0; }
.item__facts span:first-child { color: var(--muted); }
.item__facts span:last-child { font-weight: 600; }
.item__more { margin-top: 12px; color: var(--accent); font-weight: 600; font-size: 14px; }

.empty {
  border: 2px solid var(--line-strong); padding: 46px 30px; max-width: 540px;
}
.empty__ico { font-size: 30px; margin-bottom: 10px; }
.empty h3 { font-size: 20px; margin-bottom: 9px; }
.empty p { color: var(--muted); margin-bottom: 20px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 24px; border-radius: 4px; font-weight: 600; font-size: 15px;
  border: 1.5px solid transparent; transition: .15s;
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-dark); }
.btn--line { border-color: var(--line-strong); color: var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn--block { width: 100%; }

/* ---------- блоки ниже ленты ---------- */
.block { margin-top: 66px; }
.block__head { margin-bottom: 20px; }
.block__head h2 { font-size: 25px; }
.block__head p { color: var(--muted); margin-top: 4px; font-size: 15px; }

.vitrina-state {
  border: 1px dashed var(--line); padding: 34px 24px; color: var(--muted-2); text-align: center; font-size: 15px;
}
.vitrina-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.vitrina-grid img { aspect-ratio: 1/1; object-fit: cover; }
.vitrina-date { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.vitrina-date b { color: var(--ink); }

/* ---------- как доехать ---------- */
.where { display: grid; grid-template-columns: 320px 1fr; border: 2px solid var(--line-strong); }
.where__info { padding: 28px 26px; }
.where__row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.where__row:first-child { padding-top: 0; }
.where__label { font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.where__val { font-size: 16px; line-height: 1.45; }
.where__val a:hover { color: var(--accent); }
.where__msg { font-size: 13px; color: var(--muted); }
.where__val b { color: var(--accent); }
.where__actions { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }

.where__map { min-height: 400px; border-left: 2px solid var(--line-strong); }
.where__map iframe { display: block; border: 0; width: 100%; height: 100%; }

.foot { margin-top: 60px; padding: 22px 0 28px; border-top: 2px solid var(--line-strong); }
.foot__row { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand--dark { font-size: 20px; }
.foot__row--small { margin-top: 12px; font-size: 12.5px; color: var(--muted-2); }
.foot a:hover { color: var(--accent); }

/* ===================== МОДАЛКА ===================== */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(29, 18, 24, .55);
}
.modal.is-open { display: flex; }
.modal__box {
  background: var(--paper); border: 2px solid var(--line-strong);
  max-width: 880px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative;
}
.modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px;
  border: 1.5px solid var(--line-strong); background: var(--paper); font-size: 17px; color: var(--ink);
}
.modal__close:hover { background: var(--ink); color: #fff; }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; }
.mgrid__media { aspect-ratio: 1/1; background: var(--accent-soft); }
.mgrid__media img { width: 100%; height: 100%; object-fit: cover; }
.mgrid__side { padding: 32px 30px; border-left: 2px solid var(--line-strong); }
.mgrid__name { font-size: 27px; }
.mgrid__type { color: var(--muted); margin-top: 3px; font-size: 14.5px; }
.mgrid__note { margin-top: 12px; font-size: 14.5px; color: var(--muted); }
.specs { list-style: none; margin: 20px 0; }
.specs li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.specs li span:first-child { color: var(--muted); }
.specs li span:last-child { font-weight: 600; text-align: right; }
.mgrid__price { font-family: "Unbounded", sans-serif; font-size: 20px; letter-spacing: -.04em; margin-bottom: 14px; }
.mgrid__price small {
  display: block; font-family: "Rubik", sans-serif; font-size: 13px; font-weight: 400;
  color: var(--muted); margin-top: 4px; letter-spacing: 0;
}

/* ===================== ТОЛЬКО ТЕЛЕФОН ===================== */
/* Сворачиваемый подбор и липкая панель звонка — на десктопе не нужны. */
.panel__toggle, .callbar, .vizitka { display: none; }

.vizitka { padding: 22px 0 26px; border-bottom: 2px solid var(--line-strong); margin-bottom: 26px; }
.vizitka__title { font-size: 22px; }
.vizitka__list { list-style: none; margin: 16px 0 0; }
.vizitka__list li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; }
.vizitka__list li:last-child { border-bottom: 0; }
.vizitka__lead { font-size: 14.5px; color: var(--muted); margin-top: 12px; }
.vizitka__actions { display: flex; gap: 8px; margin-top: 16px; }
.vizitka__actions .btn { flex: 1; padding: 13px 8px; font-size: 14.5px; }

.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 2px solid var(--line-strong);
}
.callbar .btn { flex: 1; padding: 13px 10px; }

/* ===================== АДАПТИВ ===================== */
@media (max-width: 1080px) {
  .app { flex-direction: column; }
  .panel {
    width: 100%; flex: none; height: auto; position: static;
    border-right: 0; border-bottom: 2px solid var(--line-strong); padding: 16px 22px 18px;
  }
  .panel__body { padding: 18px 0 4px; }

  /* по умолчанию подбор свёрнут — сразу под шапкой видны диваны */
  .panel__body, .panel__foot { display: none; }
  .panel.is-open .panel__body, .panel.is-open .panel__foot { display: block; }

  .panel__toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; margin-top: 14px; padding: 13px 15px;
    background: var(--accent-soft); border: 1.5px solid var(--accent);
    border-radius: 4px; color: var(--accent-dark);
    font-family: inherit; font-size: 14.5px; font-weight: 600; text-align: left;
  }
  .panel__toggle-ico { transition: transform .2s; font-size: 12px; }
  .panel.is-open .panel__toggle-ico { transform: rotate(180deg); }

  .callbar { display: flex; }
  body { padding-bottom: 74px; }
  .shapes { grid-template-columns: repeat(4, 1fr); }
  .results { padding: 32px 22px 0; }
  .where { grid-template-columns: 1fr; }
  .where__map { min-height: 300px; border-left: 0; border-top: 2px solid var(--line-strong); }
  .vitrina-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .q { margin-top: 20px; }
  .q__hint { display: none; }
  .shapes { grid-template-columns: repeat(2, 1fr); }
  .vizitka { display: block; }

  /* Ленты по типам: вертикально коротко, вбок листается только нужная категория. */
  .list--rows { display: block; }
  .row { margin-bottom: 22px; }
  .row__head {
    display: flex; align-items: center; gap: 8px; font-size: 17px;
    padding-bottom: 8px; border-bottom: 2px solid var(--line-strong); margin-bottom: 12px;
  }
  .row__head span {
    font-family: "Rubik", sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0;
    background: var(--accent-soft); color: var(--accent-dark); padding: 2px 8px; border-radius: 20px;
  }
  .row__track {
    display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; padding-bottom: 4px;
    scrollbar-width: none;
  }
  .row__track::-webkit-scrollbar { display: none; }
  .tile { flex: 0 0 148px; scroll-snap-align: start; cursor: pointer; }
  .tile__media { aspect-ratio: 1 / 1; background: var(--accent-soft); overflow: hidden; }
  .tile__media img { width: 100%; height: 100%; object-fit: cover; }
  .tile__name { font-family: "Unbounded", sans-serif; font-weight: 700; letter-spacing: -.03em; font-size: 15px; margin-top: 8px; }
  .tile__spec { font-size: 12px; color: var(--muted); margin-top: 2px; }

  /* Компактные строки — когда подбор применён (моделей мало). */
  .list { grid-template-columns: 1fr; gap: 0; }
  .item {
    flex-direction: row; flex-wrap: wrap; gap: 0 13px; align-items: flex-start;
    border-top: 1px solid var(--line); padding: 14px 0;
  }
  .item:first-child { border-top: 2px solid var(--line-strong); }
  .item__media { width: 104px; flex: 0 0 104px; aspect-ratio: 1 / 1; }
  .item__body { order: 2; flex: 1; min-width: 0; padding-top: 0; }
  .item__name { font-size: 17px; }
  .item__type { font-size: 12.5px; }
  .item__facts { margin-top: 8px; font-size: 13px; }
  .item__facts li { padding: 3px 0; border-bottom: 0; }
  .item__facts li:nth-child(n+3) { display: none; }   /* оставляем спальное место и механизм */
  .item__more { display: none; }
  .fit { order: 3; width: 100%; margin-top: 10px; }
  .fit__bar { height: 5px; }
  .fit__txt { font-size: 12px; }
  .mgrid { grid-template-columns: 1fr; }
  .mgrid__media { aspect-ratio: 4/3; }
  .mgrid__side { padding: 24px 20px; border-left: 0; border-top: 2px solid var(--line-strong); }
  .vitrina-grid { grid-template-columns: repeat(2, 1fr); }
  .results__head h2 { font-size: 24px; }
  .foot__row { flex-direction: column; align-items: flex-start; gap: 7px; }
}
