/* ==========================================================================
   BREVIS.EXPRESS — CATALOG
   Витрина готовых макетов: шапка, фильтры, сетка карточек, бронирование.
   ========================================================================== */

/* ══════════════════════════════════════════════════════════ ЗАГОЛОВОК */

.cat-hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(48px, 8vw, 100px));
  padding-bottom: clamp(48px, 6vw, 84px);
  overflow: clip;
}

.cat-hero__inner {
  position: relative;
  z-index: 1;
}

.cat-hero__tags {
  --gap: 10px;
  margin-bottom: clamp(20px, 3vw, 30px);
}

.cat-hero__title {
  font-size: clamp(2rem, 7vw, 5.4rem);
  margin-bottom: clamp(20px, 2.6vw, 30px);
  line-height: 150%;
}

@media (max-width:577px) {

  .cat-hero__title {
    line-height: 130%;
  }
}

.cat-hero__lead {
  max-width: 62ch;
  font-size: var(--step-1);
  color: var(--muted);
}

@media (max-width:577px) {
  .cat-hero__lead {
    font-size: 14px;
  }
}

.cat-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(34px, 4.4vw, 54px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--line);
  overflow: hidden;
}

@media (min-width: 720px) {
  .cat-hero__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }


}

.cat-hero__stats>div {
  display: grid;
  gap: 6px;
  padding: clamp(18px, 2.4vw, 26px);
  background: var(--bg);
}

.cat-hero__stats dt {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.cat-hero__stats dd {
  font-size: clamp(1.2rem, 3vw, 2.1rem);
  line-height: 1;
  color: var(--white);
}

@media (max-width:577px) {}

/* ════════════════════════════════════════════════════════════ ФИЛЬТРЫ */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: clamp(26px, 3.4vw, 40px);
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.filter b {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.07);
  color: var(--faint);
}

.filter:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

.filter.is-active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--void);
}

.filter.is-active b {
  background: rgba(18, 18, 18, 0.14);
  color: rgba(18, 18, 18, 0.7);
}

.filters__empty {
  padding: 40px 0;
  text-align: center;
  color: var(--faint);
}

@media (max-width:767px) {
  .filter {
    padding: 6px 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════ СЕТКА */

.cat-grid {
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr));
  align-items: start;
}

.tpl {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(14px, 1.4vw, 18px);
}

/* Скрытая фильтром карточка выходит из потока после анимации */
.tpl.is-out {
  display: none;
}

.tpl__thumb {
  aspect-ratio: 16 / 10;
}

.tpl__view {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  background: var(--lime);
  color: var(--void);
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -34%) scale(0.94);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.tpl:hover .tpl__view,
.tpl__view:focus-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (hover: none) {
  .tpl__view {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.tpl__stock {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  background: rgba(18, 18, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tpl__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 clamp(8px, 1.2vw, 14px) clamp(8px, 1.2vw, 14px);
}

.tpl__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tpl__body>p {
  font-size: 0.91rem;
}

@media (max-width:577px) {
  .tpl__body>p {
    font-size: 12px;
  }
}

/* --- Опции --- */

.tpl__addons {
  display: grid;
  gap: 6px;
  border: 0;
  margin-top: 4px;
}

.tpl__addons legend {
  padding: 0 0 9px;
  letter-spacing: 0.14em;
}

/* --- Итог и кнопка --- */

.tpl__foot {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.tpl__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tpl__total strong {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  color: var(--white);
  transition: color var(--dur) var(--ease);
}

/* Цифра коротко подсвечивается при пересчёте */
.tpl__total strong.is-bumped {
  color: var(--lime);
}

.tpl__rights {
  padding: 11px 14px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--faint);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

/* --- Проданные --- */

.tpl--sold {
  opacity: 0.74;
}

.tpl--sold .thumb img {
  filter: grayscale(1) contrast(0.92);
}

.tpl--sold .thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: repeating-linear-gradient(-45deg,
      transparent 0 12px,
      rgba(255, 255, 255, 0.05) 12px 24px);
}

.tpl--sold:hover {
  opacity: 0.92;
}

/* Плитка-форма «Какого шаблона не хватает?» — последняя в сетке.
   Пунктир вместо заливки: читается как свободное место на витрине.
   Это не карточка макета (.tpl), поэтому фильтры её не прячут. */
.tpl-wish {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  background: transparent;
  border: 1.5px dashed var(--line-strong);
}

.tpl-wish:hover {
  border-color: rgba(218, 254, 82, 0.4);
}

.tpl-wish__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.tpl-wish__body form {
  width: 100%;
  margin-top: 6px;
}

.tpl-wish__lead {
  max-width: 46ch;
  color: var(--muted);
}

.tpl-wish .form-success {
  background: var(--surface);
}

.tpl__stamp {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  padding: 7px 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  transform: rotate(-7deg);
}

/* ══════════════════════════════════════════════════════════════ CTA */

.cat-cta {
  display: grid;
  gap: clamp(22px, 3vw, 40px);
  padding: clamp(30px, 4.4vw, 60px);
  align-items: center;
}

@media (min-width: 860px) {
  .cat-cta {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* Колонка текста делит карточку с кнопками, и от 860px «подходящий»
   с кеглем от ширины окна в неё не влезало. Кегль — не шире колонки */
.cat-cta> :first-child {
  container-type: inline-size;
}

.cat-cta__title {
  margin: 16px 0 12px;
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  font-size: min(clamp(1.9rem, 4.4vw, 3.2rem), 9.6cqi);
}

.cat-cta p {
  max-width: 52ch;
}

/* ═══════════════════════════════════════════════════ БРОНИРОВАНИЕ */

.booking__sum {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 22px;
  padding: 16px 18px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(218, 254, 82, 0.28);
  background: var(--lime-soft);
}

@media (max-width:577px) {
  .booking__sum {
    padding: 12px;
    align-items: center;
  }

  .booking__sum span {
    width: 25%;
  }

  .booking__sum strong {
    text-align: center;
    width: 75%;
  }
}

.booking__sum strong {
  font-size: 1.5rem;
  color: var(--lime);
}

/* Мини-чек над итогом: макет и каждая опция своей строкой. Раньше опции
   шли одной строкой моноширинным капсом — три строки капса не читались */
.booking__lines {
  margin-top: 20px;
}

.booking__lines ul {
  display: grid;
  list-style: none;
}

.booking__lines li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--muted);
}

.booking__lines b {
  flex: none;
  color: var(--white);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.booking__note {
  margin-top: 10px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--faint);
}

#bookingForm {
  margin-top: 4px;
}

/* Карточки одной высоты: без этого лаймовая строка цены у соседних макетов
   стоит на разном уровне и сетка выглядит неопрятно */
.cat-grid {
  align-items: stretch;
}

.tpl {
  height: 100%;
}