/* ═══════════════════════════════════════════════════════════
   PROMO POPUP
   Self-contained so it can be dropped on any page, including
   index.php which carries its own inline styles.
   ═══════════════════════════════════════════════════════════ */

body.promo-locked {
  overflow: hidden;
}

.promo {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.promo.is-open {
  opacity: 1;
}

.promo[hidden] {
  display: none;
}

.promo__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 72%);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.promo__dialog {
  position: relative;
  width: min(100%, 1040px);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border-radius: 12px;
  background: #0d0d0f;
  box-shadow: 0 32px 80px rgb(0 0 0 / 55%);
  transform: translateY(14px) scale(0.985);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
}

.promo.is-open .promo__dialog {
  transform: none;
}

.promo__media {
  display: block;
  line-height: 0;
}

.promo__media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 48px);
  object-fit: contain;
}

a.promo__media {
  cursor: pointer;
}

/* close button */

.promo__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 50%;
  background: rgb(0 0 0 / 45%);
  color: #fff;
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.promo__close:hover,
.promo__close:focus-visible {
  border-color: #fff;
  background: rgb(0 0 0 / 75%);
  transform: rotate(90deg);
  outline: none;
}

/* the hold countdown */

.promo__timer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgb(255 255 255 / 14%);
}

.promo__timer span {
  display: block;
  width: 100%;
  height: 100%;
  background: #8ab4d8;
}

@media (max-width: 640px) {
  .promo {
    padding: 16px;
  }

  .promo__dialog {
    border-radius: 10px;
  }

  /* 44px keeps the close button a comfortable tap target on touch
     screens — below that it is easy to miss and hit the banner instead. */
  .promo__close {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    font-size: 24px;
  }
}

/* Someone who asked for less motion gets no slide, no countdown bar
   animation — the popup simply appears and waits to be dismissed. */
@media (prefers-reduced-motion: reduce) {
  .promo,
  .promo__dialog {
    transition: none;
  }

  .promo__dialog {
    transform: none;
  }

  .promo__timer span {
    transition: none !important;
  }
}
