/* One fixed-height promotion line that sticks below the navigation.
   Background/text colour come from the settings page (--hps-promo-*); type follows the theme. */
.hps-promotion-bar {
  --hps-promo-height: 44px;
  position: sticky;
  top: calc(var(--hs-header-offset, 0px) + var(--hs-header-height, 0px) + var(--hs-sticky-benefits, 0px));
  z-index: 99;
  flex-shrink: 0;
  width: 100%;
  height: var(--hps-promo-height);
  box-sizing: border-box;
  padding: 0 24px;
  overflow: hidden;
  background: var(--hps-promo-bg, #E3D3BE);
  color: var(--hps-promo-ink, #02261E);
  border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: .01em;
}
.hps-promotion-bar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  max-width: 1200px;
  min-width: 0;
  margin: 0 auto;
}
/* Two classes: beats theme paragraph rules such as `.hsp-pax-page p { text-wrap: pretty }`, which re-enable wrapping. */
.hps-promotion-bar .hps-promotion-bar__text {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font: inherit;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hps-promotion-bar[hidden], .hps-promotion-bar__short { display: none; }
.hps-promotion-bar__lead { font-weight: 700; letter-spacing: .02em; }

/* Coupon label: the one filled element of the bar (ink on bar colour, works for every allowed background);
   both labels share one grid cell so "Kopiert ✓" never changes the width. */
.hps-promotion-bar__code {
  position: relative;
  z-index: 1;
  display: inline-grid;
  flex-shrink: 0;
  align-items: center;
  min-height: 30px;
  margin: 0;
  padding: 0 12px;
  border: 1px dashed var(--hps-promo-bg, #E3D3BE);
  outline: 1px solid var(--hps-promo-ink, #02261E);
  border-radius: 0;
  background: var(--hps-promo-ink, #02261E);
  color: var(--hps-promo-bg, #E3D3BE);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms ease;
}
.hps-promotion-bar__code > span { grid-area: 1 / 1; text-align: center; }
.hps-promotion-bar__code > span + span { visibility: hidden; letter-spacing: .02em; }
.hps-promotion-bar__code[data-copied] > span:first-child { visibility: hidden; }
.hps-promotion-bar__code[data-copied] > span + span { visibility: visible; }
@media (hover: hover) {
  .hps-promotion-bar__code:hover { background: color-mix(in srgb, var(--hps-promo-ink, #02261E) 84%, var(--hps-promo-bg, #E3D3BE)); }
}

/* Countdown: bold tabular figures behind a hairline, no ticking seconds. */
.hps-promotion-bar__countdown {
  flex-shrink: 0;
  padding-inline-start: 14px;
  border-inline-start: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  white-space: nowrap;
}
.hps-promotion-bar__countdown strong { font-weight: 700; font-variant-numeric: tabular-nums; }

.hps-promotion-bar__link {
  flex-shrink: 0;
  color: inherit;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
/* Like the open content rows: only the arrow moves, 4px over 180ms. */
.hps-promotion-bar__link span { display: inline-block; transition: transform 180ms ease-out; }
@media (hover: hover) {
  .hps-promotion-bar__link:hover { color: inherit; text-decoration-thickness: 2px; }
  .hps-promotion-bar__link:hover span { transform: translateX(4px); }
}
.hps-promotion-bar :is(.hps-promotion-bar__code, .hps-promotion-bar__link):focus-visible {
  outline: 2px solid var(--hps-promo-ink, #02261E);
  outline-offset: 4px;
}
.hps-promotion-bar__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Anchor jumps must land below navigation plus this bar (theme sets the base offset). */
html:has(body.hs-site .hps-promotion-bar) {
  scroll-padding-top: calc(var(--hs-header-offset, 0px) + var(--hs-header-height, 0px) + var(--hs-sticky-benefits, 0px) + 60px);
}

/* Below 1100px the long text no longer fits next to tag, countdown and link: use the short text. */
@media (max-width: 1100px) {
  .hps-promotion-bar__full { display: none; }
  .hps-promotion-bar__short { display: inline; }
}
@media (max-width: 600px) {
  .hps-promotion-bar { --hps-promo-height: 48px; padding: 0 16px; }
  .hps-promotion-bar__inner { gap: 10px; }
  .hps-promotion-bar__countdown { padding-inline-start: 10px; }
  .hps-promotion-bar__countdown-label { display: none; }
  .hps-promotion-bar__code { min-height: 34px; padding: 0 8px; letter-spacing: .06em; }
  /* The whole bar is the link; the copy button stays clickable above it. */
  .hps-promotion-bar__link {
    position: absolute;
    inset: 0;
    font-size: 0;
    color: transparent;
  }
  .hps-promotion-bar__link:focus-visible { outline-offset: -3px; }
  html:has(body.hs-site .hps-promotion-bar) { scroll-padding-top: calc(var(--hs-header-offset, 0px) + var(--hs-header-height, 0px) + 64px); }
  /* The PAX 3D screen owns the first mobile viewport: keep the bar in normal flow there. */
  body.hs-pax-configurator .hps-promotion-bar { position: static; }
  html:has(body.hs-site.hs-pax-configurator .hps-promotion-bar) { scroll-padding-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hps-promotion-bar__code, .hps-promotion-bar__link span { transition: none; }
}
