/* =====================================================================================================
   ATELIER — головна сторінка (блоки з адмінки «🧱 Блоки головної»): банери з глибиною, добірки товарів із вкладками,
   3D-кільце категорій, підписка, текст, переваги. Ядро (токени, кнопки, картка, стрічка) — atelier.css.
   Висоти задані CSS (без зсуву макета), анімації — лише transform/opacity, «менше руху» — усе статично.
   ===================================================================================================== */

/* ── банер ────────────────────────────────────────────────────────────────────────────────────── */
.at-banner { position: relative; display: flex; overflow: hidden; isolation: isolate; color: var(--banner-color, #fff); background: #1d1d1f; }
/* --scrim: колір, протилежний кольору тексту банера (світлий текст → чорний, темний текст → білий). Без підтримки
   відносних кольорів у браузері — чорний (типовий текст банера білий). */
.at-banner { --scrim: #000; }
@supports (color: rgb(from #fff r g b)) {
  .at-banner { --scrim: rgb(from var(--banner-color, #fff) clamp(0, (127.5 - (.2126 * r + .7152 * g + .0722 * b)) * 1000, 255) clamp(0, (127.5 - (.2126 * r + .7152 * g + .0722 * b)) * 1000, 255) clamp(0, (127.5 - (.2126 * r + .7152 * g + .0722 * b)) * 1000, 255)); }
}
/* без фото/відео: тло контрастне до кольору тексту (з ледь помітним м'ятним відтінком теми) — текст завжди видно */
.at-banner--nomedia { background: color-mix(in srgb, var(--scrim) 92%, var(--at-promo-bg)); }
.at-banner + .at-banner { margin-top: 24px; }
@media (min-width: 1024px) { .at-banner + .at-banner { margin-top: 40px; } }
/* «На весь екран» = до нижнього краю першого екрана: мінус шапка, смуга акцій (якщо є) і біжуча стрічка (якщо є) — кнопки банера видно одразу */
.at-main { --at-chrome: calc(var(--at-header-h) + 40px); --at-ticker-h: 0px; }
body:not(:has(.at-promo)) .at-main { --at-chrome: var(--at-header-h); }
body:has(.at-ticker) .at-main { --at-ticker-h: 49px; }
@media (min-width: 768px) { body:has(.at-ticker) .at-main { --at-ticker-h: 65px; } }
.at-banner--full { height: max(440px, calc(100svh - var(--at-chrome) - var(--at-ticker-h))); max-height: 1000px; }
.at-banner--tall { height: clamp(440px, 72vh, 760px); }
.at-banner--medium { height: clamp(360px, 56vh, 560px); }
.at-banner--compact { height: clamp(240px, 36vh, 360px); }
@media (max-width: 767.98px) {
  .at-banner--full { height: max(480px, calc(100svh - var(--at-chrome) - var(--at-ticker-h))); max-height: 760px; }
  .at-banner--tall { height: clamp(440px, 76vh, 640px); }
  .at-banner--medium { height: clamp(360px, 60vh, 520px); }
  .at-banner--compact { height: clamp(240px, 40vh, 320px); }
}
.at-banner__media { position: absolute; left: 0; right: 0; top: -72px; bottom: -72px; z-index: -2; } /* запас під паралакс (до ±60px) */
.at-banner__kb { position: absolute; inset: 0; transform-origin: 60% 40%; animation: at-kb 26s var(--at-ease) infinite alternate; }
@keyframes at-kb { from { transform: scale(1.02); } to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); } }
.at .at-banner__m { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 30%; }
.at .at-banner__m--phone { display: none; }
@media (max-width: 767.98px) { .at .at-banner__m--wide { display: none; } .at .at-banner__m--phone { display: block; } }
.at-banner__shade { position: absolute; inset: 0; z-index: -1; background: #000; opacity: calc(var(--ov, 0) / 100); pointer-events: none; }
.at-banner__link { position: absolute; inset: 0; z-index: 1; }
.at-banner__inner { position: relative; z-index: 2; display: flex; align-items: flex-end; width: 100%; padding-top: 48px; padding-bottom: clamp(40px, 9vh, 96px); pointer-events: none; }
.at-banner--center .at-banner__inner { align-items: center; justify-content: center; text-align: center; padding-bottom: 48px; }
.at-banner--right .at-banner__inner { justify-content: flex-end; text-align: right; }
.at-banner--compact .at-banner__inner, .at-banner--medium .at-banner__inner { align-items: center; padding-bottom: 48px; }
/* телефон, перший банер на весь екран: кнопки над зоною кнопки чату (вона внизу праворуч) — нічого не перекривається */
@media (max-width: 575.98px) { .at-banner--full.at-banner--left .at-banner__inner, .at-banner--full.at-banner--right .at-banner__inner { padding-bottom: 88px; } }
.at-banner__content { position: relative; max-width: 680px; pointer-events: none; }
/* 2026-11-12: м'яка підкладка лише під текстом банера (не все фото): білий заголовок/опис читаються навіть на світлому
   фото (контраст ≥ 4.5:1). Колір — --scrim (протилежний тексту). Сила враховує «Затемнення фото, %» з адмінки:
   разом дають ~55% під текстом, тож при сильному затемненні підкладки майже немає. Краї розмиті маскою. */
.at-banner__content::before {
  content: ''; position: absolute; z-index: -1; inset: -56px -96px; pointer-events: none;
  background: color-mix(in srgb, var(--scrim) max(0%, calc((1 - .45 / (1 - var(--ov, 0) / 100)) * 100%)), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 96px, #000 calc(100% - 96px), transparent), linear-gradient(to bottom, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 96px, #000 calc(100% - 96px), transparent), linear-gradient(to bottom, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-composite: intersect;
}
.at-banner--nomedia .at-banner__content::before { display: none; }
.at .at-banner__title { color: inherit; font-family: var(--at-font-head); font-size: clamp(30px, 4.4vw, var(--at-hero-title-size, 48px)); font-weight: 600; line-height: 1.08; letter-spacing: -.01em; margin: 0 0 16px; text-wrap: balance; perspective: 600px; }
.at-banner__sub { max-width: 520px; margin: 0 0 24px; font-size: clamp(14px, 1.2vw, 16px); line-height: 1.55; }
.at .at-banner--hero .at-banner__title { color: var(--at-hero-title-color); }
.at-banner--hero .at-banner__sub { color: var(--at-hero-sub-color); font-size: var(--at-hero-sub-size); }
.at-banner--center .at-banner__sub { margin-left: auto; margin-right: auto; }
.at-banner--right .at-banner__sub { margin-left: auto; }
.at-banner__title, .at-banner__sub { text-shadow: 0 1px 2px color-mix(in srgb, var(--scrim) 24%, transparent), 0 2px 24px color-mix(in srgb, var(--scrim) 30%, transparent); }
.at-banner__btns { display: flex; flex-wrap: wrap; gap: 8px; pointer-events: auto; }
.at-banner--center .at-banner__btns { justify-content: center; }
.at-banner--right .at-banner__btns { justify-content: flex-end; }
.at .at-banner__btn { min-height: 40px; padding: 8px 24px; font-size: 14px; }
@media (max-width: 575.98px) {
  .at-banner__btns { flex-direction: column; align-items: flex-start; }
  .at-banner--center .at-banner__btns { align-items: center; }
  .at-banner--right .at-banner__btns { align-items: flex-end; }
  .at .at-banner__btn { min-width: 168px; min-height: 44px; }
}

/* ── добірка товарів ──────────────────────────────────────────────────────────────────────────── */
.at-hp .at-section__head { margin-bottom: 16px; }
.at-hp__all { font-size: 14px; white-space: nowrap; }
.at-hp__tablist { margin-bottom: 24px; }
.at-hp__panel { animation: at-fade-up .5s var(--at-ease); }
.at-lead { grid-column: span 2; position: relative; display: flex; min-width: 0; background: var(--at-surface); overflow: hidden; color: #222; }
.at-lead__media { position: relative; flex: 0 0 50%; overflow: hidden; }
.at .at-lead__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--at-ease); }
.at-lead:hover .at-lead__img { transform: scale(1.04); }
.at-lead__cap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 8px; padding: 24px; }
.at-lead__kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--at-muted); }
.at-lead__title { font-family: var(--at-font-head); font-size: clamp(18px, 1.6vw, 24px); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.at-lead__btn { margin-top: 8px; pointer-events: none; }
@media (max-width: 575.98px) {
  /* телефон: фото зверху, підпис і кнопка знизу на всю ширину — текст кнопки не обрізається */
  .at-lead { flex-direction: column; }
  .at-lead__media { flex: 1 1 auto; min-height: 96px; }
  .at-lead__cap { flex: 0 0 auto; padding: 16px; gap: 4px; }
  .at-lead__title { font-size: 16px; }
  .at .at-lead__btn { padding: 8px 16px; font-size: 13px; }
}
/* порожня запасна добірка «Хіти» — не показувати */
.at-maybe-empty:not(:has(.at-card)) { display: none; }

/* ── 3D-кільце категорій ──────────────────────────────────────────────────────────────────────── */
.at-ringsec { overflow: hidden; }
.at-ring { --tw: 168px; --gap: 16px; position: relative; }
@media (min-width: 768px) { .at-ring { --tw: 200px; } }
@media (min-width: 1280px) { .at-ring { --tw: 240px; } }
@media (min-width: 1600px) { .at-ring { --tw: 272px; } }
.at-ring__stage { position: relative; height: calc(var(--tw) * 4 / 3 + 48px); }
/* без JS / телефон: стрічка (з глибиною — atelier-home.js задає --ry / --sc) */
.at-ring__spin { display: flex; gap: var(--gap); height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 0 var(--at-gutter); scroll-padding: 0 var(--at-gutter); overscroll-behavior-x: contain; }
.at-ring__tile:first-child { margin-left: auto; } .at-ring__tile:last-child { margin-right: auto; }
.at-ring__spin::-webkit-scrollbar { display: none; }
.at-ring__tile { flex: 0 0 var(--tw); display: flex; flex-direction: column; gap: 12px; scroll-snap-align: center; color: #222; -webkit-user-drag: none; user-select: none;
  transform: perspective(900px) rotateY(var(--ry, 0deg)) scale(var(--sc, 1)); transform-origin: 50% 50%; }
.at-ring__media { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--at-surface); }
.at .at-ring__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; transition: transform 1.2s var(--at-ease); }
.at-ring__tile:hover .at-ring__img { transform: scale(1.05); }
.at-ring__blank { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--at-font-brand); font-size: 72px; font-weight: 600; color: var(--at-line-strong); text-transform: uppercase; }
.at-ring__shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.32) 50%, transparent 62%); transform: translateX(-110%); transition: transform .9s var(--at-ease); pointer-events: none; }
.at-ring__tile:hover .at-ring__shine, .at-ring__tile:focus-visible .at-ring__shine { transform: translateX(110%); }
.at-ring__name { align-self: center; max-width: 100%; font-size: 14px; font-weight: 600; text-align: center; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.at-ring__ctrl { display: flex; align-items: center; justify-content: center; gap: 16px; height: 56px; margin-top: 32px; }
.at-ring__btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--at-line); background: #fff; color: #222; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .3s var(--at-ease-spring), border-color .2s; }
.at-ring__btn:hover { transform: scale(1.08); border-color: #222; }
.at-ring__btn .at-ico { width: 18px; height: 18px; }
.at-ring__hint { font-size: 12px; color: var(--at-muted); letter-spacing: .04em; min-width: 160px; text-align: center; }
@media (max-width: 767.98px) { .at-ring__ctrl { display: none; } }
.at-ring--few .at-ring__ctrl { display: none; }
@media (min-width: 768px) { .at-ring:not(.is-3d) .at-ring__ctrl { visibility: hidden; } }
/* 3D-режим (≥768px, від 5 плиток; клас .is-3d ставить atelier-home.js) */
.at-ring.is-3d { --r: calc(var(--tw) / 2 / tan(180deg / var(--n)) + 72px); }
.at-ring.is-3d .at-ring__stage { perspective: 1400px; perspective-origin: 50% 35%; cursor: grab; touch-action: pan-y; }
.at-ring.is-3d.is-drag .at-ring__stage { cursor: grabbing; }
.at-ring.is-3d .at-ring__spin { position: absolute; top: 0; left: 50%; width: var(--tw); height: 100%; margin-left: calc(var(--tw) / -2); padding: 0; overflow: visible; display: block;
  transform-style: preserve-3d; transform: translateY(-24px) translateZ(calc(var(--r) * -1)) rotateX(-7deg) rotateY(var(--angle, 0deg)); }
.at-ring.is-3d .at-ring__tile { position: absolute; inset: 0; margin: 0; transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(var(--r)); opacity: var(--o, 1); transition: opacity .25s linear; }
.at-ring.is-3d .at-ring__tile.is-back { pointer-events: none; }
.at-ring.is-3d .at-ring__tile.is-back .at-ring__name { visibility: hidden; }
.at-ring.is-3d .at-ring__name { transition: opacity .3s; }
.at-ring.is-3d .at-ring__tile.is-far .at-ring__name { opacity: 0; } /* підписи лише в передніх плиток — завжди контрастні */
.at-ring.is-3d .at-ring__tile.is-front .at-ring__media { box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
.at-ring.is-3d.is-drag .at-ring__tile { pointer-events: none; }

/* ── підписка і текст ─────────────────────────────────────────────────────────────────────────── */
.at-subscribe { background: var(--at-surface); }
.at-subscribe__inner { max-width: 720px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.at-subscribe .at-section__title { margin-bottom: 8px; }
.at-subscribe__text { color: var(--at-muted); margin: 0 0 24px; }
.at-news-form--big { width: 100%; max-width: 560px; text-align: left; }
/* на головній є свій блок підписки — у підвалі форму не дублюємо */
body:has(.at-subscribe) .at-footer__news { display: none; }
.at-textblock__inner { max-width: 760px; text-align: center; }
.at-textblock__body { margin-top: 16px; color: #444; font-size: 15px; line-height: 1.75; }
.at-textblock__body p:last-child { margin-bottom: 0; }

/* ── переваги ─────────────────────────────────────────────────────────────────────────────────── */
.at-feats { border-top: 1px solid var(--at-line); }
.at-feats__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .at-feats__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.at-feat { display: flex; align-items: flex-start; gap: 16px; padding: 24px 0; color: inherit; }
.at-feat + .at-feat { border-top: 1px solid var(--at-line); }
@media (min-width: 768px) { .at-feat { padding: 32px 24px; } .at-feat:first-child { padding-left: 0; } .at-feat + .at-feat { border-top: 0; border-left: 1px solid var(--at-line); } }
.at-feat .at-ico { width: 28px; height: 28px; stroke-width: 1.3; margin-top: 2px; }
.at-feat__title { margin: 0 0 4px !important; font-weight: 600; }
.at-feat__text { margin: 0 !important; }
.at-feat--1 .at-feat__title { color: var(--at-f1-title-color); font-size: var(--at-f1-title-size); } .at-feat--1 .at-feat__text { color: var(--at-f1-text-color); font-size: var(--at-f1-text-size); }
.at-feat--2 .at-feat__title { color: var(--at-f2-title-color); font-size: var(--at-f2-title-size); } .at-feat--2 .at-feat__text { color: var(--at-f2-text-color); font-size: var(--at-f2-text-size); }
.at-feat--3 .at-feat__title { color: var(--at-f3-title-color); font-size: var(--at-f3-title-size); } .at-feat--3 .at-feat__text { color: var(--at-f3-text-color); font-size: var(--at-f3-text-size); }
a.at-feat:hover .at-feat__title { text-decoration: underline; text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .at-banner__kb { animation: none !important; transform: none !important; }
  .at-ring__stage { height: auto; }
  .at-ring__spin { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--tw), 44%), 1fr)); overflow: visible; padding: 0 var(--at-gutter); justify-content: stretch; }
  .at-ring__tile { transform: none !important; margin: 0 !important; }
  .at-ring__ctrl { display: none !important; }
}
