/* ============================================================
   Better Promotion
   ============================================================ */

/* --- Design tokens (Common is the default); shared with the popup --- */
.pb-wrap, .pbp {
  --pb-bg: linear-gradient(205deg, #0d1882 0%, #1c20c8 50%, #3d0ec6 100%);
  --pb-dots: rgba(120,160,255,.28);
  --pb-glow: rgba(120,50,255,.35);
  --pb-text: #fff;
  --pb-muted: rgba(255,255,255,.65);
  --pb-accent: #FFD700;
  --pb-icon-glow: rgba(255,180,0,.85);
  --pb-tag: #9B5CF6;
  --pb-box-bg: rgba(18,28,140,.5);
  --pb-box-border: rgba(110,160,255,.7);
  --pb-box-glow: rgba(90,140,255,.4);
  --pb-num-bg: rgba(6,12,65,.82);
  --pb-copy: rgba(160,190,255,.85);
  --pb-spark-a: #FFD700;
  --pb-spark-b: #cc66ff;
}
.pb-wrap[data-design="halloween"], .pbp[data-design="halloween"] {
  --pb-bg: linear-gradient(205deg, #12061f 0%, #2a0b3d 55%, #4a1460 100%);
  --pb-dots: rgba(255,140,0,.2);
  --pb-glow: rgba(255,110,0,.28);
  --pb-accent: #ff8a1c;
  --pb-icon-glow: rgba(255,120,0,.8);
  --pb-tag: #a855f7;
  --pb-box-bg: rgba(30,8,45,.6);
  --pb-box-border: rgba(255,140,30,.75);
  --pb-box-glow: rgba(255,120,0,.38);
  --pb-num-bg: rgba(18,4,28,.85);
  --pb-copy: rgba(255,190,120,.9);
  --pb-spark-a: #ff8a1c;
  --pb-spark-b: #a855f7;
}
.pb-wrap[data-design="black_friday"], .pbp[data-design="black_friday"] {
  --pb-bg: linear-gradient(205deg, #000 0%, #121212 55%, #231c0c 100%);
  --pb-dots: rgba(255,255,255,.09);
  --pb-glow: rgba(245,197,66,.18);
  --pb-accent: #f5c542;
  --pb-icon-glow: rgba(245,197,66,.6);
  --pb-tag: #d9a21b;
  --pb-box-bg: rgba(0,0,0,.55);
  --pb-box-border: rgba(245,197,66,.75);
  --pb-box-glow: rgba(245,197,66,.3);
  --pb-num-bg: rgba(0,0,0,.75);
  --pb-copy: rgba(245,215,140,.9);
  --pb-spark-a: #f5c542;
  --pb-spark-b: #ffffff;
}
.pb-wrap[data-design="cyber_monday"], .pbp[data-design="cyber_monday"] {
  --pb-bg: linear-gradient(205deg, #020617 0%, #0b1e4d 50%, #2b0a4f 100%);
  --pb-dots: rgba(34,211,238,.22);
  --pb-glow: rgba(217,70,239,.3);
  --pb-accent: #22d3ee;
  --pb-icon-glow: rgba(34,211,238,.75);
  --pb-tag: #d946ef;
  --pb-box-bg: rgba(2,10,40,.6);
  --pb-box-border: rgba(34,211,238,.75);
  --pb-box-glow: rgba(34,211,238,.38);
  --pb-num-bg: rgba(2,6,23,.85);
  --pb-copy: rgba(150,235,250,.9);
  --pb-spark-a: #22d3ee;
  --pb-spark-b: #e879f9;
}

/* --- Wrapper handles the slide open/close --- */
.pb-wrap {
  /* Content lines up with the theme's wide width; the background stays full width. */
  --pb-content-width: var(--wp--style--global--wide-size, 1340px);
  container-type: inline-size;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height .55s cubic-bezier(.4,0,.2,1), opacity .4s ease .08s;
  width: 100%;
}
.pb-wrap.pb-is-open { max-height: 400px; opacity: 1; }
.pb-wrap.pb-is-closing {
  max-height: 0;
  opacity: 0;
  transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .25s ease;
}
.pb-wrap[data-preview] { max-height: none; opacity: 1; transition: none; }

/* Sticky: stays at the top while scrolling, below the WP admin bar. */
.pb-wrap[data-sticky] {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 9990;
}
@media screen and (max-width: 600px) {
  /* The admin bar scrolls away on small screens. */
  .pb-wrap[data-sticky] { top: 0; }
}
.pb-wrap [hidden] { display: none !important; }

/* --- Banner --- */
.pb-banner {
  background: var(--pb-bg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  min-height: 105px;
  position: relative;
  overflow: hidden;
  font-family: "Inter","Segoe UI",Arial,sans-serif;
  color: var(--pb-text);
  width: 100%;
  box-sizing: border-box;
}
.pb-banner *, .pb-banner *::before, .pb-banner *::after { box-sizing: border-box; }
.pb-banner::before {
  content: "";
  position: absolute; inset: 0; width: 220px;
  background-image: radial-gradient(circle, var(--pb-dots) 1.2px, transparent 1.2px);
  background-size: 13px 13px;
  pointer-events: none;
}
.pb-banner::after {
  content: "";
  position: absolute; top: -80px; left: 30%; width: 70%; height: 260px;
  background: radial-gradient(ellipse at 40% 50%, var(--pb-glow) 0%, transparent 72%);
  pointer-events: none;
}

/* --- Content box (the layout below responds to this width, not the screen) --- */
.pb-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--pb-content-width); margin: 0 auto;
  container-type: inline-size;
}
.pb-banner .pb-inner { padding-right: 40px; }

/* --- Close button --- */
.pb-close-btn {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  width: 26px; height: 26px; padding: 0; margin: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10; line-height: 1;
  transition: background .2s, border-color .2s, transform .2s;
}
.pb-close-btn:hover, .pb-close-btn:focus-visible {
  background: rgba(255,255,255,.2);
  border-color: #fff;
  transform: translateY(-50%) scale(1.12);
}
.pb-close-btn svg { width: 12px; height: 12px; stroke: #fff; }

/* --- Layout --- */
.pb-center-group {
  flex: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 16px 40px;
  position: relative; z-index: 1;
}

/* --- Offer --- */
.pb-left { display: flex; align-items: center; gap: 18px; }
.pb-icon-wrap {
  position: relative; width: 70px; height: 70px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pb-icon-svg {
  width: 50px; height: 54px; position: relative; z-index: 2;
  filter: drop-shadow(0 0 10px var(--pb-icon-glow)) drop-shadow(0 0 26px var(--pb-icon-glow));
}
.pb-ray { position: absolute; height: 3px; background: var(--pb-accent); border-radius: 2px; opacity: .88; z-index: 1; }
.pb-offer-text { white-space: nowrap; line-height: 1.2; }
.pb-t-white  { color: var(--pb-text); font-size: 27px; font-weight: 700; }
.pb-t-accent { color: var(--pb-accent); font-size: 38px; font-weight: 900; letter-spacing: -.5px; }

/* --- Save up to --- */
.pb-save {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 18px;
  border: 1.5px dashed var(--pb-box-border);
  border-radius: 12px;
  line-height: 1.1; white-space: nowrap;
}
.pb-save-lbl { font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--pb-muted); }
.pb-save-val { font-size: 28px; font-weight: 900; color: var(--pb-accent); }

/* --- Coupons --- */
.pb-coupon { display: flex; align-items: center; gap: 13px; flex-shrink: 0; }
.pb-tag-svg { width: 42px; height: 42px; flex-shrink: 0; color: var(--pb-tag); }
.pb-apply-lbl { font-size: 15px; font-weight: 600; white-space: nowrap; }
.pb-codes { display: flex; gap: 12px; }
.pb-code-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pb-code-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: var(--pb-accent);
}
.pb-code-tag:empty { display: none; }
.pb-code-box {
  font: inherit; color: var(--pb-text); margin: 0;
  background: var(--pb-box-bg);
  border: 1.5px solid var(--pb-box-border);
  border-radius: 10px; padding: 10px 20px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; white-space: nowrap; user-select: none;
  box-shadow: 0 0 16px var(--pb-box-glow), inset 0 0 12px rgba(255,255,255,.04);
  transition: box-shadow .2s, border-color .2s, transform .15s;
}
.pb-code-box:hover, .pb-code-box:focus-visible { border-color: var(--pb-text); box-shadow: 0 0 26px var(--pb-box-glow); outline: none; }
.pb-code-box:active { transform: scale(.97); }
.pb-code-box.pb-copied { border-color: rgba(124,252,158,.9); box-shadow: 0 0 20px rgba(124,252,158,.45); }
.pb-code-text { font-size: 22px; font-weight: 800; letter-spacing: 3px; }
.pb-copy-svg  { color: var(--pb-copy); flex-shrink: 0; }
.pb-codes:has(.pb-code-item:not([hidden]) ~ .pb-code-item:not([hidden])) .pb-code-text { font-size: 18px; letter-spacing: 2px; }
.pb-codes:has(.pb-code-item:not([hidden]) ~ .pb-code-item:not([hidden])) .pb-code-box { padding: 8px 14px; }

/* --- Countdown --- */
.pb-timer    { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.pb-timer-hd { display: flex; align-items: center; gap: 9px; }
.pb-watch-svg { width: 26px; height: 26px; color: var(--pb-accent); filter: drop-shadow(0 0 6px var(--pb-icon-glow)); }
.pb-ending-in { font-size: 15px; font-weight: 600; white-space: nowrap; }
.pb-countdown { display: flex; align-items: center; gap: 5px; }
.pb-num-box {
  background: var(--pb-num-bg);
  border: 1.5px solid var(--pb-box-border);
  border-radius: 8px; padding: 9px 12px 6px; min-width: 52px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pb-num      { font-size: 26px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pb-unit-lbl { color: var(--pb-muted); font-size: 9px; font-weight: 600; letter-spacing: .9px; }
.pb-colon    { font-size: 22px; font-weight: 700; opacity: .7; line-height: 1; }

.pb-spark { position: absolute; pointer-events: none; border-radius: 2px; z-index: 1; background: var(--pb-spark-a); }
.pb-spark--b { background: var(--pb-spark-b); }

.pb-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Responsive (relative to the banner's own width) --- */
/* Spread items across the full content width when they fit on one row. */
@container (min-width: 1300px) {
  .pb-center-group { justify-content: space-between; }
}
/* Coupon labels float above the boxes so the boxes sit on the row's centre line. */
@container (min-width: 601px) {
  .pb-code-item { position: relative; }
  .pb-code-tag { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 4px; text-align: center; white-space: nowrap; }
}
/* Theme content width (~1340px): compact single row. */
@container (max-width: 1499px) {
  .pb-center-group { gap: 14px 20px; }
  .pb-tag-svg, .pb-ending-in { display: none; }
  .pb-apply-lbl { font-size: 14px; }
  .pb-icon-wrap { width: 60px; height: 60px; }
  .pb-t-white  { font-size: 24px; }
  .pb-t-accent { font-size: 34px; }
  .pb-save-val { font-size: 25px; }
  .pb-code-text { font-size: 19px; letter-spacing: 2.5px; }
  .pb-code-box { padding: 9px 16px; }
  .pb-num-box { min-width: 46px; padding: 7px 8px 5px; }
  .pb-num { font-size: 22px; }
}
/* Mobile: one compact standard layout — headline row, coupon row, countdown row. */
@container (max-width: 600px) {
  .pb-banner { min-height: 0; padding: 10px 12px 12px; }
  .pb-banner .pb-inner { padding-right: 26px; }
  .pb-center-group { gap: 8px 10px; }
  .pb-close-btn { top: -2px; right: -4px; transform: none; width: 22px; height: 22px; }
  .pb-close-btn:hover, .pb-close-btn:focus-visible { transform: scale(1.12); }
  .pb-close-btn svg { width: 9px; height: 9px; }

  .pb-left { gap: 6px; }
  .pb-icon-wrap { width: 32px; height: 32px; }
  .pb-icon-svg { width: 24px; height: 26px; }
  .pb-ray { display: none; }
  .pb-t-white  { font-size: 17px; }
  .pb-t-accent { font-size: 22px; }

  /* Row 1: offer. Row 2: coupons. Row 3: save-up-to + countdown. */
  .pb-left { order: 1; }
  .pb-coupon { order: 2; }
  .pb-save { order: 3; padding: 3px 8px; border-radius: 7px; height: 36px; }
  .pb-timer { order: 4; }
  .pb-save-lbl { font-size: 7px; letter-spacing: .5px; }
  .pb-save-val { font-size: 15px; }

  .pb-coupon { width: 100%; justify-content: center; gap: 8px; }
  .pb-tag-svg, .pb-apply-lbl { display: none; }
  .pb-codes { gap: 8px; }
  .pb-code-item { gap: 2px; }
  .pb-code-tag { font-size: 8.5px; }
  .pb-code-box,
  .pb-codes:has(.pb-code-item:not([hidden]) ~ .pb-code-item:not([hidden])) .pb-code-box { padding: 6px 10px; gap: 8px; border-radius: 8px; }
  .pb-code-text,
  .pb-codes:has(.pb-code-item:not([hidden]) ~ .pb-code-item:not([hidden])) .pb-code-text { font-size: 14px; letter-spacing: 1.5px; }
  .pb-copy-svg { width: 14px; height: 14px; }

  .pb-timer { gap: 6px; }
  .pb-watch-svg { width: 16px; height: 16px; }
  .pb-ending-in { display: none; }
  .pb-countdown { gap: 3px; }
  .pb-num-box { min-width: 36px; padding: 4px 5px 3px; border-radius: 6px; gap: 0; }
  .pb-num { font-size: 15px; }
  .pb-unit-lbl { font-size: 7px; letter-spacing: .5px; }
  .pb-colon { font-size: 13px; }
}
@container (max-width: 300px) {
  .pb-banner { padding-left: 8px; padding-right: 8px; }
  .pb-watch-svg { display: none; }
  .pb-num-box { min-width: 32px; padding: 4px 3px 3px; }
  .pb-colon { font-size: 11px; }
  .pb-code-box,
  .pb-codes:has(.pb-code-item:not([hidden]) ~ .pb-code-item:not([hidden])) .pb-code-box { padding: 6px 8px; gap: 6px; }
  .pb-code-text,
  .pb-codes:has(.pb-code-item:not([hidden]) ~ .pb-code-item:not([hidden])) .pb-code-text { font-size: 13px; letter-spacing: 1px; }
}
