/* ═══ Thuần Nhiên — Phong Bì May Mắn (Lucky Envelope) ═══ */

.lucky-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: luckyFadeIn 0.25s ease-out;
}
.lucky-overlay.open { display: flex; }

@keyframes luckyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lucky-modal {
  background: linear-gradient(145deg, #fdf6e8 0%, #f4e8ce 100%);
  border: 2px solid #c49a3c;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 30px 80px rgba(196, 154, 60, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: luckyScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes luckyScaleIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.lucky-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(74, 46, 26, 0.08);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: #4a2e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.lucky-close:hover { background: rgba(180, 32, 32, 0.15); color: #b42020; }

.lucky-body {
  text-align: center;
  padding-top: 8px;
}

.lucky-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c49a3c;
  margin-bottom: 10px;
}

.lucky-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #4a2e1a;
  margin: 0 0 8px;
  line-height: 1.25;
}

.lucky-title-win {
  color: #2d5a3d;
}

.lucky-sub {
  font-size: 0.88rem;
  color: #6b5a42;
  margin: 0 0 20px;
  line-height: 1.5;
}

.lucky-sub strong {
  color: #c49a3c;
  font-weight: 700;
}

/* ─── 4 Phong Bì ─── */
.lucky-envelopes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 24px 0 16px;
}

.lucky-env {
  aspect-ratio: 3/4;
  background: linear-gradient(145deg, #b42020 0%, #8a1818 60%, #6b1414 100%);
  border: 2px solid #c49a3c;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 14px rgba(180, 32, 32, 0.3), inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.lucky-env::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(244, 232, 206, 0.4);
  border-radius: 6px;
  pointer-events: none;
}

.lucky-env::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

.lucky-env:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(180, 32, 32, 0.45), inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.lucky-env:disabled {
  cursor: default;
  opacity: 0.6;
}

.lucky-env-icon {
  font-size: 2.5rem;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s;
}

.lucky-env.picking {
  animation: luckyShake 0.5s ease-in-out infinite;
}
@keyframes luckyShake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}

.lucky-env.opened {
  background: linear-gradient(145deg, #fdf6e8 0%, #f4e8ce 100%);
  border-color: #c49a3c;
  animation: luckyFlip 0.7s ease-out;
}
@keyframes luckyFlip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}
.lucky-env.opened::before { border-color: rgba(196, 154, 60, 0.4); }
.lucky-env.opened::after { display: none; }

.lucky-env-prize {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #b42020;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.lucky-env-empty {
  font-size: 1.8rem;
  color: #9b8968;
  opacity: 0.5;
}

.lucky-footnote {
  font-size: 0.74rem;
  color: #9b8968;
  font-style: italic;
  margin-top: 4px;
}

/* ─── Win / Lose screens ─── */
.lucky-win-big {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4.5rem;
  font-weight: 900;
  color: #b42020;
  margin: 20px 0 14px;
  line-height: 1;
  text-shadow: 0 4px 12px rgba(180, 32, 32, 0.2);
  animation: luckyPopIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.lucky-win-big-r2 {
  color: #2d5a3d;
  text-shadow: 0 4px 12px rgba(45, 90, 61, 0.2);
}
@keyframes luckyPopIn {
  0% { opacity: 0; transform: scale(0.3); }
  60% { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

.lucky-lose-big {
  font-size: 3.5rem;
  margin: 20px 0 8px;
  opacity: 0.7;
}

/* ─── CTA buttons ─── */
.lucky-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-family: 'DM Sans', sans-serif;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  margin-top: 12px;
  -webkit-tap-highlight-color: transparent;
}

.lucky-cta-primary {
  background: #2d5a3d;
  color: #fdf6e8;
  box-shadow: 0 4px 12px rgba(45, 90, 61, 0.25);
}
.lucky-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(45, 90, 61, 0.35); }

.lucky-cta-zalo {
  background: #0068ff;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 104, 255, 0.25);
}
.lucky-cta-zalo:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 104, 255, 0.35); }

.lucky-cta-secondary {
  background: transparent;
  color: #4a2e1a;
  border: 1.5px solid #c49a3c;
}
.lucky-cta-secondary.ready {
  background: #c49a3c;
  color: #fdf6e8;
  animation: luckyPulse 1.6s ease-in-out infinite;
}
.lucky-cta-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@keyframes luckyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 154, 60, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(196, 154, 60, 0); }
}

.lucky-skip {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: #9b8968;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}
.lucky-skip:hover { color: #4a2e1a; }

.lucky-share-row {
  margin-top: 4px;
}

/* ─── Confetti canvas ─── */
.lucky-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10001;
}

/* ─── Discount indicator in cart summary (Step 3 QR) ─── */
.lucky-discount-badge {
  background: linear-gradient(135deg, #b42020 0%, #8a1818 100%);
  color: #fdf6e8;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  box-shadow: 0 2px 8px rgba(180, 32, 32, 0.2);
}

/* ─── Mobile tweaks ─── */
@media (max-width: 480px) {
  .lucky-modal {
    padding: 22px 18px;
    max-width: 94vw;
  }
  .lucky-title { font-size: 1.25rem; }
  .lucky-win-big { font-size: 3.5rem; }
  .lucky-env-icon { font-size: 2rem; }
  .lucky-envelopes { gap: 10px; }
}
