/**
 * Страница «Цены» — вкладки-категории (макет п. 39 правок от 08.10).
 * Подключается только на /tseny/ (inc/blocks/catalog/catalog.php).
 *
 * Без JS панели идут подряд; assets/js/prices-tabs.js ставит `.is-tabs`
 * на блок и `hidden` на неактивные панели.
 */

/* 7 вкладок не помещаются в обычные 1136 px — страница цен чуть шире. */
.tz-page-hero--tseny,
.tz-price { --tz-layout-content: 1280px; }

/* --- Шапка ---------------------------------------------------------------------- */
.tz-page-hero--tseny { position: relative; overflow: hidden; background: var(--tz-color-surface, #f6f6fb); }
.tz-page-hero--tseny .tz-page-hero__inner { position: relative; max-width: calc(var(--tz-layout-content, 1280px) + var(--tz-layout-gutter, 32px) * 2); min-height: 270px; align-content: center; }
.tz-page-hero--tseny .tz-page-hero__text { position: relative; z-index: 1; display: grid; gap: var(--tz-space-4, 16px); max-width: 640px; }
.tz-page-hero--tseny .tz-page-hero__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin-top: var(--tz-space-3, 12px);
  border-radius: 2px;
  background: var(--tz-color-primary);
}
.tz-page-hero--tseny picture {
  position: absolute;
  top: calc(var(--tz-space-7, 48px) * -1);
  right: 0;
  width: min(56%, 660px);
  pointer-events: none;
}
.tz-page-hero__photo {
  display: block;
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40%);
          mask-image: linear-gradient(to right, transparent 0, #000 40%);
}

/* --- Вкладки -------------------------------------------------------------------- */
.tz-price.tz-section { padding-block: var(--tz-space-7, 48px) var(--tz-space-9, 96px); }
.tz-price__title { margin: 0 0 var(--tz-space-6, 32px); font-size: clamp(26px, 3vw, 38px); }
.tz-price__empty { margin: 0; }

.tz-price__tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: var(--tz-space-5, 24px);
}
.tz-price__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 16px 10px;
  border-radius: var(--tz-radius-md, 16px);
  background: var(--tz-color-bg, #fff);
  box-shadow: 0 6px 20px rgba(47, 76, 84, 0.08), inset 0 0 0 1px var(--tz-color-tint, #e8edfb);
  color: var(--tz-color-ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.tz-price__tab:hover { color: var(--tz-color-primary-text, #6e58cc); }
.tz-price__tab-icon,
.tz-price__group-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--tz-color-tint, #efebfb);
  color: var(--tz-color-primary);
}
.tz-price__tab-title { overflow-wrap: anywhere; }

/* Активная вкладка — фиолетовый градиент, белый текст (только когда работают вкладки). */
.tz-price.is-tabs .tz-price__tab.is-active,
.tz-price.is-tabs .tz-price__tab.is-active:hover {
  background: var(--tz-color-primary-hover, #6e58cc) linear-gradient(135deg, var(--tz-color-primary, #816cd7) 0%, var(--tz-color-primary-hover, #6e58cc) 70%);
  box-shadow: 0 10px 24px rgba(110, 88, 204, 0.3);
  color: #fff;
}
.tz-price.is-tabs .tz-price__tab.is-active .tz-price__tab-icon { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* --- Карточка категории --------------------------------------------------------- */
.tz-price__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: var(--tz-space-6, 32px);
  padding: var(--tz-space-6, 32px);
  border-radius: var(--tz-radius-lg, 24px);
  background: var(--tz-color-bg, #fff);
  box-shadow: 0 10px 40px rgba(47, 76, 84, 0.08), inset 0 0 0 1px var(--tz-color-tint, #e8edfb);
}
.tz-price__groups { display: grid; gap: var(--tz-space-7, 48px); min-width: 0; }
.tz-price__group { min-width: 0; scroll-margin-top: calc(var(--tz-header-h, 76px) + 16px); }
.tz-price__group[hidden] { display: none; }
.tz-price__group-head { display: flex; align-items: center; gap: 16px; margin-bottom: var(--tz-space-4, 16px); }
.tz-price__group-heading { min-width: 0; }
.tz-price__group-title {
  margin: 0;
  font-family: var(--tz-font-sans, "Manrope", sans-serif);
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  overflow-wrap: anywhere;
}
.tz-price__lead { margin: 4px 0 0; color: var(--tz-color-ink); font-size: 15px; }

.tz-price__list { list-style: none; margin: 0; padding: 0; }
.tz-price__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto) auto;
  align-items: center;
  gap: 8px 20px;
  padding-block: 12px;
  border-bottom: 1px solid var(--tz-color-tint, #e8edfb);
}
.tz-price__row:last-child { border-bottom: 0; }
.tz-price__name { min-width: 0; overflow-wrap: anywhere; }
.tz-price__link { color: inherit; text-decoration: none; }
.tz-price__link:hover { color: var(--tz-color-primary-text, #6e58cc); }
.tz-price__value {
  display: grid;
  justify-items: end;
  color: var(--tz-color-primary-text, #6e58cc);
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}
.tz-price__old { color: var(--tz-color-ink); font-weight: 400; font-size: 14px; }
.tz-price__note { color: var(--tz-color-ink); font-weight: 400; font-size: 13px; white-space: normal; }
.tz-price__action { display: flex; justify-content: flex-end; }
.tz-price__book {
  min-height: 44px;
  padding: 10px 20px;
  font-size: 15px;
  background: var(--tz-color-bg, #fff);
  color: var(--tz-color-primary-text, #6e58cc);
  box-shadow: inset 0 0 0 1px var(--tz-color-primary);
}
.tz-price__book:hover { background: var(--tz-color-primary); color: #fff; }
.tz-price__group-note { margin: var(--tz-space-4, 16px) 0 0; color: var(--tz-color-ink); font-size: 14px; }

/* --- Фото справа с плашкой ------------------------------------------------------ */
.tz-price__aside { position: relative; align-self: start; min-width: 0; }
.tz-price__aside picture { display: block; }
.tz-price__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--tz-radius-md, 16px);
}
.tz-price__ask {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--tz-radius-md, 16px);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(47, 76, 84, 0.12);
}
.tz-price__ask-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tz-color-primary);
  color: #fff;
}
.tz-price__ask-text { display: grid; gap: 2px; margin: 0; min-width: 0; }
.tz-price__ask-title { font-weight: 700; }
.tz-price__ask-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--tz-color-primary-text, #6e58cc);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.tz-price__ask-link:hover { text-decoration: underline; }

/* --- Планшет -------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .tz-price__card { grid-template-columns: minmax(0, 1fr); }
  .tz-price__aside { max-width: 520px; }
  .tz-price__photo { aspect-ratio: 5 / 3; }
}

/* --- Телефон (390 и 360): вкладки — прокручиваемый трек ------------------------- */
@media (max-width: 1023px) {
  .tz-price__tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 4px 2px 12px;
    margin-inline: -2px;
  }
  .tz-price__tabs::-webkit-scrollbar { display: none; }
  .tz-price__tab { flex: 0 0 140px; scroll-snap-align: start; }
}

@media (max-width: 760px) {
  .tz-page-hero--tseny .tz-page-hero__inner { min-height: 0; }
  .tz-page-hero--tseny picture { position: static; width: 100%; margin-top: var(--tz-space-4, 16px); }
  .tz-page-hero__photo { -webkit-mask-image: none; mask-image: none; border-radius: var(--tz-radius-md, 16px); }
  .tz-price.tz-section { padding-block: var(--tz-space-5, 24px) var(--tz-space-7, 48px); }
  .tz-price__card { padding: var(--tz-space-4, 16px); gap: var(--tz-space-5, 24px); border-radius: var(--tz-radius-md, 16px); }
  .tz-price__group-icon { width: 44px; height: 44px; }
  .tz-price__row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .tz-price__name { grid-column: 1 / -1; }
  .tz-price__value { justify-items: start; text-align: left; white-space: normal; }
  .tz-price__aside { max-width: none; }
  .tz-price__ask { position: static; margin-top: 12px; box-shadow: inset 0 0 0 1px var(--tz-color-tint, #e8edfb); }
}
