/* Шаблон внутренней страницы: блоки tp-* */
.tp-section { padding: 72px 0; }
.tp-section--soft { background: var(--surface-soft); }
.tp-head { max-width: 760px; margin-bottom: 32px; }
.tp-head h2 { margin: 8px 0 10px; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15; letter-spacing: -.02em; }
.tp-head p { margin: 0; color: var(--muted); font-size: 17px; }

/* Полоса фактов под первым экраном */
.tp-facts { border-bottom: 1px solid var(--line); background: var(--surface); }
.tp-facts__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.tp-facts__item { display: flex; flex-direction: column; gap: 2px; padding: 22px 24px; border-left: 1px solid var(--line); }
.tp-facts__item:first-child { border-left: 0; padding-left: 0; }
.tp-facts__item b { font-size: 19px; line-height: 1.25; }
.tp-facts__item span { color: var(--muted); font-size: 14px; line-height: 1.4; }
.tp-facts__item--price b { color: var(--accent); }

/* Навигация по странице */

/* Вступление */
.tp-intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 48px; align-items: center; }
.tp-intro p { margin: 0 0 14px; font-size: 18px; line-height: 1.65; }
.tp-intro p:last-child { margin-bottom: 0; }
.tp-intro a { color: var(--accent); }
.tp-intro img, .tp-media img { width: 100%; height: auto; border-radius: var(--radius); }

/* Карточки исполнений */
.tp-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tp-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tp-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tp-card__tag { align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tp-card h3 { margin: 0; font-size: 20px; line-height: 1.25; }
.tp-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.tp-card a { color: var(--accent); font-weight: 600; }

/* Характеристики + комплектация */
.tp-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.tp-specs { width: 100%; border-collapse: collapse; font-size: 15px; }
.tp-specs th, .tp-specs td { padding: 14px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tp-specs th { width: 38%; padding-right: 20px; color: var(--muted); font-weight: 500; }
.tp-specs td { font-weight: 600; }
.tp-specs tr:first-child th, .tp-specs tr:first-child td { border-top: 1px solid var(--line); }
.tp-check { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.tp-check li { position: relative; padding: 14px 16px 14px 46px; border-radius: 12px; background: var(--surface-soft); font-size: 15px; line-height: 1.4; }
.tp-check li::before { content: ""; position: absolute; left: 16px; top: 15px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.tp-check--opt li { background: transparent; border: 1px dashed var(--line); }
.tp-check--opt li::before { background-color: var(--muted); }
.tp-sub { margin: 32px 0 0; font-size: 17px; }
.tp-split > div > .tp-sub:first-child { margin-top: 64px; }
@media (max-width: 900px) { .tp-split > div > .tp-sub:first-child { margin-top: 0; } }
[data-theme="dark"] .tp-price__alt { background: var(--surface); border-color: var(--line); }

/* Блок цены */
.tp-price { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 20px; }
.tp-price__main { display: flex; flex-direction: column; gap: 18px; padding: 36px; border-radius: var(--radius); background: var(--graphite); color: #fff; }
.tp-price__label { color: rgba(255,255,255,.7); font-size: 15px; }
.tp-price__value { margin: 0; font-size: clamp(40px, 5vw, 60px); font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.tp-price__value small { font-size: .45em; font-weight: 700; color: rgba(255,255,255,.7); letter-spacing: 0; }
.tp-price__factors { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tp-price__factors li { padding: 7px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.85); font-size: 14px; }
.tp-price__note { margin: 0; color: rgba(255,255,255,.7); font-size: 14px; }
.tp-price__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.tp-price__side { display: grid; gap: 12px; }
.tp-price__alt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: border-color .2s, transform .2s; }
.tp-price__alt:hover { border-color: rgba(168,28,12,.45); transform: translateY(-2px); }
.tp-price__alt span { color: var(--muted); font-size: 14px; }
.tp-price__alt b { display: block; color: var(--ink); font-size: 17px; }
.tp-price__alt strong { color: var(--accent); font-size: 18px; white-space: nowrap; }

/* Плитки применения */
.tp-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tp-tiles li { padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 600; }

/* Этапы */
.tp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: tp; }
.tp-steps li { counter-increment: tp; position: relative; padding: 24px 24px 24px 76px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: 15px; line-height: 1.5; min-height: 96px; }
.tp-steps li::before { content: counter(tp, decimal-leading-zero); position: absolute; left: 24px; top: 22px; color: var(--accent); font-size: 22px; font-weight: 800; }

@media (max-width: 1100px) {
  .tp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tp-facts__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-facts__item { padding: 16px 0 16px 18px; }
  .tp-facts__item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .tp-facts__item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tp-intro, .tp-split, .tp-price { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .tp-section { padding: 52px 0; }
  .tp-cards, .tp-cards--3, .tp-steps, .tp-check { grid-template-columns: 1fr; }
  .tp-price__main { padding: 26px 22px; }
  .tp-intro p { font-size: 16px; }
  .tp-facts__item b { font-size: 16px; }
}
[data-theme="dark"] .tp-price__main { background: #0b0e12; border: 1px solid var(--line); }

/* ===== Анимированный фон блока цены ===== */
.tp-price__main { position: relative; overflow: hidden; isolation: isolate; }
.tp-price__main::before { content: ""; position: absolute; inset: -40%; z-index: -2;
  background:
    radial-gradient(38% 42% at 20% 30%, rgba(168,28,12,.55), transparent 70%),
    radial-gradient(32% 38% at 80% 70%, rgba(197,42,24,.35), transparent 70%),
    radial-gradient(30% 30% at 60% 15%, rgba(216,221,225,.10), transparent 70%);
  animation: tpGlow 14s ease-in-out infinite alternate; }
.tp-price__main::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(110deg, transparent 35%, rgba(255,255,255,.09) 50%, transparent 65%) 0 0 / 250% 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 44px);
  animation: tpSheen 6s ease-in-out infinite; }
@keyframes tpGlow {
  0% { transform: translate(0,0) rotate(0deg) scale(1); }
  50% { transform: translate(6%,-4%) rotate(8deg) scale(1.08); }
  100% { transform: translate(-5%,5%) rotate(-6deg) scale(1); } }
@keyframes tpSheen { 0%, 35% { background-position: 150% 0, 0 0, 0 0; } 75%, 100% { background-position: -60% 0, 0 0, 0 0; } }
.tp-price__value { text-shadow: 0 6px 30px rgba(0,0,0,.35); }

/* ===== Карусели на мобильном ===== */
.tp-dots { display: none; }
@media (max-width: 640px) {
  .tp-carousel { display: flex !important; gap: 12px; margin-inline: calc(50% - 50vw); padding: 4px calc(50vw - 50%) 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 14px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; scrollbar-width: none; }
  .tp-carousel::-webkit-scrollbar { display: none; }
  .tp-carousel > * { flex: 0 0 82%; scroll-snap-align: start; }
  .tp-carousel.tp-steps > li { flex-basis: 78%; min-height: 0; }
  .tp-carousel.tp-price__side > * { flex-basis: 78%; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; }
  .tp-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
  .tp-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: var(--line); transition: width .25s, background .25s; }
  .tp-dots button.is-active { width: 22px; background: var(--accent); }
  .tp-swipe-hint { display: block; margin: -18px 0 16px; color: var(--muted); font-size: 13px; }
}
.tp-swipe-hint { display: none; }
@media (prefers-reduced-motion: reduce) {
  .tp-price__main::before, .tp-price__main::after { animation: none; }
}

/* ===== Общие блоки генератора ===== */
.tp-lead { max-width: 860px; }
.tp-lead p { margin: 0 0 14px; font-size: 19px; line-height: 1.65; }
.tp-lead a, .tp-row a, .tp-split a, .tp-head a, .tp-check a { color: var(--accent); }
.tp-head p { margin: 0 0 12px; }
.tp-head > p:last-child { margin-bottom: 0; }
.tp-section p { max-width: 72ch; }

/* Строки «заголовок слева — текст справа» */
.tp-rows { display: grid; }
.tp-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; padding: 36px 0; border-top: 1px solid var(--line); }
.tp-row:first-child { border-top: 0; padding-top: 0; }
.tp-row:last-child { padding-bottom: 0; }
.tp-row h2 { margin: 0; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; letter-spacing: -.02em; }
.tp-row__body p { margin: 0 0 12px; font-size: 17px; line-height: 1.65; }
.tp-row__body p:last-child { margin-bottom: 0; }

/* Текст + фото */
.tp-split--media { align-items: center; gap: 56px; }
.tp-split--rev > :first-child { order: 2; }
.tp-split--media p { font-size: 17px; line-height: 1.65; margin: 0 0 12px; }
.tp-split--media .tp-check { grid-template-columns: 1fr; }
.tp-check--wide { grid-template-columns: 1fr; }

/* Прайс-лист */
.tp-pricelist { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.tp-pricelist li { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.14); font-size: 16px; }
.tp-pricelist li:last-child { border-bottom: 0; }
.tp-pricelist a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
.tp-price--solo { grid-template-columns: 1fr; }
.tp-price__lead { margin: 0; color: rgba(255,255,255,.85); font-size: 17px; line-height: 1.6; }
.tp-price__lead a { color: #fff; text-decoration: underline; }
.tp-price__rows { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.tp-price__rows li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.85); font-size: 16px; }
.tp-price__rows li:last-child { border-bottom: 0; }
.tp-price__rows b { color: #fff; font-size: 20px; white-space: nowrap; }
.tp-price__value small { margin-left: 2px; }

@media (max-width: 900px) {
  .tp-row { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }
  .tp-split--rev > :first-child { order: 0; }
  .tp-split--media { gap: 24px; }
}
@media (max-width: 640px) {
  .tp-lead p { font-size: 17px; }
  .tp-row__body p, .tp-split--media p { font-size: 16px; }
  .tp-price__rows li { flex-direction: column; gap: 2px; }
}

/* Ровная сетка шагов: если шагов ровно 4, ставим их в один ряд */
@media (min-width: 1101px) {
  .tp-steps:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
