/* Коммерческие блоки статей comptech.kz (docs/article-blocks.md).
   Палитра и кнопки — как у темы: жёлтый #F7C601, синий #327098, графит #292C30,
   Roboto в тексте, Ubuntu в заголовках, кнопки 12px uppercase со скруглением 16px. */
.ct-cb {
  --ct-yellow: #F7C601;
  --ct-yellow-h: #e7bd12;
  --ct-blue: #327098;
  --ct-dark: #292C30;
  --ct-muted: #5f646b;
  --ct-line: #e3e5e8;
  box-sizing: border-box;
  margin: 32px 0;
  padding: 24px 28px;
  border: 1px solid var(--ct-line);
  border-radius: 8px;
  background: #f6f7f8;
  color: #212529;
  font-family: Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  clear: both;
}
.ct-cb *, .ct-cb *::before, .ct-cb *::after { box-sizing: border-box; }
.ct-cb p, .ct-cb ul, .ct-cb ol, .ct-cb dl, .ct-cb dd { margin: 0; padding: 0; }
.ct-cb li { margin: 0; }
.ct-cb a { text-decoration: none; }

.ct-cb .ct-cb__title {
  font-family: Ubuntu, Roboto, sans-serif;
  font-weight: 500;
  font-size: 23px;
  line-height: 1.25;
  color: #212529;
  margin: 0 0 6px;
}
.ct-cb .ct-cb__title a { color: inherit; }
.ct-cb .ct-cb__title a:hover { color: var(--ct-blue); }
.ct-cb .ct-cb__lead { color: var(--ct-muted); margin: 0 0 16px; }
.ct-cb .ct-cb__small { font-size: 13px; color: var(--ct-muted); }
.ct-cb .ct-cb__eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ct-muted);
}
.ct-cb .ct-cb__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.ct-cb .ct-cb__foot {
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-top: 18px;
}
.ct-cb .ct-cb__foot--start { justify-content: flex-start; gap: 6px; margin-top: 14px; }

/* Кнопки — как .btn-head_custom темы */
.ct-cb .ct-cb-btn, .ct-cb button.ct-cb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 26px;
  border: 2px solid var(--ct-yellow); border-radius: 16px;
  background: var(--ct-yellow); color: #000;
  font: 700 12px/1.2 Roboto, Arial, sans-serif; text-transform: uppercase; letter-spacing: .02em;
  cursor: pointer; transition: background .2s, border-color .2s, color .2s;
  text-align: center;
}
.ct-cb .ct-cb-btn:hover { background: var(--ct-yellow-h); border-color: var(--ct-yellow-h); color: #000; }
.ct-cb .ct-cb-btn--sm { min-height: 38px; padding: 4px 18px; }
.ct-cb .ct-cb-btn--dark { background: var(--ct-dark); border-color: var(--ct-dark); color: #fff; }
.ct-cb .ct-cb-btn--dark:hover { background: #000; border-color: #000; color: #fff; }
.ct-cb .ct-cb-btn--line { background: transparent; border-color: var(--ct-dark); color: var(--ct-dark); }
.ct-cb .ct-cb-btn--line:hover { background: var(--ct-dark); border-color: var(--ct-dark); color: #fff; }
.ct-cb .ct-cb-btn--ghost { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.ct-cb .ct-cb-btn--ghost:hover { background: #fff; border-color: #fff; color: var(--ct-dark); }
.ct-cb .ct-cb-btn--tg { background: #229ed9; border-color: #229ed9; color: #fff; text-transform: none; font-size: 13px; }
.ct-cb .ct-cb-btn--tg:hover { background: #1b87bb; border-color: #1b87bb; color: #fff; }
.ct-cb .ct-cb-link { color: var(--ct-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ct-cb .ct-cb-link:hover { color: #1f4f6e; }
.ct-cb a:focus-visible, .ct-cb button:focus-visible, .ct-cb input:focus-visible, .ct-cb select:focus-visible,
.ct-sticky a:focus-visible {
  outline: 3px solid var(--ct-blue, #327098); outline-offset: 2px;
}

/* Поля */
.ct-cb .ct-cb-field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 13px; font-weight: 500; color: #212529; }
.ct-cb .ct-cb-field input, .ct-cb .ct-cb-field select {
  width: 100%; height: 44px; margin: 0; padding: 0 12px;
  border: 1px solid #c9ccd1; border-radius: 6px; background: #fff; color: #212529;
  font: 400 15px Roboto, Arial, sans-serif; box-shadow: none;
}
.ct-cb .ct-cb-field select { -webkit-appearance: auto; appearance: auto; }

/* 1. Калькулятор */
.ct-cb--calc { background: var(--ct-yellow); border-color: var(--ct-yellow); }
.ct-cb--calc .ct-cb__lead, .ct-cb--calc .ct-cb__small { color: #2b2b2b; }
.ct-cb-calc__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ct-cb-calc__grid .ct-cb-field input { border-color: rgba(0,0,0,.18); }
.ct-cb-calc__res { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.ct-cb-calc__res > div { background: #fff; border-radius: 8px; padding: 12px 16px; }
.ct-cb-calc__res span { display: block; font-size: 12.5px; color: var(--ct-muted); line-height: 1.3; }
.ct-cb-calc__res b { display: block; margin-top: 4px; font: 500 22px/1.2 Ubuntu, Roboto, sans-serif; color: #000; white-space: nowrap; }

/* 2. Цепочка оборудования */
.ct-cb .ct-cb-chain { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 22px; }
.ct-cb .ct-cb-chain li { position: relative; list-style: none; }
.ct-cb .ct-cb-chain li + li::before {
  content: "→"; position: absolute; left: -18px; top: 50%; transform: translateY(-50%);
  color: var(--ct-blue); font-weight: 700; font-size: 16px;
}
.ct-cb .ct-cb-chain__step {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 14px 12px;
  background: #fff; border: 1px solid var(--ct-line); border-radius: 8px; color: var(--ct-muted); font-size: 13px; line-height: 1.3;
  transition: border-color .2s, box-shadow .2s;
}
.ct-cb .ct-cb-chain__step:hover { border-color: var(--ct-yellow); box-shadow: 0 4px 14px rgba(0,0,0,.08); color: var(--ct-muted); }
.ct-cb .ct-cb-chain__step b { color: #212529; font-size: 15px; font-weight: 700; }
.ct-cb .ct-cb-chain__n {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-bottom: 6px;
  border-radius: 50%; background: var(--ct-yellow); color: #000; font-weight: 700; font-size: 13px;
}

/* 3. Подбор */
.ct-cb .ct-cb-selector { display: grid; grid-template-columns: minmax(0, 320px) max-content; gap: 12px; align-items: end; margin: 4px 0 0; }
.ct-cb .ct-cb-sel__count { margin: 14px 0 8px; }
.ct-cb .ct-cb-sel__count b { color: #212529; }
.ct-cb .ct-cb-sel__list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ct-cb .ct-cb-sel__list li { list-style: none; margin: 0; }
.ct-cb .ct-cb-sel__list li[hidden] { display: none; }
.ct-cb .ct-cb-sel__list a {
  display: flex; align-items: center; gap: 10px; height: 100%; padding: 8px 10px;
  background: #fff; border: 1px solid var(--ct-line); border-radius: 8px; color: #212529; font-size: 14px; line-height: 1.25; font-weight: 500;
  transition: border-color .2s;
}
.ct-cb .ct-cb-sel__list a:hover { border-color: var(--ct-yellow); color: var(--ct-blue); }
.ct-cb .ct-cb-sel__list img, .ct-cb .ct-cb-sel__noimg { flex: 0 0 48px; width: 48px; height: 48px; margin: 0; object-fit: contain; border-radius: 4px; }

/* 4/7. Товар */
.ct-cb--prod { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: center; background: #fff; }
.ct-cb .ct-cb-prod__img { display: block; width: 200px; height: 200px; border-radius: 8px; background: #fff; overflow: hidden; }
.ct-cb .ct-cb-prod__img img { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0; }
.ct-cb--prod .ct-cb__title { font-size: 21px; margin: 4px 0 6px; }
.ct-cb--prod .ct-cb__lead { margin-bottom: 10px; }
.ct-cb .ct-cb-prod__spec { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 6px 0 0; }
.ct-cb .ct-cb-prod__spec dt { font-size: 12.5px; font-weight: 400; color: var(--ct-muted); }
.ct-cb .ct-cb-prod__spec dd { font-size: 15px; font-weight: 700; color: #212529; }
.ct-cb--upgrade { border-color: var(--ct-yellow); }

/* 5. Комплекты */
.ct-cb.ct-cb--kits { background: transparent; border: 0; padding: 0; }
.ct-cb .ct-cb-kits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ct-cb .ct-cb-kits--1 { grid-template-columns: minmax(0, 1fr); }
.ct-cb .ct-cb-kits--2, .ct-cb .ct-cb-kits--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ct-cb .ct-cb-kit {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; background: #f6f7f8; border: 1px solid var(--ct-line); border-radius: 8px;
}
.ct-cb .ct-cb-kit__tag {
  align-self: flex-start; padding: 3px 10px; border-radius: 12px; background: var(--ct-dark); color: #fff;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
}
.ct-cb .ct-cb-kit__name { font: 500 18px/1.25 Ubuntu, Roboto, sans-serif; color: #212529; }
.ct-cb .ct-cb-kit ul { list-style: none; margin: 0 0 6px; flex: 1; }
.ct-cb .ct-cb-kit li { position: relative; padding-left: 16px; font-size: 14px; list-style: none; }
.ct-cb .ct-cb-kit li + li { margin-top: 4px; }
.ct-cb .ct-cb-kit li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--ct-yellow); }
.ct-cb .ct-cb-kit .ct-cb-btn { align-self: flex-start; }
.ct-cb--kits > .ct-cb__small { margin-top: 10px; }

/* 6. Пневмоаудит */
.ct-cb--audit { background: var(--ct-dark); border-color: var(--ct-dark); color: #fff; }
.ct-cb--audit .ct-cb__title { color: #fff; font-size: 24px; }
.ct-cb--audit .ct-cb__lead { color: #c9cbd1; }
.ct-cb .ct-cb-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
.ct-cb .ct-cb-facts > div { padding: 12px 14px; border-radius: 8px; background: rgba(255,255,255,.07); }
.ct-cb .ct-cb-facts b { display: block; color: var(--ct-yellow); font: 500 19px/1.2 Ubuntu, Roboto, sans-serif; }
.ct-cb .ct-cb-facts span { display: block; margin-top: 4px; color: #c9cbd1; font-size: 12.5px; line-height: 1.3; }

/* 8. Финальный CTA (глобально, после статьи) */
.ct-cb--final {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: center;
  margin: 40px 0 8px; padding: 28px 32px; border-color: var(--ct-yellow);
}
.ct-cb--final .ct-cb__title { font-size: 26px; }
.ct-cb--final .ct-cb__lead { margin-bottom: 12px; }
.ct-cb .ct-cb-final__contacts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
.ct-cb .ct-cb-final__contacts a { color: var(--ct-blue); font-weight: 500; }
.ct-cb .ct-cb-final__contacts a:first-child { color: #212529; font-weight: 900; font-size: 18px; }
.ct-cb .ct-cb-final__contacts a:hover { text-decoration: underline; }
.ct-cb .ct-cb-final__actions { display: flex; flex-direction: column; gap: 10px; }

/* 9. Sticky-панель (только мобильные) */
.ct-sticky { display: none; }
@media (max-width: 767px) {
  .ct-sticky {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 99;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.12);
  }
  .ct-sticky a {
    display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px;
    font: 700 13px/1.1 Roboto, Arial, sans-serif; text-decoration: none; text-align: center;
  }
  .ct-sticky__call { background: var(--ct-dark, #292C30); color: #fff; }
  .ct-sticky__wa { background: #25d366; color: #fff; }
  .ct-sticky__tg { background: #229ed9; color: #fff; }
  .ct-sticky__form { background: #F7C601; color: #000; text-transform: uppercase; font-size: 12px !important; }
  .ct-sticky a:hover, .ct-sticky a:focus { color: inherit; opacity: .92; }
  .ct-sticky__call:hover, .ct-sticky__wa:hover, .ct-sticky__tg:hover { color: #fff !important; }
  /* место под панель: подвал не уходит под неё, плашка cookies и бейдж reCAPTCHA — выше неё */
  body.ct-cb-sticky-on { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  body.ct-cb-sticky-on #cookie-consent { bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  body.ct-cb-sticky-on .grecaptcha-badge { bottom: calc(74px + env(safe-area-inset-bottom)) !important; }
}

/* Адаптив */
@media (max-width: 991px) {
  .ct-cb-calc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-cb .ct-cb-chain { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ct-cb .ct-cb-chain li + li::before { display: none; }
  .ct-cb .ct-cb-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-cb .ct-cb-sel__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ct-cb { padding: 18px 16px; margin: 24px 0; }
  .ct-cb .ct-cb__title { font-size: 20px; }
  .ct-cb-calc__res { grid-template-columns: minmax(0, 1fr); }
  .ct-cb .ct-cb-selector { grid-template-columns: minmax(0, 1fr); }
  .ct-cb .ct-cb-sel__list { grid-template-columns: minmax(0, 1fr); }
  .ct-cb--prod { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
  .ct-cb .ct-cb-prod__img { width: 96px; height: 96px; }
  .ct-cb--prod .ct-cb__title { font-size: 18px; }
  .ct-cb--prod .ct-cb-prod__body > .ct-cb__row, .ct-cb--prod .ct-cb-prod__spec { grid-column: 1 / -1; }
  .ct-cb .ct-cb-kits, .ct-cb .ct-cb-kits--2, .ct-cb .ct-cb-kits--4 { grid-template-columns: minmax(0, 1fr); }
  .ct-cb--final { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
  .ct-cb--final .ct-cb__title { font-size: 22px; }
  .ct-cb .ct-cb__foot { justify-content: flex-start; }
}
@media (max-width: 420px) {
  .ct-cb-calc__grid { grid-template-columns: minmax(0, 1fr); }
  .ct-cb .ct-cb-chain { grid-template-columns: minmax(0, 1fr); }
  .ct-cb .ct-cb__row .ct-cb-btn { flex: 1 1 100%; }
}
