/* Банери. Кольори однакові в обох темах, щоб було видно і чорні, і білі речі. */
.carousel { margin-bottom: 56px; touch-action: pan-y; }
/* вигляд банера залежить від ширини блока, а не вікна: так адмінка показує телефон і компʼютер поруч */
.carousel, .bn-size { container: banner / inline-size; }
.slides { display: grid; overflow: hidden; border-radius: var(--radius); }
.hero { position: relative; isolation: isolate; --wx: var(--d-wx, 0px); --wy: var(--d-wy, 0px); --bx: var(--d-bx, 0px); --by: var(--d-by, 0px); --img: var(--d-img, 1); --rot: var(--d-rot, 0deg); --x: var(--d-x, 0%); --y: var(--d-y, 0%); --btn: var(--d-btn, 1); --title: var(--d-title, 1); }
.hero-text { position: relative; z-index: 3; translate: var(--wx) var(--wy); }
.hero-text .btn { translate: var(--bx) var(--by); }
.hero-pic { position: relative; z-index: 1; }
/* декоративні шари: порядок у списку — порядок накладання */
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx.at-front { z-index: 2; }
.fx.at-top { z-index: 4; }
.hero-art { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; translate: var(--x) var(--y); rotate: var(--rot); scale: var(--img); }
.hero-extra { position: absolute; z-index: 3; margin: 0; left: var(--d-tx); top: var(--d-ty); max-width: calc(100% - var(--d-tx)); font-weight: 700; font-size: calc(1.2rem * var(--d-ts)); line-height: 1.2; overflow-wrap: anywhere; pointer-events: none; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch; min-height: 420px; overflow: hidden; border-radius: var(--radius); color: #fff;
  background: radial-gradient(circle at 76% 50%, #6c72e8 0, transparent 46%), linear-gradient(115deg, var(--kosmos) 0%, var(--impuls) 70%); }
.hero.style-tin { background: radial-gradient(circle at 76% 50%, #6a2547 0, transparent 48%), linear-gradient(115deg, #05060f 0%, var(--tin) 45%, var(--kosmos) 100%); }
.hero.style-tsil { background: radial-gradient(circle at 76% 50%, #ff6a80 0, transparent 46%), linear-gradient(115deg, #7c0a24 0%, var(--urazhennia) 55%, var(--tsil) 100%); }
.hero.style-blik { color: var(--tin); background: radial-gradient(circle at 76% 50%, #fff 0, transparent 50%), linear-gradient(115deg, #dfe1e6 0%, #c9ccd4 100%); }

/* усі слайди в одній клітинці: висота не стрибає при зміні */
.slides > .slide { grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s .7s; }
.slides > .slide.on { opacity: 1; visibility: visible; transition: opacity .7s ease; }
.slides .hero-text > *, .slides .hero-pic { transition: transform .8s cubic-bezier(.2, .7, .2, 1), opacity .8s ease; }
.slides .slide:not(.on) .hero-text > * { opacity: 0; transform: translateY(18px); }
.slides .slide:not(.on) .hero-pic { opacity: 0; transform: translateX(60px); }
.slides .slide.on .hero-text > :nth-child(2) { transition-delay: .08s; }
.slides .slide.on .hero-text > :nth-child(3) { transition-delay: .16s; }
.slides .slide.on .hero-text > :nth-child(4) { transition-delay: .24s; }

.hero-text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 48px 56px; min-width: 0; }
.hero-kicker { margin: 0 0 14px; padding: 4px 12px; background: var(--tsil); color: var(--tin); font-weight: 700; }
.style-tsil .hero-kicker { background: #fff; }
.hero h2 { font-size: calc(clamp(2.2rem, 4.6cqw, 4rem) * var(--title)); line-height: .98; margin: 0 0 14px; overflow-wrap: anywhere; }
.hero-sub { margin: 0 0 28px; font-size: 1.3rem; max-width: 32ch; }
.hero .btn { background: #fff; border-color: #fff; color: var(--tin); font-size: calc(1rem * var(--btn)); padding: calc(14px * var(--btn)) calc(34px * var(--btn)); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.hero.style-blik .btn { background: var(--tin); border-color: var(--tin); color: #fff; }
/* власні кольори поверх стилю */
.hero.own-bg { background: radial-gradient(circle at 76% 50%, color-mix(in srgb, var(--c-bg), #fff 28%) 0, transparent 46%), var(--c-bg); }
.hero.own-text { color: var(--c-text); }
.hero.own-btn .btn { background: var(--c-btn); border-color: var(--c-btn); }
.hero.own-btnText .btn { color: var(--c-btnText); }

.hero-pic { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 300px; padding: 28px 32px; }
.hero-pic img { flex: 1 1 0; min-width: 0; width: 0; height: 340px; object-fit: contain; filter: drop-shadow(0 22px 28px rgb(5 6 20 / .5)); visibility: hidden; }
.hero-pic img.ready { visibility: visible; }
.hero-pic img.boxed { background: var(--blik); filter: none; object-fit: cover; box-shadow: 0 22px 40px rgb(5 6 20 / .4); }
/* кілька товарів стають віялом */
.hero-pic img + img { margin-left: -6%; }
.hero-pic.count-2 img { height: 300px; }
.hero-pic.count-3 img, .hero-pic.count-4 img, .hero-pic.count-5 img { height: 250px; }
.hero-pic:not(.count-1) img:nth-child(odd) { transform: translateY(-22px) rotate(-3deg); }
.hero-pic:not(.count-1) img:nth-child(even) { transform: translateY(22px) rotate(3deg); position: relative; }

.stage { position: relative; }
/* з мишею стрілки проявляються при наведенні; на телефоні видно завжди. z-index — щоб текст банера їх не перекривав */
.car-arrow { position: absolute; z-index: 3; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  color: #fff; background: rgb(13 14 31 / .28); backdrop-filter: blur(6px); cursor: pointer; opacity: 0; transition: opacity .3s, background .2s; }
.car-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.car-arrow.prev { left: 12px; }
.car-arrow.next { right: 12px; }
.stage:hover .car-arrow { opacity: .75; }
.car-arrow:hover { background: rgb(13 14 31 / .45); }
.stage .car-arrow:hover, .car-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .car-arrow { opacity: .8; } }
.car-dots { display: flex; justify-content: center; gap: 2px; margin-top: 10px; }
.car-dots button { width: 36px; height: 32px; padding: 0; border: 0; background: none; cursor: pointer; }
.car-dots button::after { content: ''; display: block; height: 4px; margin: 0 4px; background: var(--field-line); transition: background .3s; }
.car-dots button[aria-current=true]::after { background: var(--accent); }

@media (max-width: 760px) { .carousel { margin-bottom: 40px; } }
@container banner (max-width: 728px) {
  /* низький банер: стрілки посередині по висоті, а поля з боків тримають текст і фото осторонь від них */
  .stage > .car-arrow { width: 34px; height: 34px; }
  .stage > .car-arrow.prev { left: 6px; }
  .stage > .car-arrow.next { right: 6px; }
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 0; --wx: var(--m-wx, 0px); --wy: var(--m-wy, 0px); --bx: var(--m-bx, 0px); --by: var(--m-by, 0px); --img: var(--m-img, 1); --rot: var(--m-rot, 0deg); --x: var(--m-x, 0%); --y: var(--m-y, 0%); --btn: var(--m-btn, 1); --title: var(--m-title, 1); }
  .hero-pic { order: -1; min-height: 0; padding: 12px 46px 0; }
  .hero-pic img, .hero-pic.count-2 img { height: 150px; }
  .hero-pic.count-3 img, .hero-pic.count-4 img, .hero-pic.count-5 img { height: 120px; }
  .hero-pic:not(.count-1) img:nth-child(odd) { transform: translateY(-6px) rotate(-3deg); }
  .hero-pic:not(.count-1) img:nth-child(even) { transform: translateY(6px) rotate(3deg); }
  .hero-text { justify-content: flex-start; align-items: center; text-align: center; padding: 10px 46px 16px; }
  .hero-kicker { margin-bottom: 6px; font-size: .8rem; padding: 2px 8px; }
  .hero h2 { font-size: calc(1.45rem * var(--title)); margin-bottom: 6px; }
  .hero-sub { margin-bottom: 10px; font-size: .95rem; }
  .hero .btn { font-size: calc(.9rem * var(--btn)); padding: calc(8px * var(--btn)) calc(24px * var(--btn)); }
  .hero-extra { left: var(--m-tx); top: var(--m-ty); max-width: calc(100% - var(--m-tx)); font-size: calc(1rem * var(--m-ts)); }
}
