/* Lucky Popups — storefront stylesheet
   Class names match chrome.js + template builders exactly.
   Colors/opacity set inline by chrome.js are NOT redeclared here.
   z-index: 2147483000 keeps the overlay above virtually everything. */

/* ── Overlay ─────────────────────────────────────────────────── */
.lp-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483000;
  /* background set inline by chrome.js (rgba overlay) */
}

/* bar / fullscreen variants: no centering flex */
.lp-overlay:has(.lp-bar),
.lp-overlay:has(.lp-fullscreen) {
  align-items: flex-start;
  justify-content: flex-start;
}

/* ── Dialog base ─────────────────────────────────────────────── */
.lp-dialog {
  position: relative;
  box-sizing: border-box;
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  outline: none;
  /* bg / color / border-radius / font-family set inline by chrome.js */
}

/* ── Layout variants ─────────────────────────────────────────── */

/* center (default) — already centered by overlay flex */
.lp-dialog.lp-center {
  max-width: 560px;
}

/* slidein — bottom-right corner */
.lp-dialog.lp-slidein {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 380px;
  width: 100%;
  animation: lp-slidein-in 0.3s ease-out;
}

/* bar — full-width top strip */
.lp-dialog.lp-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: 0;
}

/* fullscreen — fills viewport */
.lp-dialog.lp-fullscreen {
  position: fixed;
  inset: 0;
  max-width: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Close button ────────────────────────────────────────────── */
.lp-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  opacity: 0.6;
  color: inherit;
  transition: opacity 0.15s;
}
.lp-close:hover {
  opacity: 1;
}

/* ── Template shared ─────────────────────────────────────────── */
.lp-template {
  width: 100%;
}

.lp-template h1,
.lp-template h2,
.lp-template h3 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.25;
}

.lp-template p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

/* ── Images ──────────────────────────────────────────────────── */
.lp-template img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Forms ───────────────────────────────────────────────────── */
.lp-template form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.lp-template input[type="email"],
.lp-template input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: #111;
}

.lp-template input[type="email"]:focus,
.lp-template input[type="text"]:focus {
  outline: 2px solid rgba(0, 0, 0, 0.4);
  outline-offset: 1px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  background: var(--lp-btn-bg, #111);
  color: var(--lp-btn-text, #fff);
  transition: opacity 0.15s;
}
.lp-btn:hover {
  opacity: 0.88;
}

/* ── Discount code display ───────────────────────────────────── */
.lp-code {
  display: inline-block;
  font-family: monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
  margin-right: 0.5rem;
}

.lp-copy-btn {
  font-size: 0.875rem;
  padding: 0.3rem 0.75rem;
  vertical-align: middle;
}

/* ── Success message ─────────────────────────────────────────── */
.lp-success {
  padding: 0.75rem 0;
  font-weight: 500;
}

/* ── Scratch card ────────────────────────────────────────────── */
.lp-scratch-area {
  text-align: center;
}
.lp-scratch-hint {
  font-size: 0.9rem;
  opacity: 0.75;
  margin: 0 0 0.5rem;
}
/* Wrap is sized by the prize content; the foil canvas sits absolutely on top of it,
   so scratching the foil reveals the prize beneath. */
.lp-canvas-wrap {
  position: relative;
  max-width: 300px;
  margin: 0.5rem auto;
  border-radius: 8px;
  overflow: hidden;
}
.lp-prize-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  min-height: 120px;
  text-align: center;
}
.lp-foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.lp-win-message {
  margin: 0;
  font-weight: 600;
}
.lp-prize-label {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}
.lp-lose-message {
  margin: 0;
}
.lp-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lp-reveal-btn {
  margin-top: 0.75rem;
}

/* ── Age gate actions ────────────────────────────────────────── */
.lp-age-gate-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ── Announcement bar text ───────────────────────────────────── */
.lp-announcement-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .lp-dialog.lp-center,
  .lp-dialog.lp-slidein {
    max-width: 100%;
    width: 100%;
    bottom: 0;
    right: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .lp-overlay:has(.lp-center),
  .lp-overlay:has(.lp-slidein) {
    align-items: flex-end;
  }
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes lp-slidein-in {
  from {
    transform: translateY(1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lp-dialog,
  .lp-close,
  .lp-btn {
    transition: none;
    animation: none;
  }
  .lp-dialog.lp-slidein {
    animation: none;
  }
}
