/* ===========================================================================
   BIGOTOP — campaign components (pkg/common/campaign)

   The pieces every campaign has, whatever the occasion: the announcement
   bar, the code ticket, the countdown, the home slide and strip, the card badge, the
   product page's note and the cart's one-tap code. Linked by
   layouts/base.html while a campaign is in its teaser or sale, before the
   campaign's theme sheet (campaign-<theme>.css).

   Nothing here names a colour of its own: it draws from the --cmp-*
   properties below. Their defaults are the site's own purple — what a
   campaign looks like with no theme, or a theme id nobody registered — and
   a theme sheet re-points them under html[data-campaign-theme="<id>"]
   (teaser and sale) for its look, plus the site under
   html[data-campaign="<id>"] (the sale only).

     --cmp-hl / -hl-ink      the highlight on the bar, the slide and the strip, and the
                             text on a highlight fill (the code ticket)
     --cmp-bar-*             the bar's background, ink and muted ink
     --cmp-hero-*            the home slide and strip: background, edge, ink, muted ink and
                             the glow behind its art
     --cmp-mark / -glow      the slide's large lettering (the stamp)
     --cmp-cta-*             the slide's button
     --cmp-tag / -tag-*      pieces that sit on the page itself: the card
                             badge, the product note, the cart chip

   Unlayered on purpose: it outranks the layered design system
   (assets/css/app.css) without !important.
   =========================================================================== */

html[data-campaign-state] {
  --cmp-hl: oklch(100% 0 0);
  --cmp-hl-ink: var(--primary-strong);
  --cmp-bar-bg: linear-gradient(90deg, var(--primary-strong), var(--primary));
  --cmp-bar-ink: oklch(100% 0 0);
  --cmp-bar-dim: oklch(100% 0 0/.88);
  --cmp-clock-bg: oklch(100% 0 0/.16);
  --cmp-hero-bg:
    radial-gradient(70% 120% at 100% 0%, oklch(100% 0 0/.16), #0000 60%),
    linear-gradient(135deg, var(--primary), var(--primary-strong));
  --cmp-hero-ink: oklch(100% 0 0);
  --cmp-hero-dim: oklch(100% 0 0/.86);
  --cmp-hero-glow: radial-gradient(circle, oklch(100% 0 0/.22), #0000 70%);
  --cmp-word-stroke: oklch(100% 0 0/.12);
  --cmp-mark: linear-gradient(180deg, oklch(100% 0 0), oklch(92% .04 293));
  --cmp-mark-glow: oklch(30% .15 293/.35);
  --cmp-cta-bg: oklch(100% 0 0);
  --cmp-cta-ink: var(--primary-strong);
  --cmp-cta-shadow: 0 12px 30px -12px oklch(20% .1 293/.6);
  --cmp-tag: var(--primary);
  --cmp-tag-bg: var(--primary);
  --cmp-tag-text: var(--text);
}
/* the card badge in the default look: the brand purple, white letters */
html[data-campaign-state]:not([data-campaign-theme]) .pc-cmp,
html[data-campaign-state][data-campaign-theme=""] .pc-cmp { color: #fff; border-color: transparent; }

/* =======================================================================
   The announcement bar — teaser and sale alike, so scoped by the state.
   ======================================================================= */
html[data-campaign-state] .cmp-bar {
  position: relative;
  z-index: 101;
  background: var(--cmp-bar-bg);
  color: var(--cmp-bar-ink);
  font-size: 13px;
  line-height: 1.2;
  border-bottom: 1px solid color-mix(in oklab, var(--cmp-hl) 28%, transparent);
}
html[data-campaign-state] .cmp-bar[hidden] { display: none; }
html[data-campaign-state] .cmp-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 40px;
  padding-block: 5px;
  white-space: nowrap;
}
html[data-campaign-state] .cmp-bar-tag {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cmp-hl);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  direction: ltr;
}
html[lang=fa][data-campaign-state] .cmp-bar-tag { direction: rtl; letter-spacing: 0; text-transform: none; font-family: inherit; font-size: 12px; }
html[data-campaign-state] .cmp-bar-spark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cmp-hl);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--cmp-hl) 18%, transparent), 0 0 12px color-mix(in oklab, var(--cmp-hl) 70%, transparent);
  flex-shrink: 0;
  display: inline-block;
}
html[data-campaign-state] .cmp-bar-text {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
html[data-campaign-state] .cmp-short { display: none; }

/* the code: a ticket with a perforated edge */
html[data-campaign-state] .cmp-code {
  display: inline-flex;
  align-items: stretch;
  border-radius: 8px;
  border: 1px dashed color-mix(in oklab, var(--cmp-hl) 75%, transparent);
  background: color-mix(in oklab, var(--cmp-hl) 10%, transparent);
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: background .16s, border-color .16s;
}
html[data-campaign-state] .cmp-code:hover { background: color-mix(in oklab, var(--cmp-hl) 18%, transparent); border-color: var(--cmp-hl); }
html[data-campaign-state] .cmp-code-val {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--cmp-hl);
  padding: 4px 9px;
}
html[data-campaign-state] .cmp-code-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: var(--cmp-hl);
  color: var(--cmp-hl-ink);
  font-weight: 700;
  font-size: 12px;
}
html[data-campaign-state] .cmp-code-act svg { width: 13px; height: 13px; }
html[data-campaign-state] .cmp-code.is-copied .cmp-code-act { background: oklch(80% .15 158); }

html[data-campaign-state] .cmp-clock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cmp-bar-dim);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
html[data-campaign-state] .cmp-clock svg { width: 15px; height: 15px; color: var(--cmp-hl); }
html[data-campaign-state] .cmp-clock-d[hidden] { display: none; }
html[data-campaign-state] .cmp-clock-d b,
html[data-campaign-state] .cmp-clock-t { font-weight: 700; color: var(--cmp-bar-ink); }
html[data-campaign-state] .cmp-clock-t {
  background: var(--cmp-clock-bg);
  border-radius: 6px;
  padding: 3px 7px;
  min-width: 74px;
  text-align: center;
}

@media (max-width: 720px) {
  html[data-campaign-state] .cmp-bar { font-size: 12px; }
  html[data-campaign-state] .cmp-bar-inner { gap: 8px; min-height: 38px; padding-inline: 12px; justify-content: space-between; }
  html[data-campaign-state] .cmp-bar-tag { display: none; }
  html[data-campaign-state] .cmp-long { display: none; }
  html[data-campaign-state] .cmp-short { display: inline-flex; align-items: center; gap: 6px; }
  html[data-campaign-state] .cmp-short:before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--cmp-hl);
    box-shadow: 0 0 10px color-mix(in oklab, var(--cmp-hl) 80%, transparent);
  }
  html[data-campaign-state] .cmp-code-word,
  html[data-campaign-state] .cmp-clock-lbl { display: none; }
  html[data-campaign-state] .cmp-code-val,
  html[data-campaign-state] .cmp-code-act { padding: 3px 7px; }
  html[data-campaign-state] .cmp-clock-t { min-width: 0; padding: 2px 6px; }
}

/* =======================================================================
   The sale's own pieces
   ======================================================================= */

/* --- the card badge ---------------------------------------------------- */
html[data-campaign-state] .pc-cmp {
  position: absolute;
  inset-inline-start: 10px;
  bottom: 10px;
  background: var(--cmp-tag-bg);
  color: var(--cmp-tag);
  border: 1px solid color-mix(in oklab, var(--cmp-tag) 45%, transparent);
  font-size: 11px;
  gap: 6px;
  padding: 3px 9px;
  backdrop-filter: blur(4px);
}
html[data-campaign-state] .pc-cmp .cmp-bar-spark { width: 6px; height: 6px; }
html[data-campaign-state] .pc-cmp .cmp-bar-spark,
html[data-campaign-state] .cmp-pdp-badge .cmp-bar-spark { background: var(--cmp-tag); box-shadow: none; }

/* --- the cart's one-tap code ------------------------------------------- */
html[data-campaign-state] .cmp-cart-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 10px 0 14px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  border: 1px dashed color-mix(in oklab, var(--cmp-tag) 60%, transparent);
  background: color-mix(in oklab, var(--cmp-tag) 8%, transparent);
  color: var(--cmp-tag-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: background .16s, border-color .16s;
}
html[data-campaign-state] .cmp-cart-chip:hover { background: color-mix(in oklab, var(--cmp-tag) 15%, transparent); border-color: var(--cmp-tag); }
html[data-campaign-state] .cmp-cart-chip svg { width: 16px; height: 16px; color: var(--cmp-tag); flex-shrink: 0; }
html[data-campaign-state] .cmp-cart-chip b {
  margin-inline-start: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .08em;
  color: var(--cmp-tag);
}
html[data-campaign-state] .cmp-cart-chip.is-used { opacity: .7; }


/* --- the home slide ---------------------------------------------------
   The campaign as the first slide of the home carousel (partials/
   campaign-slide.html), while the sale is on. It never sets the carousel's
   height: the pictures do, at every width, and the slide fills the box they
   make. It is a size container (size containment gives it no height of its
   own, so the flex row stretches it to the pictures' height; no aspect-ratio,
   height or min-height may ever be added here — the carousel would grow
   under the other slides, see TestTheCampaignSlideNeverSizesTheCarousel). It
   draws its art in CSS from the theme's --cmp-hero-* properties and lays
   itself out by the room it is given, in container queries on its own height
   (the pictures are about 2.8:1: 410px tall on a 1440 desktop, 250 on a
   tablet, 125 on a phone):

     tall    (> 230px)      everything: pill, title, line, code, button,
                            countdown, and the stamp on its ring
     medium  (176 - 230px)  the line and the clock go, the stamp stays
     short   (<= 175px)     the phone: title, code and button on one column;
                            the top bar already carries code and countdown
     tiny    (<= 135px)     the pill goes too: the title carries the name */
html[data-campaign-state] .hc-slide--cmp {
  position: relative;
  isolation: isolate;
  container: cmp-sl / size;
  background: var(--cmp-hero-bg);
  color: var(--cmp-hero-ink);
}
/* the track is dir=ltr so one translate serves both directions; the slide's
   own words follow the page's */
html[dir=rtl][data-campaign-state] .hc-slide--cmp { direction: rtl; }
html[dir=ltr][data-campaign-state] .hc-slide--cmp { direction: ltr; }

/* .cmp-sl-scene is the theme's scene layer: the same grid as the words, so its
   stage sits in the stamp's cell and follows the page's direction */
html[data-campaign-state] .cmp-sl,
html[data-campaign-state] .cmp-sl-scene {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr);
  align-items: center;
  column-gap: clamp(12px, 3cqw, 48px);
  /* the sides clear the carousel's arrows; the bottom, its dots */
  padding: clamp(14px, 5cqh, 40px) clamp(60px, 7.5cqw, 120px) clamp(28px, 9cqh, 56px);
}

/* the art: a perspective grid, a glow and an outlined wordmark */
html[data-campaign-state] .cmp-sl-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
html[data-campaign-state] .cmp-sl-glow {
  position: absolute;
  inset-inline-end: -8cqw;
  top: -22cqh;
  width: 96cqh;
  height: 96cqh;
  border-radius: 50%;
  background: var(--cmp-hero-glow);
  filter: blur(6px);
}
html[data-campaign-state] .cmp-sl-grid {
  position: absolute;
  inset: 52% -10% -40% -10%;
  background-image:
    linear-gradient(color-mix(in oklab, var(--cmp-hl) 16%, transparent) 1px, #0000 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--cmp-hl) 16%, transparent) 1px, #0000 1px);
  background-size: 44px 44px;
  transform: perspective(420px) rotateX(58deg);
  transform-origin: top;
  -webkit-mask: linear-gradient(180deg, #000 0%, #0000 75%);
  mask: linear-gradient(180deg, #000 0%, #0000 75%);
}
html[data-campaign-state] .cmp-sl-word {
  position: absolute;
  inset-inline-start: -6px;
  bottom: -5cqh;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: clamp(56px, 30cqh, 170px);
  line-height: .82;
  letter-spacing: -.04em;
  direction: ltr;
  color: #0000;
  -webkit-text-stroke: 1px var(--cmp-word-stroke);
  white-space: pre;
}
html[dir=rtl][data-campaign-state] .cmp-sl-word { text-align: right; }

/* the words */
html[data-campaign-state] .cmp-sl-copy { display: flex; flex-direction: column; align-items: flex-start; gap: clamp(6px, 2.4cqh, 18px); min-width: 0; }
html[data-campaign-state] .cmp-sl-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: clamp(3px, 1cqh, 5px) 12px;
  border-radius: var(--r-pill);
  background: color-mix(in oklab, var(--cmp-hl) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--cmp-hl) 35%, transparent);
  color: var(--cmp-hl);
  font-size: clamp(11px, 2.5cqh, 13px);
  font-weight: 700;
  line-height: 1.5;
}
html[data-campaign-state] .cmp-sl-kicker .cmp-bar-spark { width: 7px; height: 7px; box-shadow: 0 0 10px color-mix(in oklab, var(--cmp-hl) 80%, transparent); }
html[data-campaign-state] .cmp-sl-title {
  margin: 0;
  font-size: clamp(18px, min(5.2cqw, 11cqh), 64px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--cmp-hero-ink);
  text-wrap: balance;
  /* a long title the operator wrote stops at two lines; the padding keeps
     the clamp's box from cutting a Persian descender */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  padding-block: .1em;
}
html[lang=fa][data-campaign-state] .cmp-sl-title { letter-spacing: 0; line-height: 1.4; }
html[data-campaign-state] .cmp-sl-sub {
  margin: 0;
  max-width: 34em;
  color: var(--cmp-hero-dim);
  font-size: clamp(13px, 3cqh, 17px);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
html[data-campaign-state] .cmp-sl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; max-width: 100%; }

/* the code, larger: a label, the code, a copy button */
html[data-campaign-state] .cmp-code--lg { border-radius: 12px; font-size: 14px; }
html[data-campaign-state] .cmp-code--lg .cmp-code-lbl {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--cmp-hero-dim);
  font-size: 12.5px;
  font-weight: 600;
  border-inline-end: 1px dashed color-mix(in oklab, var(--cmp-hl) 45%, transparent);
}
html[data-campaign-state] .cmp-code--lg .cmp-code-val { padding: clamp(6px, 2.2cqh, 11px) clamp(10px, 1.4cqw, 14px); font-size: clamp(13px, 3.4cqh, 16px); }
html[data-campaign-state] .cmp-code--lg .cmp-code-act { padding: 0 clamp(10px, 1.2cqw, 14px); font-size: 13px; }
html[data-campaign-state] .cmp-code--lg .cmp-code-act svg { width: 15px; height: 15px; }

html[data-campaign-state] .cmp-cta {
  background: var(--cmp-cta-bg);
  color: var(--cmp-cta-ink);
  font-weight: 800;
  box-shadow: var(--cmp-cta-shadow);
}
html[data-campaign-state] .cmp-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
html[data-campaign-state] .cmp-cta svg { width: 18px; height: 18px; flex-shrink: 0; }
html[dir=rtl][data-campaign-state] .cmp-cta svg { transform: scaleX(-1); }
/* .hc-slide a is display:block for the picture links; the button is a flex row */
html[data-campaign-state] .cmp-sl .cmp-cta { display: inline-flex; padding: clamp(7px, 2.6cqh, 13px) clamp(14px, 2cqw, 24px); font-size: clamp(13px, 3.2cqh, 15px); }

html[data-campaign-state] .cmp-sl-clock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cmp-hero-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
html[data-campaign-state] .cmp-sl-clock svg { width: 15px; height: 15px; color: var(--cmp-hl); }
html[data-campaign-state] .cmp-sl-clock .cmp-clock-d[hidden] { display: none; }
html[data-campaign-state] .cmp-sl-clock b,
html[data-campaign-state] .cmp-sl-clock .cmp-clock-t { color: var(--cmp-hero-ink); font-weight: 700; }
html[data-campaign-state] .cmp-sl-clock .cmp-clock-t { background: var(--cmp-clock-bg); border-radius: 6px; padding: 2px 7px; }

/* the stamp: "special discount" (or the percentage, or the name alone) in
   gold, on a ring. The gold is a background clipped to the text, which paints
   only inside the element's own box — a Persian display face runs its ژ ی ه
   below the line box, so every clipped line carries padding the box would
   not otherwise have (and a negative margin that gives the space back). */
html[data-campaign-state] .cmp-sl-stamp {
  position: relative;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
html[data-campaign-state] .cmp-sl-stamp:before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-inline-start: 50%;
  top: 50%;
  width: min(72cqh, 34cqw);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--cmp-hl) 55%, transparent);
  box-shadow: 0 0 0 12px color-mix(in oklab, var(--cmp-hl) 5%, transparent), 0 0 0 24px color-mix(in oklab, var(--cmp-hl) 3%, transparent), 0 0 60px color-mix(in oklab, var(--cmp-hl) 20%, transparent) inset;
}
html[dir=rtl][data-campaign-state] .cmp-sl-stamp:before { translate: 50% -50%; }
html[data-campaign-state] .cmp-sl-mark-a,
html[data-campaign-state] .cmp-sl-mark-b,
html[data-campaign-state] .cmp-sl-pct-n {
  display: block;
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  padding-block: .2em;
  margin-block: -.2em;
  background: var(--cmp-mark);
  -webkit-background-clip: text;
  background-clip: text;
  color: #0000;
  filter: drop-shadow(0 10px 30px var(--cmp-mark-glow));
}
html[lang=fa][data-campaign-state] .cmp-sl-mark-a,
html[lang=fa][data-campaign-state] .cmp-sl-mark-b,
html[lang=fa][data-campaign-state] .cmp-sl-pct-n { letter-spacing: 0; line-height: 1.3; }
html[data-campaign-state] .cmp-sl-mark-a { font-size: clamp(22px, min(4.4cqw, 10cqh), 56px); }
html[data-campaign-state] .cmp-sl-mark-b { font-size: clamp(40px, min(8.4cqw, 19cqh), 104px); }
html[data-campaign-state] .cmp-sl-mark--name .cmp-sl-mark-b { font-size: clamp(26px, min(5cqw, 11cqh), 72px); max-width: 9ch; line-height: 1.2; }
html[lang=fa][data-campaign-state] .cmp-sl-mark--name .cmp-sl-mark-b { line-height: 1.45; }
html[data-campaign-state] .cmp-sl-pct-n { display: inline-flex; align-items: flex-start; font-size: clamp(54px, min(11cqw, 26cqh), 150px); letter-spacing: -.05em; }
html[data-campaign-state] .cmp-sl-pct-s { font-size: .45em; margin-top: .18em; margin-inline-start: .04em; }
html[data-campaign-state] .cmp-sl-stamp-w {
  margin-top: clamp(4px, 1.6cqh, 10px);
  font-size: clamp(13px, 3.4cqh, 18px);
  font-weight: 800;
  line-height: 1.5;
  color: var(--cmp-hl);
}
html[lang=en][data-campaign-state] .cmp-sl-stamp-w { letter-spacing: .24em; text-transform: uppercase; font-size: clamp(11px, 2.6cqh, 15px); }

/* medium: the line and the clock go */
@container cmp-sl (max-height: 230px) {
  html[data-campaign-state] .cmp-sl-sub, html[data-campaign-state] .cmp-sl .cmp-sl-clock { display: none; }
}
/* short, the phone: pill, title, code, button */
@container cmp-sl (max-height: 175px) {
  html[data-campaign-state] .cmp-sl,
  html[data-campaign-state] .cmp-sl-scene { grid-template-columns: minmax(0, 1fr); padding: 8px 14px 20px; }
  html[data-campaign-state] .cmp-sl-stamp, html[data-campaign-state] .cmp-sl-word { display: none; }
  html[data-campaign-state] .cmp-sl-copy { gap: 6px; }
  html[data-campaign-state] .cmp-sl-actions { flex-wrap: nowrap; width: 100%; gap: 8px; }
  html[data-campaign-state] .cmp-code--lg .cmp-code-lbl { display: none; }
  html[data-campaign-state] .cmp-code--lg { flex: 0 0 auto; }
  html[data-campaign-state] .cmp-sl .cmp-cta { flex: 1 1 auto; min-width: 0; justify-content: center; padding: 8px 12px; white-space: nowrap; }
  html[data-campaign-state] .cmp-sl .cmp-cta > span { overflow: hidden; text-overflow: ellipsis; }
  html[data-campaign-state] .cmp-sl-title { font-size: 18px; }
}
@container cmp-sl (max-height: 150px) {
  html[data-campaign-state] .cmp-sl-title { -webkit-line-clamp: 1; line-clamp: 1; }
}
/* tiny: no room for the pill above the title */
@container cmp-sl (max-height: 135px) {
  html[data-campaign-state] .cmp-sl-kicker { display: none; }
}
/* the arrows would sit on the phone slide's button: swipe and the dots stay */
@media (max-width: 700px) {
  html[data-campaign-state] .hero-carousel:has(.hc-slide--cmp.hc-on) .hc-arrow { opacity: 0; pointer-events: none; }
}

/* --- the scene layer and its motion ------------------------------------
   A theme may ship a scene (campaign.Theme.Scene): decoration behind the words.
   Here only what every scene shares: it is a layer under the words that never
   takes a click, it clips to the slide, and it moves only while it is worth
   moving — js/v2/campaign-motion.js sets data-cmp-live="1" on the slide while
   the slide is the one showing, the carousel is on screen and the tab is
   visible; anything else freezes every animation in it where it is. With
   reduced motion, or no script, nothing moves: the scene is its still frame
   (each element's own base transform is a composed pose). A scene's own
   elements animate transform and opacity only. */
html[data-campaign-state] .cmp-sl-scene {
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
html[data-campaign-state] .cmp-sl { z-index: 1; }
/* a scene brings its own floor and ring: the generic ones step aside */
html[data-campaign-state] .hc-slide--cmp:has(> .cmp-sl-scene) .cmp-sl-grid,
html[data-campaign-state] .hc-slide--cmp:has(> .cmp-sl-scene) .cmp-sl-stamp:before { display: none; }

/* the art and the scene only: the words' own entrance must never wait on a script */
html[data-campaign-state] .hc-slide--cmp:not([data-cmp-live="1"]) :is(.cmp-sl-art, .cmp-sl-scene),
html[data-campaign-state] .hc-slide--cmp:not([data-cmp-live="1"]) :is(.cmp-sl-art, .cmp-sl-scene) *,
html[data-campaign-state] .hc-slide--cmp:not([data-cmp-live="1"]) :is(.cmp-sl-art, .cmp-sl-scene) *:before,
html[data-campaign-state] .hc-slide--cmp:not([data-cmp-live="1"]) :is(.cmp-sl-art, .cmp-sl-scene) *:after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  html[data-campaign-state] .hc-slide--cmp *,
  html[data-campaign-state] .hc-slide--cmp *:before,
  html[data-campaign-state] .hc-slide--cmp *:after { animation: none !important; transition: none !important; }
}

/* --- the home strip: the campaign without the carousel -------------------
   Where the slider is switched off (or has no slides) the campaign is still
   announced: one compact row, two on a phone. */
html[data-campaign-state] .cmp-strip-sec { padding-top: 12px; }
html[data-campaign-state] .cmp-strip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 20px;
  border-radius: var(--r-xl);
  border: 1px solid color-mix(in oklab, var(--cmp-hl) 22%, transparent);
  background: var(--cmp-hero-bg);
  color: var(--cmp-hero-ink);
  box-shadow: var(--sh-md, var(--sh-lg));
}
html[data-campaign-state] .cmp-strip-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
html[data-campaign-state] .cmp-strip-art .cmp-sl-glow { inset-inline-end: -40px; top: -90px; width: 260px; height: 260px; }
html[data-campaign-state] .cmp-strip-art .cmp-sl-grid { inset: 60% -10% -80% -10%; }
html[data-campaign-state] .cmp-strip-title {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 800;
  line-height: 1.5;
  color: var(--cmp-hero-ink);
}
html[data-campaign-state] .cmp-strip-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
html[data-campaign-state] .cmp-strip .cmp-cta { padding: 8px 16px; }
html[data-campaign-state] .cmp-strip-clock { flex-shrink: 0; }
@media (max-width: 720px) {
  html[data-campaign-state] .cmp-strip { padding: 12px 14px; gap: 8px 10px; }
  html[data-campaign-state] .cmp-strip-title { flex: 1 1 0; font-size: 16px; }
  html[data-campaign-state] .cmp-strip-actions { flex: 1 1 100%; }
  html[data-campaign-state] .cmp-strip .cmp-cta { flex: 1 1 auto; justify-content: center; }
  html[data-campaign-state] .cmp-strip-clock { display: none; }
}

/* the product page's note, on a product the sale's coupon covers */
html[data-campaign-state] .cmp-pdp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in oklab, var(--cmp-tag) 12%, transparent);
  color: var(--cmp-tag);
  border: 1px solid color-mix(in oklab, var(--cmp-tag) 40%, transparent);
}
html[data-campaign-state] .cmp-pdp-badge b { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .06em; }

/* Motion, only for those who allow it: a slow drift of the glow, the bar's
   pulse, and the slide's words rising in as it comes round. */
@media (prefers-reduced-motion: no-preference) {
  html[data-campaign-state] .cmp-sl-glow,
  html[data-campaign-state] .cmp-strip-art .cmp-sl-glow { animation: cmpGlow 7s ease-in-out infinite alternate; }
  html[data-campaign-state] .cmp-bar-spark { animation: cmpPulse 2.4s ease-in-out infinite; }
  html[data-campaign-state] .hc-slide--cmp.hc-on .cmp-sl-copy { animation: cmpIn .6s cubic-bezier(.2,.7,.2,1) both; }
  html[data-campaign-state] .cmp-strip-sec { animation: cmpIn .5s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes cmpGlow { from { transform: translate(0, 0) scale(1); opacity: .85; } to { transform: translate(-30px, 20px) scale(1.08); opacity: 1; } }
@keyframes cmpPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes cmpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- the store tile's badge ---------------------------------------------
   The campaign's mark on a package tile (/store), where the card's badge is
   too large: the same colours as .pc-cmp, a spark and the campaign's name. */
html[data-campaign-state] .sg-b--cmp {
  background: var(--cmp-tag-bg);
  color: var(--cmp-tag);
  border: 1px solid color-mix(in oklab, var(--cmp-tag) 45%, transparent);
}
html[data-campaign-state]:not([data-campaign-theme]) .sg-b--cmp,
html[data-campaign-state][data-campaign-theme=""] .sg-b--cmp { color: #fff; border-color: transparent; }
html[data-campaign-state] .sg-b--cmp .cmp-bar-spark { width: 5px; height: 5px; background: currentColor; box-shadow: none; }
