/* =====================================================================
   LaserLand — таймер обратного отсчёта. Scoped под .llt / .llt-until.
   Варианты: data-llt-skin = dark | light | glass ; data-llt-size = sm | md | lg
   Одинаковый файл лежит в обоих плагинах; грузится один раз (handle ll-timer).
   ===================================================================== */
.llt {
  --llt-cell-bg: rgba(255, 255, 255, .08);
  --llt-cell-bd: rgba(0, 170, 212, .35);
  --llt-num: #fff;
  --llt-unit: rgba(255, 255, 255, .62);
  --llt-label: #FF7800;
  --llt-sep: rgba(255, 255, 255, .45);
  --llt-num-size: 30px;
  --llt-cell-w: 62px;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
}
.llt *, .llt *::before, .llt *::after { box-sizing: border-box; }
.llt[data-llt-state="hidden"],
.llt-until[data-llt-state="hidden"] { display: none !important; }

.llt__label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--llt-label);
}
.llt__label::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor; animation: llt-pulse 1.6s ease-out infinite;
}
.llt__cells { display: flex; align-items: stretch; gap: 6px; }
.llt__cell {
  min-width: var(--llt-cell-w);
  padding: 8px 6px 7px;
  border-radius: 12px;
  background: var(--llt-cell-bg);
  border: 1px solid var(--llt-cell-bd);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.llt__num {
  font-size: var(--llt-num-size); font-weight: 800; color: var(--llt-num);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.llt__unit {
  margin-top: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--llt-unit);
}
.llt__sep {
  align-self: center; font-size: calc(var(--llt-num-size) * .8); font-weight: 800;
  color: var(--llt-sep); margin-top: -14px;
}
.llt[data-llt-nodays] [data-llt-unit="d"],
.llt[data-llt-nodays] [data-llt-unit="d"] + .llt__sep { display: none; }

/* состояние «нули» — отсчёт закончился, попап/блок остаётся */
.llt__ended { display: none; font-size: 13px; font-weight: 600; color: var(--llt-unit); }
.llt[data-llt-state="zero"] .llt__num { opacity: .45; }
.llt[data-llt-state="zero"] .llt__label::before { animation: none; opacity: .5; }
.llt[data-llt-state="zero"] .llt__ended { display: block; }

/* ---------- скины ---------- */
.llt[data-llt-skin="glass"] {
  --llt-cell-bg: rgba(255, 255, 255, .12);
  --llt-cell-bd: rgba(255, 255, 255, .22);
  --llt-label: #FFBE2B;
}
.llt[data-llt-skin="glass"] .llt__cell { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
/* светлая — как тёмная: прозрачная тонировка + цветная рамка, без заливки */
.llt[data-llt-skin="light"] {
  --llt-cell-bg: rgba(0, 170, 212, .07);
  --llt-cell-bd: rgba(0, 170, 212, .45);
  --llt-num: #00244A;
  --llt-unit: #5D7E9E;
  --llt-label: #FF7800;
  --llt-sep: rgba(0, 36, 74, .35);
}
.llt[data-llt-skin="light"] .llt__ended { color: #5D7E9E; }

/* ---------- размеры ---------- */
.llt[data-llt-size="sm"] { --llt-num-size: 20px; --llt-cell-w: 44px; gap: 6px; }
.llt[data-llt-size="sm"] .llt__cell { padding: 6px 4px 5px; border-radius: 9px; }
.llt[data-llt-size="sm"] .llt__unit { font-size: 9px; margin-top: 3px; }
.llt[data-llt-size="sm"] .llt__sep { margin-top: -10px; }
.llt[data-llt-size="sm"] .llt__label { font-size: 11px; letter-spacing: .1em; }
.llt[data-llt-size="lg"] { --llt-num-size: 40px; --llt-cell-w: 80px; }

/* ---------- полоса под картинкой поп-апа ---------- */
.llt-strip {
  container-type: inline-size;
  padding: 14px 18px;
  background: linear-gradient(100deg, #140A3C 0%, #2A1170 60%, #4B1BA8 100%);
  line-height: normal;
}
.llt-strip[data-llt-strip-skin="light"] { background: #fff; border-top: 1px solid rgba(0, 36, 74, .1); }
.llt-strip .llt { display: flex; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
/* ячейки тянутся по ширине плашки — она равна ширине картинки и бывает узкой */
.llt-strip .llt { --llt-num-size: 24px; --llt-cell-w: 0px; }
.llt-strip .llt__label { flex: 0 0 auto; max-width: 92px; line-height: 1.25; }
.llt-strip .llt__cells { flex: 1 1 auto; min-width: 0; }
.llt-strip .llt__cell { flex: 1; min-width: 0; }
.llt-strip .llt__sep { margin-top: -12px; }
/* подпись под таймером: на телефоне и в очень узкой плашке */
@container (max-width: 300px) {
  .llt-strip .llt { flex-direction: column; align-items: stretch; gap: 8px; }
  .llt-strip .llt__label { order: 2; max-width: none; justify-content: center; }
  .llt-strip .llt__ended { order: 3; text-align: center; }
}
@media (max-width: 767px) {
  .llt-strip .llt { flex-direction: column; align-items: stretch; gap: 8px; }
  .llt-strip .llt__label { order: 2; max-width: none; justify-content: center; }
  .llt-strip .llt__ended { order: 3; text-align: center; }
}

@keyframes llt-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 120, 0, .55); }
  80%, 100% { box-shadow: 0 0 0 8px rgba(255, 120, 0, 0); }
}
@media (prefers-reduced-motion: reduce) { .llt__label::before { animation: none; } }

@media (max-width: 767px) {
  .llt { --llt-num-size: 24px; --llt-cell-w: 52px; }
  .llt[data-llt-size="lg"] { --llt-num-size: 28px; --llt-cell-w: 60px; }
  .llt-strip { padding: 12px 14px; }
}

/* ===================== встраивание в карточку / попап акции / поп-ап ===================== */
/* поп-ап-картинка + таймер: ширина плашки = ширине картинки (без фона по бокам).
   Ширину считаем от высоты экрана и пропорций картинки (--llpop-ar = ширина/высота,
   из метаданных вложения; JS уточняет по naturalWidth/Height), чтобы картинка + полоса
   влезали в 90vh. */
.llpop-overlay__dialog--timer {
  --llpop-strip-h: 96px;
  display: flex; flex-direction: column;
  width: min(520px, 92vw, calc((90vh - var(--llpop-strip-h)) * var(--llpop-ar, .5625)));
  max-width: none;
  background: #140A3C;
}
.llpop-overlay__dialog--timer .llpop-image__img { width: 100%; height: auto; max-height: none; object-fit: cover; }
@media (max-width: 767px) {
  .llpop-overlay__dialog--timer { --llpop-strip-h: 124px; }
}

/* компактная карточка акции: таймер между описанием и кнопками */
.llpe-card__timer { margin-top: 16px; }
.llpe-card__timer .llt { width: 100%; }
.llpe-card__timer .llt__cells { width: 100%; }
.llpe-card__timer .llt__cell { flex: 1; }

/* расширенный попап «Подробнее»: таймер-плашка под чипами */
.llpe-modal__timer {
  margin-top: 18px; padding: 14px 16px; border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.llpe-section[data-llpe-theme="dark"] .llpe-modal__timer { background: rgba(0, 170, 212, .08); border: 1px solid rgba(0, 170, 212, .22); }
.llpe-section[data-llpe-theme="light"] .llpe-modal__timer { background: #f4f6fa; border: 1px solid rgba(0, 36, 74, .08); }
.llpe-modal__timer .llt { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
.llpe-modal__timer .llt__label { max-width: 110px; line-height: 1.25; }

/* срок акции на карточке (возобновляемый — дата текущего цикла) */
.llpe-card__until {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 7px;
  margin-top: 10px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.llpe-section[data-llpe-theme="dark"] .llpe-card__until { background: rgba(255, 120, 0, .14); color: #FF9333; }
.llpe-section[data-llpe-theme="light"] .llpe-card__until { background: rgba(255, 120, 0, .1); color: #d96500; }

@media (max-width: 767px) {
  .llpe-modal__timer .llt { flex-direction: column; align-items: flex-start; }
  .llpe-modal__timer .llt__label { max-width: none; }
  .llpe-modal__timer .llt__cells { width: 100%; }
  .llpe-modal__timer .llt__cell { flex: 1; }
}

/* карточка не знает тему секции — таймер «dark» внутри светлой секции/попапа берёт светлые цвета */
.llpe-section[data-llpe-theme="light"] .llt[data-llt-skin="dark"] {
  --llt-cell-bg: rgba(0, 170, 212, .07);
  --llt-cell-bd: rgba(0, 170, 212, .45);
  --llt-num: #00244A;
  --llt-unit: #5D7E9E;
  --llt-sep: rgba(0, 36, 74, .35);
}
.llpe-section[data-llpe-theme="light"] .llt[data-llt-skin="dark"] .llt__ended { color: #5D7E9E; }
