/* slider.css — цвета карусели «Продукция», раньше задавались в slider.js.
   Палитра берётся из :root (main.css / states.css):
   --accent / --accent-rgb — красный, --cool-light / --cool-rgb — синий.
   Подключать после main.css и states.css. */

/* ---------- Тон слайда ---------- */
[data-tk-tone="hot"] {
  --tk-accent:     var(--accent, #E30613);
  --tk-glow-rgb:   var(--accent-rgb, 227, 6, 19);
  --tk-glow-alpha: .18;
}
[data-tk-tone="cool"] {
  --tk-accent:     var(--cool-light, #4D93FF);
  --tk-glow-rgb:   var(--cool-rgb, 0, 102, 255);
  --tk-glow-alpha: .2;
}
/* у третьего слайда свечение было чуть слабее */
[data-tk-slide="3"] {
  --tk-glow-alpha: .16;
}

/* ---------- Подпись «01 / ОХЛАЖДЕНИЕ» ---------- */
#tkIdx {
  color: var(--tk-accent);
  transition: color 300ms;
}

/* ---------- Фоновое свечение ---------- */
#tkGlow {
  background: radial-gradient(circle,
    rgba(var(--tk-glow-rgb), var(--tk-glow-alpha)),
    rgba(var(--tk-glow-rgb), 0) 70%);
}

/* ---------- Точки навигации ---------- */
.tk-dot {
  background: #3F424D;
  transition: background 300ms;
}
.tk-dot.is-active {
  background: var(--tk-accent);
}

/* ---------- Фокус с клавиатуры ---------- */
#tkSlide:focus-visible {
  outline: 2px solid var(--tk-accent);
  outline-offset: 4px;
}

/* =====================================================================
   Подача слайдов: смена, автопрокрутка, картинка
   ===================================================================== */

/* ---------- Плавная смена слайда (класс .is-out ставит slider.js на 260 мс) ---------- */
.tk-text > *,
.tk-imgwrap {
  transition: opacity 260ms ease, transform 420ms cubic-bezier(.22, 1, .36, 1);
}
.tk-text > :nth-child(2) { transition-delay: 40ms; }
.tk-text > :nth-child(3) { transition-delay: 80ms; }

.tk-slide.is-out .tk-text > *            { opacity: 0; transform: translateX(-18px); }
.tk-slide.is-out .tk-imgwrap             { opacity: 0; transform: translateX(28px) scale(.98); }
.tk-slide.is-out[data-dir="prev"] .tk-text > * { transform: translateX(18px); }
.tk-slide.is-out[data-dir="prev"] .tk-imgwrap  { transform: translateX(-28px) scale(.98); }

/* ---------- Картинка: «садим» вырезку в сцену ----------
   Мягкая тень под изделием и лёгкое парение — край вырезки перестаёт
   читаться как обрезанный, изделие выглядит частью композиции. */
.tk-slide { position: relative; }
.tk-imgwrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tk-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .55)) drop-shadow(0 4px 8px rgba(0, 0, 0, .35));
}
/* картинка и слой теплового потока парят вместе — слой не съезжает с трубок */
.tk-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: tk-float 7s ease-in-out infinite;
}
/* пятно света под изделием, в цвете слайда */
.tk-imgwrap::before {
  content: "";
  position: absolute;
  left: 12%; right: 12%; bottom: 6%;
  height: 22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--tk-glow-rgb, 227, 6, 19), .16), transparent);
  filter: blur(8px);
  pointer-events: none;
}
@keyframes tk-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ---------- Индикатор автопрокрутки ---------- */
.tk-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
  pointer-events: none;
}
.tk-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(var(--tk-glow-rgb, 227, 6, 19), .4), var(--tk-accent));
  transform-origin: left center;
  transform: scaleX(var(--tk-progress, 0));
}
.tk-slide.is-paused .tk-progress::after { opacity: .45; }

/* ---------- Кнопка пауза / продолжить ---------- */
.tk-play {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .14);
  background: transparent;
  color: #B2B6CA;
  cursor: pointer;
  transition: color 200ms, border-color 200ms;
}
.tk-play:hover { color: #fff; border-color: var(--tk-accent); }
.tk-play .tk-play__resume { display: none; }
.tk-play[aria-pressed="true"] .tk-play__pause  { display: none; }
.tk-play[aria-pressed="true"] .tk-play__resume { display: block; }

/* ---------- Точки: при большом числе слайдов — тонкие сегменты ---------- */
.tk-dots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-dot  { cursor: pointer; transition: background 300ms, width 300ms; }
.tk-dots.is-compact .tk-dot {
  width: 10px; height: 3px; padding: 0; border: 0; border-radius: 2px;
}
.tk-dots.is-compact .tk-dot.is-active { width: 26px; }
.tk-dot:focus-visible { outline: 2px solid var(--tk-accent); outline-offset: 3px; }

/* ---------- Пользователь отключил анимацию в системе ---------- */
@media (prefers-reduced-motion: reduce) {
  .tk-text > *, .tk-imgwrap { transition: none; }
  .tk-stage { animation: none; }
}

/* =====================================================================
   Характеристики изделия (dl#tkSpecs)
   Плашки «название — значение» в инженерной подаче: моноширинные подписи,
   тонкие рамки, мощность — крупно с акцентной чертой слева.
   ===================================================================== */
.tk-specs {
  --tk-spec-line: rgba(255, 255, 255, .08);
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;                                   /* сетка «по линейке»: линии — это фон */
  background: var(--tk-spec-line);
  border: 1px solid var(--tk-spec-line);
  max-width: 560px;
}
.tk-spec {
  position: relative;
  margin: 0;
  padding: 14px 16px 15px;
  background: #141922;
  min-width: 0;
}
/* нечётная последняя плашка тянется на всю ширину — без «дыры» в сетке */
.tk-specs > .tk-spec:last-child:not(.tk-spec--main):nth-child(even) { grid-column: 1 / -1; }

.tk-spec dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #75798C;
}
/* иконка параметра — цвет акцента слайда (красный / синий) */
.tk-spec dt::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--tk-accent, #E30613);
  -webkit-mask: var(--tk-icon) center / contain no-repeat;
          mask: var(--tk-icon) center / contain no-repeat;
  opacity: .9;
}
.tk-spec dd {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.4;
  color: #E9E9ED;
  overflow-wrap: anywhere;
}

/* главный параметр — мощность */
.tk-spec--main {
  grid-column: 1 / -1;
  padding: 16px 18px 18px 20px;
  background:
    linear-gradient(90deg, rgba(var(--tk-glow-rgb, 227, 6, 19), .10), transparent 70%),
    #141922;
}
.tk-spec--main::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--tk-accent, #E30613);
}
.tk-spec--main dd {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.1;
  letter-spacing: -.01em;
  font-weight: 500;
}

/* иконки: тонкие линии, рисуются цветом через mask */
.tk-spec[data-icon="power"] { --tk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.tk-spec[data-icon="temp"]  { --tk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M14 14.8V4.5a2.5 2.5 0 0 0-5 0v10.3a4.5 4.5 0 1 0 5 0z'/%3E%3Cpath d='M11.5 10v7'/%3E%3C/svg%3E"); }
.tk-spec[data-icon="sink"]  { --tk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 20h18M6 20V9M10 20V5M14 20V5M18 20V9'/%3E%3C/svg%3E"); }
.tk-spec[data-icon="pos"]   { --tk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.7'/%3E%3Cpath d='M20 4v4h-4'/%3E%3C/svg%3E"); }
.tk-spec[data-icon="len"]   { --tk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h18M3 8v8M21 8v8M8 10v4M13 10v4'/%3E%3C/svg%3E"); }
.tk-spec[data-icon="dot"]   { --tk-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3C/svg%3E"); }

/* плашки появляются по очереди при смене слайда */
.tk-spec {
  transition: opacity 260ms ease, transform 420ms cubic-bezier(.22, 1, .36, 1);
  transition-delay: calc(var(--i, 0) * 45ms + 60ms);
}
.tk-slide.is-out .tk-spec { opacity: 0; transform: translateY(8px); transition-delay: 0ms; }

/* на телефоне — одна колонка */
@media (max-width: 640px) {
  .tk-specs { grid-template-columns: 1fr; }
  .tk-specs > .tk-spec:last-child:not(.tk-spec--main):nth-child(even) { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .tk-spec { transition: none; }
}
