/* Карусель баннеров autopartskaz.kz — чистый CSS, без зависимостей.
   Тема выбирается классом на .bn: bn--graphite | bn--steel | bn--road | bn--teal | bn--burgundy.
   Все цвета — в переменных ниже. */

:root {
  --bn-font: inherit;
  --bn-radius: 10px;
  --bn-max: 1200px;
  --bn-h: 320px;
  --bn-h-m: 240px;
}

/* ───────── Темы ───────── */
.bn--graphite {
  --bn-bg: #16191d; --bn-fg: #f4f6f8; --bn-sub: #aab3bd;
  --bn-chip-bg: rgba(200,245,66,.14); --bn-chip-fg: #c8f542;
  --bn-btn-bg: #c8f542; --bn-btn-fg: #14171a; --bn-btn-hover: #dcff6b;
  --bn-panel: #1f2328; --bn-edge: #c8f542;
  --bn-ctl-bg: rgba(255,255,255,.10); --bn-ctl-fg: #fff; --bn-ctl-hover: rgba(255,255,255,.2);
  --bn-dot: rgba(255,255,255,.30); --bn-dot-on: #c8f542;
}
.bn--steel {
  --bn-bg: #eef1f5; --bn-fg: #0f1b33; --bn-sub: #4b5871;
  --bn-chip-bg: rgba(31,79,216,.10); --bn-chip-fg: #1a43b8;
  --bn-btn-bg: #1f4fd8; --bn-btn-fg: #fff; --bn-btn-hover: #1740b0;
  --bn-panel: #dde5f1; --bn-edge: #1f4fd8;
  --bn-ctl-bg: #fff; --bn-ctl-fg: #0f1b33; --bn-ctl-hover: #e3e9f2;
  --bn-dot: rgba(15,27,51,.25); --bn-dot-on: #1f4fd8;
}
.bn--road {
  --bn-bg: #ffc21a; --bn-fg: #15171a; --bn-sub: #3a3320;
  --bn-chip-bg: #15171a; --bn-chip-fg: #ffc21a;
  --bn-btn-bg: #15171a; --bn-btn-fg: #fff; --bn-btn-hover: #2e3238;
  --bn-panel: #f2b100; --bn-edge: #15171a;
  --bn-ctl-bg: #15171a; --bn-ctl-fg: #ffc21a; --bn-ctl-hover: #2e3238;
  --bn-dot: rgba(21,23,26,.30); --bn-dot-on: #15171a;
}
.bn--teal {
  --bn-bg: #0b4f5c; --bn-fg: #fff; --bn-sub: #bfe0e3;
  --bn-chip-bg: rgba(255,106,61,.20); --bn-chip-fg: #ffb59c;
  --bn-btn-bg: #ff6a3d; --bn-btn-fg: #06262c; --bn-btn-hover: #ff845f;
  --bn-panel: #0a3f4a; --bn-edge: #ff6a3d;
  --bn-ctl-bg: rgba(255,255,255,.12); --bn-ctl-fg: #fff; --bn-ctl-hover: rgba(255,255,255,.22);
  --bn-dot: rgba(255,255,255,.30); --bn-dot-on: #ff6a3d;
}
.bn--burgundy {
  --bn-bg: #f4efe6; --bn-fg: #2a1519; --bn-sub: #6b565a;
  --bn-chip-bg: rgba(122,31,43,.10); --bn-chip-fg: #7a1f2b;
  --bn-btn-bg: #7a1f2b; --bn-btn-fg: #fff; --bn-btn-hover: #5e1620;
  --bn-panel: #7a1f2b; --bn-edge: #c9a45c;
  --bn-ctl-bg: #fff; --bn-ctl-fg: #2a1519; --bn-ctl-hover: #efe3d3;
  --bn-dot: rgba(42,21,25,.25); --bn-dot-on: #7a1f2b;
}

.bn--site {
  --bn-bg: #faf3e9; --bn-fg: #22262b; --bn-sub: #5b646f;
  --bn-chip-bg: rgba(232,53,46,.10); --bn-chip-fg: #c9241d;
  --bn-btn-bg: #e8352e; --bn-btn-fg: #fff; --bn-btn-hover: #c9241d;
  --bn-panel: #fff; --bn-edge: #e8352e;
  --bn-ctl-bg: #22262b; --bn-ctl-fg: #fff; --bn-ctl-hover: #3a4047;
  --bn-dot: rgba(34,38,43,.25); --bn-dot-on: #e8352e;
  border: 1px solid #e3e6ea;
}
.bn--site .bn-slide { box-shadow: inset 8px 0 0 #e8352e; }

/* ───────── Каркас ───────── */
.bn {
  position: relative;
  width: 100%;
  max-width: var(--bn-max);
  margin: 0 auto;
  border-radius: var(--bn-radius);
  overflow: hidden;
  background: var(--bn-bg);
  color: var(--bn-fg);
  font-family: var(--bn-font);
  container-type: inline-size;
  -webkit-tap-highlight-color: transparent;
}
.bn *, .bn *::before, .bn *::after { box-sizing: border-box; }

.bn-viewport { position: relative; height: var(--bn-h); touch-action: pan-y; }

.bn-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 0 72px 14px 72px;
  background: var(--bn-bg);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.bn-slide.is-active { opacity: 1; visibility: visible; transition: opacity .4s ease .25s; }

/* диагональная панель под иллюстрацией + тонкая кромка */
.bn-slide::before,
.bn-slide::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 46%; pointer-events: none; }
.bn-slide::after  { background: var(--bn-panel); clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); }
.bn-slide::before { background: var(--bn-edge);  clip-path: polygon(18% 0, 19.4% 0, 1.4% 100%, 0 100%); z-index: 1; }

.bn-text {
  position: relative; z-index: 2;
  max-width: 560px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  transform: translateX(-14px); transition: transform .7s ease;
}
.bn-slide.is-active .bn-text { transform: none; }

.bn-chip {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 12px; border-radius: 6px;
  background: var(--bn-chip-bg); color: var(--bn-chip-fg);
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.bn-title { margin: 0; font-size: 42px; line-height: 1.08; font-weight: 800; letter-spacing: -.015em; text-wrap: balance; }
.bn-sub   { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 500; color: var(--bn-sub); }
.bn-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; margin-top: 8px; padding: 0 28px;
  border-radius: var(--bn-radius);
  background: var(--bn-btn-bg); color: var(--bn-btn-fg);
  font: 700 17px/1 var(--bn-font); text-decoration: none;
  transition: background-color .2s ease, transform .2s ease;
}
.bn-btn:hover { background: var(--bn-btn-hover); }
.bn-btn:active { transform: translateY(1px); }
.bn-btn:focus-visible, .bn-arrow:focus-visible, .bn-dot:focus-visible { outline: 3px solid var(--bn-dot-on); outline-offset: 3px; }

.bn-art {
  position: absolute; z-index: 2; right: 40px; top: 0; bottom: 14px; width: 40%;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.bn-art img { display: block; width: 100%; height: 88%; object-fit: contain; }

/* стрелки */
.bn-arrow {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: var(--bn-ctl-bg); color: var(--bn-ctl-fg); cursor: pointer;
  display: grid; place-items: center;
  transition: background-color .2s ease;
}
.bn-arrow:hover { background: var(--bn-ctl-hover); }
.bn-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bn-prev { left: 14px; }
.bn-next { right: 14px; }

/* точки */
.bn-dots { position: absolute; z-index: 3; left: 0; right: 0; bottom: 10px; display: flex; justify-content: flex-start; padding-left: 60px; gap: 4px; }
.bn-dot { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.bn-dot::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--bn-dot); transition: width .3s ease, background-color .3s ease; }
.bn-dot[aria-current="true"]::before { width: 24px; background: var(--bn-dot-on); }

/* ───────── Телефон: ширина контейнера ≤ 640px ───────── */
@container (max-width: 640px) {
  .bn-viewport { height: var(--bn-h-m); }
  .bn-slide { padding: 0 16px 20px 20px; }
  .bn-slide::after  { width: 44%; clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%); }
  .bn-slide::before { width: 44%; clip-path: polygon(24% 0, 26% 0, 2% 100%, 0 100%); }
  .bn-text { max-width: calc(100% - 140px); gap: 6px; }
  .bn-chip { display: none; }
  .bn-title { font-size: 20px; line-height: 1.12; }
  .bn-sub { font-size: 14px; line-height: 1.3; }
  .bn-btn { height: 44px; margin-top: 8px; padding: 0 20px; font-size: 15px; }
  .bn-art { right: 4px; top: auto; bottom: 26px; width: 36%; height: 56%; }
  .bn-art img { height: 100%; }
  .bn-arrow { display: none; }
  .bn-dots { padding-left: 12px; bottom: 0; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .bn-slide, .bn-text, .bn-btn, .bn-dot::before { transition: none; }
}

/* ───────── Фото вместо рисунка (autopartskaz, 14.10) ───────── */
.bn-slide::before { z-index: 2; }
.bn-photo {
  position: absolute; z-index: 1; top: 0; bottom: 0; right: 0; width: 46%;
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); overflow: hidden; background: var(--bn-panel);
}
.bn-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bn-photo-map {
  position: absolute; right: 14px; top: 14px; width: 46%; padding: 4px 6px;
  border-radius: 10px; background: rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.bn-photo-map img { display: block; width: 100%; height: auto; }
@container (max-width: 640px) {
  .bn-photo { width: 44%; clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%); }
  .bn-photo-map { width: 74%; right: 6px; top: auto; bottom: 26px; padding: 2px 4px; border-radius: 8px; }
}

/* ───────── встройка в autopartskaz.kz ───────── */
.promo-carousel { padding: 16px 0 0; }
.bn .bn-title { color: var(--bn-fg); text-transform: none; font-size: 42px; margin: 0; }
.bn .bn-sub { margin: 0; }
@container (max-width: 640px) { .bn .bn-title { font-size: 20px; } }
