/**
 * TVK — главная как твкпластик.рф + заметное видео
 * v3.0
 */

body.home-page {
  --home-green: var(--data, #00c9a7);
  --home-red: var(--accent, #dc2626);
}

/* ═══════════════════════════════════════════════════════
   HERO — разметка как на проде, видео крупнее и ровно с текстом
   ═══════════════════════════════════════════════════════ */
body.home-page #hero.hero-section--pipe-video {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
  border-bottom: 1px solid var(--bg-border);
}

@media (min-width: 901px) {
  body.home-page #hero .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(400px, 1.15fr) !important;
    align-items: start !important;
    gap: clamp(28px, 4.5vw, 56px) !important;
  }
}

body.home-page #hero .hero-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 2.5vw, 24px);
  min-width: 0;
}

body.home-page #hero .hero-copy__main {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 16px);
}

@media (min-width: 901px) {
  body.home-page #hero .hero-h1 {
    font-size: clamp(2.1rem, 5vw, 3.35rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
  }

  body.home-page #hero .hero-h1-cycle-wrap {
    font-size: clamp(1rem, 2.1vw, 1.35rem);
  }
}

body.home-page #hero .hero-lead--offer {
  max-width: 54ch;
  color: var(--text-secondary);
}

body.home-page #hero .hero-lead-link {
  color: var(--home-green);
}

body.home-page #hero .hero-trust-line {
  text-align: left !important;
  margin: 0;
}

body.home-page #hero .guarantee-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.home-page #hero .hero-stats {
  text-align: left !important;
}

body.home-page #hero .hero-stats .hero-stat {
  align-items: flex-start !important;
  text-align: left !important;
}

body.home-page #hero .hero-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

body.home-page #hero .hero-actions > .btn {
  flex: 1 1 200px;
  width: auto;
}

body.home-page #hero .hero-phone-block {
  flex: 1 1 100%;
  text-align: left !important;
  margin: 0;
}

/* Колонка видео: высота = .hero-copy__main (JS), свечение, крупный кадр */
body.home-page #hero .hero-panel--showcase {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
  width: 100%;
  min-width: 0;
  height: var(--hero-media-h, auto);
  position: relative;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

body.home-page #hero .hero-panel--showcase::before {
  content: "";
  position: absolute;
  inset: -16px -20px;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% 18%, rgba(0, 201, 167, 0.22), transparent 62%),
    radial-gradient(ellipse 80% 55% at 50% 88%, rgba(220, 38, 38, 0.18), transparent 65%);
  filter: blur(18px);
  opacity: 0.95;
}

body.home-page #hero .hero-pipe-video__tag {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--home-green);
}

body.home-page #hero .hero-pipe-video.product-photo--video {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
  line-height: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 3px solid rgba(0, 201, 167, 0.55);
  border-bottom: 3px solid var(--home-red);
  background:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(220, 38, 38, 0.08), transparent 55%),
    linear-gradient(165deg, #141a22 0%, #080a0e 100%);
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 201, 167, 0.12),
    0 0 48px rgba(0, 201, 167, 0.08);
  overflow: hidden;
}

body.home-page #hero .hero-pipe-video.product-photo--video video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: none !important;
  object-fit: contain;
  object-position: center;
}

@media (min-width: 1200px) {
  body.home-page #hero .hero-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(440px, 1.2fr) !important;
  }
}

@media (max-width: 900px) {
  body.home-page #hero .hero-panel--showcase {
    height: auto !important;
    max-width: min(100%, 560px);
    margin-inline: auto;
  }

  body.home-page #hero .hero-pipe-video.product-photo--video {
    min-height: min(72vw, 380px);
  }

  body.home-page #hero .hero-pipe-video.product-photo--video video {
    max-height: min(72vw, 380px) !important;
    height: auto;
    min-height: 0;
  }
}

/* Trust-bar — как на проде */
body.home-page .trust-bar {
  padding-block: clamp(18px, 2.5vw, 28px);
  border-bottom: 1px solid var(--bg-border);
}

body.home-page .trust-bar__inner {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  body.home-page .trust-bar__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.home-page .trust-bar__inner {
    grid-template-columns: 1fr;
  }
}

/* ── Секции ── */
body.home-page .section-heading .eyebrow {
  color: var(--home-green);
}

body.home-page .section-heading h2 {
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* ── Каталог: только CSS-сетка (без pin-scroll и горизонтальной ленты) ── */
body.home-page #products .catalog-grid-wrap {
  overflow: visible !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
  scroll-snap-type: none !important;
  touch-action: auto !important;
}

body.home-page #products .catalog-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  flex-wrap: unset !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 12px;
}

body.home-page #products .catalog-grid .catalog-card {
  flex: unset !important;
  width: auto !important;
  max-width: none !important;
  scroll-snap-align: unset !important;
}

body.home-page #products .catalog-grid.is-filtering,
body.home-page #products .catalog-grid.is-filtering .catalog-card:not(.is-filtered-out) {
  width: 100% !important;
  flex: unset !important;
}

@media (min-width: 768px) {
  body.home-page #products .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  body.home-page #products .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

body.home-page #products .catalog-card__media img {
  max-height: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body.home-page .catalog-scroll-hint {
  display: none !important;
}

/* ── Мобильный каталог: кнопки и медиа в сетке ── */
@media (max-width: 767px) {
  body.home-page #products .catalog-card {
    min-width: 0;
    overflow: hidden;
  }

  body.home-page #products .catalog-card__body {
    min-width: 0;
    padding-inline: 16px;
  }

  body.home-page #products .catalog-card__media {
    aspect-ratio: 4 / 3;
  }

  body.home-page #products .catalog-card__media img {
    object-fit: contain;
    object-position: center;
    padding: 8px;
    box-sizing: border-box;
  }

  body.home-page #products .catalog-card__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    grid-template-columns: unset;
  }

  body.home-page #products .catalog-card__btn-kp,
  body.home-page #products .catalog-card__btn-spec {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
  }

  body.home-page #calc .izc-host--home {
    min-height: 0;
  }

  body.home-page #calc .content-card:has(.tvk-spec-table) {
    margin-bottom: 12px;
  }

  body.home-page #calc .engineering-notes {
    margin-top: 16px;
  }
}

/* После таблицы: три карточки без «пустого» scroll-reveal */
body.home-page #calc .engineering-notes article,
body.home-page #calc .engineering-notes article[data-animate] {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* ═══════════════════════════════════════════════════════
   Polish — отзывы Claude / UX главной
   ═══════════════════════════════════════════════════════ */

body.home-page .header-phone--cta {
  font-size: clamp(1rem, 1.35vw, 1.2rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.45);
  box-shadow: 0 0 24px rgba(220, 38, 38, 0.15);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

body.home-page .header-phone--cta:hover {
  transform: translateY(-2px);
  background: rgba(220, 38, 38, 0.22);
  box-shadow: 0 8px 28px rgba(220, 38, 38, 0.35);
}

/* Hero: «дыхание» видео */
@keyframes tvkHeroVideoBreathe {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }
  50% {
    transform: scale(1.02);
    filter: brightness(1.06) saturate(1.08);
  }
}

@media (prefers-reduced-motion: no-preference) {
  body.home-page #hero .hero-pipe-video.product-photo--video video {
    animation: tvkHeroVideoBreathe 6s ease-in-out infinite;
  }
}

/* CTA: лёгкая пульсация */
@keyframes tvkCtaPulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
  }
  50% {
    box-shadow: 0 6px 32px rgba(220, 38, 38, 0.55), 0 0 0 3px rgba(220, 38, 38, 0.12);
  }
}

body.home-page .tvk-cta-pulse.btn-accent:hover,
body.home-page .tvk-cta-pulse.button-accent:hover {
  transform: translateY(-3px) scale(1.02);
}

@media (prefers-reduced-motion: no-preference) {
  body.home-page .tvk-cta-pulse.btn-accent,
  body.home-page .header-actions .tvk-cta-pulse {
    animation: tvkCtaPulse 2.4s ease-in-out infinite;
  }
}

body.home-page .btn-accent:not(.tvk-cta-pulse):hover,
body.home-page .button-accent:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

/* Каталог: lift + подсветка краёв */
body.home-page #products .catalog-card {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

body.home-page #products .catalog-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 201, 167, 0.45);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 201, 167, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    -2px 0 24px rgba(0, 201, 167, 0.12),
    2px 0 24px rgba(220, 38, 38, 0.1);
}

body.home-page #products .catalog-card__media img {
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.home-page #products .catalog-card:hover .catalog-card__media img {
  transform: scale(1.04);
}

/* Секция «В цифрах» — акцент при появлении */
body.home-page .tvk-lstat.is-inview .tvk-count,
body.home-page .tvk-lstat.visible .tvk-count {
  color: var(--home-red);
  text-shadow: 0 0 28px rgba(220, 38, 38, 0.25);
}

body.home-page .metric-card.is-inview .tvk-count,
body.home-page .metric-card.visible .tvk-count {
  color: var(--home-green);
}

@media (prefers-reduced-motion: reduce) {
  body.home-page #hero .hero-pipe-video.product-photo--video video,
  body.home-page .tvk-cta-pulse {
    animation: none !important;
  }

}
