/* Блок пунктов разработки на страницах /can/* — новый вид (include/can-service.php).
   Слева картинка пункта со стрелками, справа вкладки-иконки, название и текст пункта по клику.
   Все классы с префиксом b2cs-: в style.css много общих классов, которые иначе протекают. */

.b2cs {
  display: flex;
  align-items: center;
  gap: 40px;
  margin: 10px 0 40px;
  color: #6e808e;
  font-family: 'Gilroy', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 300;
}

/* ---------- картинка ---------- */
.b2cs-media {
  flex: 0 0 48%;
  min-width: 0;
}
.b2cs-stage {
  position: relative;
  display: grid;
  margin: 0 34px;
  touch-action: pan-y;
}
/* картинки всех пунктов лежат в одной ячейке, видна активная — смена плавная и без скачка высоты;
   картинка других пропорций, чем соседние, встаёт по центру ячейки */
.b2cs-img {
  grid-area: 1 / 1;
  align-self: center;
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility 0s linear .35s;
}
.b2cs-img.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .35s ease, visibility 0s;
}

/* стрелки — как у прежнего блока (тот же шеврон, серый → голубой) */
.b2cs-arrow {
  position: absolute;
  top: 50%;
  width: 34px;
  height: 56px;
  margin-top: -28px;
  padding: 0;
  border: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='37' viewBox='0 0 20 37'%3E%3Cpath fill='none' stroke='%23737f8b' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M18.5 1.5l-17 17 17 17'/%3E%3C/svg%3E") no-repeat center / 20px 37px;
  cursor: pointer;
  z-index: 2;
}
.b2cs-arrow:hover,
.b2cs-arrow:focus-visible {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='37' viewBox='0 0 20 37'%3E%3Cpath fill='none' stroke='%2300d1f8' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M18.5 1.5l-17 17 17 17'/%3E%3C/svg%3E");
}
.b2cs-arrow:focus { outline: none; }
.b2cs-arrow:focus-visible { outline: 2px solid #00d1f8; outline-offset: 2px; }
.b2cs-arrow--prev { left: -34px; }
.b2cs-arrow--next { right: -34px; transform: scaleX(-1); }

.b2cs-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.b2cs-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d3dde3;
  cursor: pointer;
  transition: background .2s;
}
.b2cs-dot.is-active { background: #00d1f8; }

/* ---------- вкладки и текст ---------- */
.b2cs-panel {
  flex: 1 1 auto;
  min-width: 0;
}
.b2cs-tabs {
  display: grid;
  grid-template-columns: repeat(var(--b2cs-n, 9), minmax(0, 1fr));
  border-bottom: 1px solid #e3eaef;
  margin-bottom: 26px;
}
.b2cs-tab {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 -1px;
  padding: 6px 2px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: border-color .2s;
}
.b2cs-tab:focus { outline: none; }
.b2cs-tab:focus-visible { outline: 2px solid #00d1f8; outline-offset: -2px; }
.b2cs-tab.is-active { border-bottom-color: #00d1f8; }
.b2cs-ico {
  display: block;
  width: 36px;
  height: 36px;
  max-width: 100%;
  object-fit: contain;
}
/* серая иконка, при наведении и у активной — голубая */
.b2cs-ico--on,
.b2cs-tab:hover .b2cs-ico,
.b2cs-tab.is-active .b2cs-ico { display: none; }
.b2cs-tab:hover .b2cs-ico--on,
.b2cs-tab.is-active .b2cs-ico--on { display: block; }

/* тексты всех пунктов в одной ячейке: высота области = самый длинный текст, страница не прыгает */
.b2cs-panes { display: grid; }
.b2cs-pane {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.b2cs-pane.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease .05s, visibility 0s;
}
.b2cs .b2cs-title {
  margin: 0 0 12px;
  padding: 0;
  font: 800 18px/1.3 'Gilroy', 'Helvetica Neue', Arial, sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #6e808e;
}
.b2cs-text {
  font-size: 16px;
  line-height: 1.55;
}
.b2cs-text p { margin: 0 0 10px; }
.b2cs-text p:last-child { margin-bottom: 0; }

/* ---------- уже 990px (контейнер резиновый): колонкой ---------- */
@media (max-width: 989px) {
  .b2cs {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
    padding: 0 15px;
  }
  .b2cs-media {
    flex: none;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }
  .b2cs-img { max-height: 340px; }
}
@media (max-width: 639px) {
  .b2cs { margin: 0 0 30px; gap: 18px; }
  .b2cs-img { max-height: 260px; }
  .b2cs-dots { display: none; }
  /* иконки — двумя ровными строками, активная — голубая плитка вместо подчёркивания */
  .b2cs-tabs {
    grid-template-columns: repeat(var(--b2cs-cols-m, 5), minmax(0, 1fr));
    gap: 6px;
    border-bottom: 0;
    margin-bottom: 18px;
  }
  .b2cs-tab {
    margin: 0;
    padding: 9px 2px;
    border: 0;
    border-radius: 8px;
    transition: background .2s;
  }
  .b2cs-tab.is-active { background: #e6f9fe; }
  .b2cs-ico { width: 34px; height: 34px; }
  .b2cs-text { font-size: 15px; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .b2cs-img, .b2cs-img.is-active,
  .b2cs-pane, .b2cs-pane.is-active { transition: none; }
}
