/* Beyond Gaming Popup
   Uses the child theme's brand tokens (--bg-*) when present, with
   hard-coded fallbacks so the popup still looks right if the theme
   is ever swapped. */

.bgp-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(26, 0, 48, 0.65);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* The display:flex above would otherwise override the browser's
   default [hidden] → display:none, leaving an invisible overlay
   that blocks all clicks on the page. */
.bgp-overlay[hidden] {
  display: none !important;
}

.bgp-overlay.bgp-visible {
  opacity: 1;
}

.bgp-popup {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: var(--bg-radius-xl, 24px);
  background: linear-gradient(135deg, #1a0030 0%, #350361 50%, #6b11a1 100%);
  box-shadow: var(--bg-shadow-purple, 0 12px 32px rgba(107, 17, 161, 0.18)),
              0 24px 64px rgba(26, 0, 48, 0.45);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #fff;
  font-family: var(--bg-font-sans, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.bgp-overlay.bgp-visible .bgp-popup {
  transform: translateY(0) scale(1);
}

/* ---- Alert mode: warning icon + rain ---- */

.bgp-popup.bgp-alert {
  overflow: hidden; /* keep raindrops inside the rounded card */
}

.bgp-rain {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.bgp-drop {
  position: absolute;
  top: -12%;
  width: 2px;
  height: 14%;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(216, 180, 254, 0), rgba(216, 180, 254, 0.75));
  animation: bgp-fall linear infinite;
}

@keyframes bgp-fall {
  to {
    transform: translateY(900%);
  }
}

.bgp-body {
  position: relative; /* sit above the rain layer */
}

.bgp-warning {
  margin-bottom: 8px;
  animation: bgp-pulse 1.6s ease-in-out infinite;
}

.bgp-warning svg {
  filter: drop-shadow(0 6px 16px rgba(245, 158, 11, 0.45));
}

@keyframes bgp-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.bgp-image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--bg-radius-xl, 24px) var(--bg-radius-xl, 24px) 0 0;
}

.bgp-body {
  padding: 32px 28px 36px;
  text-align: center;
}

.bgp-heading {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #fcd34d, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fbbf24; /* fallback if background-clip unsupported */
}

.bgp-message {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--bg-purple-200, #e9d5ff);
}

.bgp-message a {
  color: var(--bg-gold-300, #fcd34d);
  text-decoration: underline;
}

.bgp-button {
  display: inline-block;
  padding: 13px 36px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: var(--bg-shadow-gold, 0 12px 32px rgba(245, 158, 11, 0.25));
  color: var(--bg-ink-deep, #1a0030) !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bgp-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(245, 158, 11, 0.4);
  color: var(--bg-ink-deep, #1a0030) !important;
}

/* High specificity + !important so Woodmart/WooCommerce button
   styles can't restyle or reposition the close button. */
.bgp-overlay .bgp-popup button.bgp-close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 2;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  outline: none;
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
  color: #fff !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.bgp-overlay .bgp-popup button.bgp-close:hover,
.bgp-overlay .bgp-popup button.bgp-close:focus {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  transform: rotate(90deg);
}

.bgp-overlay .bgp-popup button.bgp-close:focus-visible {
  outline: 2px solid var(--bg-gold-400, #fbbf24);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .bgp-body {
    padding: 26px 20px 30px;
  }
  .bgp-heading {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bgp-overlay,
  .bgp-popup,
  .bgp-button,
  .bgp-close {
    transition: none;
  }
  .bgp-drop,
  .bgp-warning {
    animation: none;
  }
}
