/* ═══════════════════════════════════════════════════════
   FUNNEL OVERLAYS: sticky offer bar (mobile) and
   exit-intent panel (desktop).

   Width discipline is enforced here, not only in script:
     · the sticky bar exists only up to 768px
     · the exit panel exists only from 1024px
   so a broken script can never put a full-screen panel in
   front of a phone visitor.
═══════════════════════════════════════════════════════ */

.sticky-offer,
.exit-offer {
  --fo-card: rgba(16, 14, 44, 0.97);
  --fo-border: rgba(139, 127, 217, 0.34);
  --fo-text-1: #FFFFFF;
  --fo-text-2: #D8D5F0;
  --fo-text-3: #A8A5C8;
  --fo-gold: #FFD93D;
  --fo-gold-2: #F9C846;
  font-family: var(--font-secondary, 'Inter', sans-serif);
}

.sticky-offer[hidden],
.exit-offer[hidden] {
  display: none;
}

/* ── Sticky bar: mobile only ───────────────────────── */

.sticky-offer {
  display: none;
}

@media (max-width: 768px) {
  .sticky-offer {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    background: var(--fo-card);
    border-top: 1px solid var(--fo-border);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.42);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    transition: transform 0.28s ease;
  }

  .sticky-offer[data-shown] {
    transform: translateY(0);
  }

  .sticky-offer-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 560px;
    margin: 0 auto;
  }

  .sticky-offer-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sticky-offer-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--fo-text-1);
    line-height: 1.25;
  }

  .sticky-offer-price {
    font-size: 12px;
    color: var(--fo-text-3);
    line-height: 1.2;
  }

  .sticky-offer-button {
    flex: 0 0 auto;
    padding: 10px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fo-gold) 0%, var(--fo-gold-2) 100%);
    color: #1A1608;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }

  .sticky-offer-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--fo-border);
    border-radius: 8px;
    color: var(--fo-text-3);
    cursor: pointer;
    padding: 0;
  }

  .sticky-offer-close svg {
    width: 12px;
    height: 12px;
  }

  /* Reserve the bar's height so it never sits over the footer or the
     last line of copy. The script sets the value it measured. */
  body.has-sticky-offer {
    padding-bottom: var(--sticky-offer-height, 68px);
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .sticky-offer {
    transition: none;
  }
}

/* ── Exit-intent panel: desktop only ──────────────── */

.exit-offer {
  display: none;
}

@media (min-width: 1024px) {
  .exit-offer {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1050;
  }

  .exit-offer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 3, 16, 0.72);
    backdrop-filter: blur(3px);
  }

  .exit-offer-panel {
    position: relative;
    width: min(560px, calc(100vw - 64px));
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    margin: 0 auto;
    top: 50%;
    transform: translateY(-50%);
    background: var(--fo-card);
    border: 1px solid var(--fo-border);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    padding: 36px 40px 32px;
    text-align: left;
  }

  .exit-offer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--fo-border);
    border-radius: 9px;
    color: var(--fo-text-3);
    cursor: pointer;
    padding: 0;
  }

  .exit-offer-close:hover {
    color: var(--fo-text-1);
  }

  .exit-offer-close svg {
    width: 13px;
    height: 13px;
  }

  .exit-offer-eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--fo-gold);
    margin-bottom: 12px;
  }

  .exit-offer-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--fo-text-1);
    margin: 0 0 14px;
    padding-right: 32px;
    text-wrap: balance;
  }

  .exit-offer-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--fo-text-3);
    margin: 0 0 18px;
  }

  .exit-offer-facts {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .exit-offer-facts li {
    position: relative;
    padding-left: 20px;
    font-size: 14.5px;
    color: var(--fo-text-2);
    line-height: 1.5;
  }

  .exit-offer-facts li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fo-gold);
  }

  .exit-offer-button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--fo-gold) 0%, var(--fo-gold-2) 100%);
    color: #1A1608;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(255, 217, 61, 0.2);
  }

  .exit-offer-button:hover {
    color: #1A1608;
    transform: translateY(-1px);
  }

  .exit-offer-decline {
    display: block;
    margin-top: 14px;
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 14px;
    color: var(--fo-text-3);
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
  }

  .exit-offer-decline:hover {
    color: var(--fo-text-1);
  }
}
