/* =====================================================
   HOMEPAGE ADVERT — Jakis Promotions
   A single dismissible floating card, bottom-right on
   desktop and a full-width bottom sheet on mobile. Kept
   small and closable so it never blocks the page — it
   enters once, softly, and stays out of the way after.
   ===================================================== */

.advert-popup {
  position: fixed;
  right: var(--space-sm);
  bottom: var(--space-sm);
  z-index: 150;
  width: min(340px, calc(100vw - (var(--space-sm) * 2)));
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: calc(100vh - (var(--space-sm) * 2));
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}

.advert-popup.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.advert-popup.is-leaving {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
}

.advert-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(16, 16, 18, 0.55);
  color: var(--color-white);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.advert-popup-close:hover {
  background: rgba(16, 16, 18, 0.8);
  transform: scale(1.06);
}

.advert-popup-close svg {
  width: 14px;
  height: 14px;
}

.advert-popup-viewport {
  width: 100%;
  overflow: hidden;
}

.advert-popup-track {
  display: flex;
  width: 100%;
  transition: transform var(--dur-slow) var(--ease);
}

.advert-popup-slide {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
}

.advert-popup-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.advert-popup-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 0 0 var(--space-xs);
  background: var(--color-white);
}

.advert-popup-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-line);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.advert-popup-dot.is-active {
  background: var(--color-gold);
  transform: scale(1.3);
}

.advert-popup-media {
  width: 100%;
  max-height: min(70vh, 520px);
  overflow: hidden;
  background: var(--color-ivory-dim);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.advert-popup-media img {
  width: 100%;
  height: auto;
  max-height: min(70vh, 520px);
  object-fit: contain;
  display: block;
}

.advert-popup-body {
  padding: var(--space-xs) var(--space-sm) var(--space-sm);
}

.advert-popup-eyebrow {
  margin-bottom: 0.4rem;
}

.advert-popup-headline {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--color-ink);
  margin: 0 0 0.35rem;
}

.advert-popup-text {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-ink-soft);
  margin: 0;
}

.advert-popup-cta {
  display: inline-flex;
  margin-top: var(--space-xs);
  padding: 0.65rem 1.3rem;
  font-size: 0.8rem;
}

/* Gentle, non-looping-forever pulse draws the eye to the CTA once it
   lands, then settles — reads as "ad energy" without nagging. */
.advert-popup.is-visible .advert-popup-slide.is-active .advert-popup-cta {
  animation: advertPulse 1600ms var(--ease) 700ms 2;
}

@keyframes advertPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 134, 59, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(184, 134, 59, 0); }
}

@media (max-width: 640px) {
  .advert-popup {
    left: var(--space-sm);
    right: var(--space-sm);
    bottom: var(--space-sm);
    width: auto;
  }

  .advert-popup-media {
    max-height: 50vh;
  }

  .advert-popup-media img {
    max-height: 50vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .advert-popup {
    transition: opacity var(--dur-fast) linear;
    transform: none;
  }
  .advert-popup.is-visible .advert-popup-cta {
    animation: none;
  }
}
