/* deals 28.08 — «Знижка тижня»: bottom-sheet без затемнення + згорнутий круг. Скоуп .cdl-*.
   Окремий файл (custom.min.css розійшовся з custom.css — не регенеруємо). Підключається ТІЛЬКИ коли є активна знижка.
   Анімуємо лише transform/opacity; кільця — псевдоелементи; will-change — лише на сам шит/круг і лише на час анімації (JS).
   hotfix 28.08: обгортка #cdl без боксу (display:contents) — шит і круг прямі fixed-діти <body>; висота нижнього меню
   міряється JS у --cdl-bn-h (уже з safe-area, без подвійного обліку); веб — круг усередині колонки .fab; CTA білий у всіх станах.
   ТЗ-6 28.08: свайпу/грабера НЕМАЄ (drag-обробник і тягнув шит за пальцем при скролі по ньому) — закриття лише ✕ (44×44) і авто-згортання;
   блок «Залишилось» (відлік + смужка) над CTA; круг на мобільному видимий увесь час дії — після ~30 с з першої появи за сесію
   стає тихим (.is-quiet: без кілець/покачування/попіну). */
:root { --cdl-bn-h: calc(57px + env(safe-area-inset-bottom)); --cdl-z: 38; --cdl-gold: #C9A24B; --cdl-gold-deep: #9A7A2E; --cdl-ink: #17160F; --cdl-red: #E24B4A; --cdl-fab-d: 60px; }

.cdl { display: contents; font-family: 'MazzardM Regular', system-ui, sans-serif; color: #16150F; -webkit-font-smoothing: antialiased; }
.cdl[hidden] { display: none !important; }
.cdl.is-veiled { visibility: hidden; pointer-events: none; }
.cdl-circle.is-veiled { visibility: hidden !important; pointer-events: none !important; }
.cdl-circle[hidden] { display: none !important; }

/* hotfix-2: діагностика ?deal_debug=1 (owner) — поверх усього, кліки проходять крізь */
.cdl-debug { position: fixed; top: 0; left: 0; right: 0; z-index: 2147483000; margin: 0; padding: 6px 8px; background: rgba(0,0,0,.82); color: #7ee2a0; font: 10px/1.35 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; pointer-events: none; }

/* ───────── S1 — круг (моб: над нижнім меню праворуч) ───────── */
.cdl-circle { position: fixed; z-index: var(--cdl-z); right: 14px; bottom: calc(var(--cdl-bn-h) + 9px); width: 58px; height: 58px; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; overflow: visible; opacity: 0; transform: scale(.5); pointer-events: none; -webkit-tap-highlight-color: transparent; font-family: 'MazzardM Regular', system-ui, sans-serif; color: #16150F; }
.cdl-circle.is-in { opacity: 1; transform: scale(1); pointer-events: auto; animation: cdl-popin .46s cubic-bezier(.34,1.4,.44,1) both; }
.cdl-circle.is-out { animation: cdl-shrink .18s ease-in both; pointer-events: none; }
.cdl-circle.is-in.is-settled { animation: none; opacity: 1; transform: none; }   /* після перенесення між контейнерами popin не повторюємо */
.cdl-circle-hov { position: absolute; inset: 0; border-radius: 50%; transition: transform .18s ease-out, filter .18s ease-out; }
.cdl-circle-in { position: absolute; inset: 0; border-radius: 50%; background: var(--cdl-ink); color: var(--cdl-gold); display: flex; align-items: center; justify-content: center; font-family: 'MazzardM Bold', system-ui, sans-serif; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; box-shadow: 0 6px 20px rgba(0,0,0,.22); }
.cdl-circle-in::before, .cdl-circle-in::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(201,162,75,.6); pointer-events: none; opacity: 0; }
.cdl-circle.is-in .cdl-circle-in::before, .cdl-circle.is-in .cdl-circle-in::after { animation: cdl-ripple 2.9s .5s ease-out infinite; }
.cdl-circle.is-in .cdl-circle-in::after { animation-delay: 2.05s; }
.cdl-circle-in.is-wiggle { animation: cdl-wiggle .7s ease-in-out 1; }
/* ТЗ-6 D: тихий круг — після ~30 с від першої появи за сесію (JS): без кілець і попіну, лише мʼяка поява; ✕ у крузі — лише веб */
.cdl-circle.is-quiet.is-in { animation: cdl-fadein .22s ease-out both; }
.cdl-circle.is-quiet.is-in.is-settled { animation: none; }
.cdl-circle.is-quiet .cdl-circle-in::before, .cdl-circle.is-quiet .cdl-circle-in::after { animation: none !important; opacity: 0; }
.cdl-circle.is-quiet .cdl-circle-in.is-wiggle { animation: none; }
.cdl-circle-x { position: absolute; top: 3px; right: 6px; font-size: 10px; line-height: 1; opacity: .5; color: #fff; font-family: system-ui, sans-serif; }
@media (max-width: 960px) { .cdl-circle-x { display: none; } }
.cdl-circle.red .cdl-circle-in { color: #ff6b66; }
.cdl-circle.black .cdl-circle-in { background: #000; color: #fff; }
@media (hover: hover) {
  .cdl-circle:hover .cdl-circle-hov { transform: scale(1.06); filter: drop-shadow(0 14px 22px rgba(0,0,0,.35)); }
}

/* ───────── S2 — шит (моб): прямий fixed-нащадок body, впритул до нижнього меню. Жодних touch-обробників — лише нативний скрол ───────── */
.cdl-sheet { position: fixed; z-index: var(--cdl-z); left: 0; right: 0; bottom: var(--cdl-bn-h); background: #fff; border-top: 1px solid #ececea; border-radius: 20px 20px 0 0; box-shadow: 0 -14px 38px -14px rgba(0,0,0,.3); padding: 0 16px 14px; color: #16150F; max-height: 66vh; max-height: 66dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; transform: translate3d(0, calc(100% + var(--cdl-bn-h) + 60px), 0); pointer-events: none; touch-action: pan-y; visibility: hidden; transition: transform .28s ease-in, visibility 0s linear .3s; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.cdl-sheet.is-open { transform: translate3d(0, 0, 0); pointer-events: auto; visibility: visible; transition: transform .36s cubic-bezier(.2,.85,.32,1), visibility 0s; }
.cdl-sheet.is-closing { transition: transform .28s ease-in, visibility 0s linear .3s; transform: translate3d(0, calc(100% + var(--cdl-bn-h) + 60px), 0); pointer-events: none; visibility: hidden; }
/* верхній рядок: бейдж ліворуч, ✕ праворуч (хітбокс 44×44, гліф 19px #9a968c) — і на мобільному, і на вебі */
.cdl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 6px; }
.cdl-badge { font-family: 'MazzardM Bold', system-ui, sans-serif; font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; background: var(--cdl-ink); color: var(--cdl-gold); padding: 4px 8px; border-radius: 5px; font-weight: 700; white-space: nowrap; }
.cdl-badge.red { background: var(--cdl-red); color: #fff; }
.cdl-badge.black { background: #000; color: #fff; }
.cdl-x, .cdl-x:hover, .cdl-x:focus, .cdl-x:active { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; margin: 0 -12px 0 0; padding: 0; background: none; border: 0; border-radius: 50%; font-size: 19px; line-height: 1; color: #9a968c; cursor: pointer; font-family: system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
.cdl-x:focus-visible { outline: 2px solid var(--cdl-gold); outline-offset: -4px; }
/* вміст: ритм кратний 4 — бейдж → заголовок → 4 → фото+ціни → 12 → «Залишилось» → 12 → CTA → 8 → дрібний рядок */
.cdl-title { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 21px; line-height: 1.15; margin: 0 0 4px; color: #16150F; }
.cdl-offer { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; }
.cdl-img { width: 92px; aspect-ratio: 3 / 4; border-radius: 10px; flex: none; overflow: hidden; background: #F3F1EC; position: relative; }
.cdl-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.cdl-offer-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cdl-sub { font-size: 12.5px; color: #77746a; line-height: 1.4; }
.cdl-prices { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cdl-p-new { font-size: 30px; line-height: 1; font-weight: 700; color: var(--cdl-red); font-family: 'MazzardM Bold', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.cdl-p-old { font-size: 15px; color: #A09C92; text-decoration: line-through; font-variant-numeric: tabular-nums; }
.cdl-pill { align-self: flex-start; font-size: 12px; color: var(--cdl-gold-deep); background: #FCF8EE; border: 1px solid var(--cdl-gold); border-radius: 999px; padding: 4px 10px; line-height: 1.2; white-space: nowrap; }
.cdl-bundle { display: flex; gap: 7px; margin: 0 0 8px; }
.cdl-bundle-it { flex: 1; min-width: 0; text-align: center; }
.cdl-bundle-img { width: 100%; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: #F3F1EC; position: relative; margin-bottom: 5px; }
.cdl-bundle-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.cdl-bundle-nm { font-size: 10px; line-height: 1.25; color: #77746a; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cdl-plus { align-self: flex-start; color: var(--cdl-gold); font-size: 15px; font-weight: 700; padding-top: 34%; font-family: 'MazzardM Bold', system-ui, sans-serif; }
.cdl-bundle-prices { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.cdl-promo { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; border: 1.4px dashed var(--cdl-gold); background: #FCF8EE; border-radius: 10px; padding: 10px 12px; }
.cdl-promo-cd { font-family: 'MazzardM Bold', system-ui, sans-serif; font-size: 16px; font-weight: 700; letter-spacing: .08em; color: #17160F; }
.cdl-promo-min { font-size: 10.5px; color: #a09c92; }
.cdl-promo-cp, .cdl-promo-cp:hover, .cdl-promo-cp:focus, .cdl-promo-cp:active { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--cdl-gold-deep); background: none; border: 0; cursor: pointer; font-family: 'MazzardM Bold', system-ui, sans-serif; padding: 4px 0; }
/* ТЗ-6 C: «Залишилось» — відлік (моно, табличні цифри) + смужка минулої частки вікна (золото → червоне) */
.cdl-urg { margin: 0 0 12px; background: #FCF8EE; border: 1px solid #EFE1BD; border-radius: 11px; padding: 10px 12px; }
.cdl-urg-row { display: flex; align-items: baseline; gap: 7px; }
.cdl-urg-lb { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--cdl-gold-deep); font-family: 'MazzardM Bold', system-ui, sans-serif; font-weight: 700; }
.cdl-urg-val { margin-left: auto; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 14px; font-weight: 500; color: #17160F; font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap; }
.cdl-urg-track { height: 3px; border-radius: 99px; background: #EADFC2; margin-top: 8px; overflow: hidden; }
.cdl-urg-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #C9A24B, #E24B4A); transition: width 1s linear; }
/* CTA — <a>: усі стани явно, інакше глобальні a / a:visited перебивають колір (та сама гоча, що на кнопках 404) */
.cdl-cta, .cdl-cta:link, .cdl-cta:visited, .cdl-cta:hover, .cdl-cta:active, .cdl-cta:focus { display: block; width: 100%; text-align: center; background: var(--cdl-ink); color: #fff; border: 0; border-radius: 11px; padding: 14px; font-size: 14px; font-weight: 700; font-family: 'MazzardM Bold', system-ui, sans-serif; cursor: pointer; margin: 0; text-decoration: none; transition: background .18s; -webkit-tap-highlight-color: transparent; }
.cdl-cta:hover { background: #000; }
.cdl-fine { text-align: center; font-size: 11px; color: #8a877d; margin-top: 8px; line-height: 1.35; }

/* каскад вмісту: бейдж-рядок → заголовок → фото з ціною → «Залишилось» → кнопка → дрібний рядок; крок 50 мс, 440 мс, 11px */
.cdl-sheet.is-open .cdl-top, .cdl-sheet.is-open .cdl-body > * { animation: cdl-rise .44s cubic-bezier(.2,.85,.32,1) both; }
.cdl-sheet.is-open .cdl-top { animation-delay: .12s; }
.cdl-sheet.is-open .cdl-body > :nth-child(1) { animation-delay: .17s; }
.cdl-sheet.is-open .cdl-body > :nth-child(2) { animation-delay: .22s; }
.cdl-sheet.is-open .cdl-body > :nth-child(3) { animation-delay: .27s; }
.cdl-sheet.is-open .cdl-body > :nth-child(4) { animation-delay: .32s; }
.cdl-sheet.is-open .cdl-body > :nth-child(5) { animation-delay: .37s; }
.cdl-sheet.is-open .cdl-body > :nth-child(6) { animation-delay: .42s; }
.cdl-sheet.is-open .cdl-body > :nth-child(7) { animation-delay: .47s; }

/* моб: при S2 стек .bn-fab (якщо колись повернеться) ховається; на ВЕБІ .fab НЕ ховаємо */
.bn-fab { transition: opacity .2s; }
body.cdl-open .bn-fab { opacity: 0 !important; pointer-events: none !important; }

/* ───────── ВЕБ ≥961 — круг живе ВСЕРЕДИНІ колонки .fab (той самий центр і діаметр, що чат і «нагору»);
   картка — над колонкою, той самий right (JS: --cdl-web-right/--cdl-web-bottom від живого .fab-btn) ───────── */
@media (min-width: 961px) {
  .fab .cdl-circle { position: absolute; z-index: 2; right: auto; left: 50%; bottom: calc(100% + 14px); margin-left: calc(var(--cdl-fab-d) / -2); width: var(--cdl-fab-d); height: var(--cdl-fab-d); }
  .cdl-sheet { left: auto; right: var(--cdl-web-right, 60px); bottom: var(--cdl-web-bottom, 194px); width: 360px; border-radius: 16px; border: 1px solid #e6e3da; box-shadow: 0 20px 46px -16px rgba(0,0,0,.35); max-height: calc(100vh - var(--cdl-web-bottom, 194px) - 96px); padding: 0 16px 16px; transform: translate3d(0, calc(100% + var(--cdl-web-bottom, 194px) + 20px), 0); }
  .cdl-sheet.is-closing { transform: translate3d(0, calc(100% + var(--cdl-web-bottom, 194px) + 20px), 0); }
  .cdl-top { padding: 10px 0 6px; }
  .cdl-title { font-size: 22px; }
}
@media (min-width: 961px) and (max-height: 760px) {
  .cdl-sheet { padding: 0 14px 12px; }
  .cdl-top { padding: 6px 0 4px; }
  .cdl-offer { margin-bottom: 10px; }
  .cdl-img { width: 80px; }
  .cdl-p-new { font-size: 26px; }
  .cdl-urg { margin-bottom: 10px; padding: 8px 12px; }
  .cdl-cta { padding: 12px; }
  .cdl-title { font-size: 20px; }
}

/* ───────── анімації (тільки transform/opacity) ───────── */
@keyframes cdl-popin { 0% { opacity: 0; transform: scale(.5); } 62% { opacity: 1; transform: scale(1.09); } 100% { opacity: 1; transform: scale(1); } }
@keyframes cdl-fadein { 0% { opacity: 0; transform: scale(.92); } 100% { opacity: 1; transform: scale(1); } }
@keyframes cdl-shrink { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.4); } }
@keyframes cdl-ripple { 0% { transform: scale(1); opacity: .75; } 70% { opacity: 0; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes cdl-wiggle { 0% { transform: rotate(0) scale(1); } 28% { transform: rotate(-8deg) scale(1.08); } 57% { transform: rotate(8deg) scale(1.08); } 80% { transform: rotate(-3deg) scale(1.03); } 100% { transform: rotate(0) scale(1); } }
@keyframes cdl-rise { from { opacity: 0; transform: translateY(11px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .cdl-circle.is-in, .cdl-circle.is-out, .cdl-circle-in.is-wiggle, .cdl-circle.is-in .cdl-circle-in::before, .cdl-circle.is-in .cdl-circle-in::after,
  .cdl-sheet.is-open .cdl-top, .cdl-sheet.is-open .cdl-body > * { animation: none !important; }
  .cdl-sheet, .cdl-sheet.is-open, .cdl-sheet.is-closing, .cdl-circle-hov, .cdl-urg-fill, .bn-fab { transition: none !important; }
  .cdl-circle.is-in { opacity: 1; transform: none; }
  .cdl-circle.is-out { opacity: 0; }
}
