/* ==================================================
   ALPHA RISE METHOD — WINTER ARC PROMOTIONAL COUPON
   Seasonal 3D Gift Coupon Module (Mission-HUD Aesthetic)
   Mobile-First Architecture & GPU-Accelerated Shaders
   ================================================== */

/* --- 1. OVERLAY & BACKDROP --- */
.wa-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.wa-overlay.wa-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wa-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1;
}

/* Subtle ambient snowfall container in overlay background */
.wa-snow-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.wa-flake {
  position: absolute;
  top: -24px;
  color: #D6ECFF;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1;
  text-shadow: 0 0 8px rgba(180, 220, 255, 0.6);
  will-change: transform, opacity;
  animation: waFall linear forwards;
}

/* Snowflake Burst Particles on Card Flip */
.wa-burst-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  color: #E2F2FF;
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 0 10px rgba(180, 220, 255, 0.8);
  z-index: 20;
  will-change: transform, opacity;
  animation: waBurstParticle 1.2s cubic-bezier(0.12, 0.8, 0.32, 1) forwards;
}

/* --- 2. STAGE & WRAPPER --- */
.wa-stage {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 24px;
  max-width: 100vw;
  box-sizing: border-box;
}

.wa-wrap {
  position: relative;
  perspective: 1200px;
  -webkit-perspective: 1200px;
}

/* Card Entry Drop Animation */
.wa-overlay.wa-show .wa-wrap {
  animation: waCardDrop 0.92s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* --- 3. CLOSE BUTTON (44x44px Touch Target) --- */
.wa-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 16, 19, 0.85);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
  z-index: 10;
  border-radius: 0;
  outline: none;
}

.wa-close:hover {
  color: var(--white);
  border-color: var(--hud);
  background: var(--surface-2);
}

.wa-close:active {
  transform: scale(0.94);
}

.wa-close:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* --- 4. 3D CARD CONTAINER --- */
.wa-card {
  position: relative;
  width: min(88vw, 326px);
  height: 204px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.34, 1.25, 0.64, 1);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.wa-card:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.wa-card.flipped {
  transform: rotateY(180deg);
}

/* --- 5. CARD FACES (HUD PLATE GEOMETRY) --- */
.wa-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: linear-gradient(145deg, #14161F 0%, #0E0F14 55%, #090A0D 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(210, 235, 255, 0.32);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 18px 46px rgba(0, 0, 0, 0.8),
    0 0 28px rgba(160, 215, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 20px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 0 !important;
}

/* Subtle Tactical Reticles in Corners */
.wa-reticle {
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  z-index: 4;
}

.wa-reticle-tl {
  top: 3px;
  left: 3px;
  border-top: 1.5px solid rgba(180, 220, 255, 0.4);
  border-left: 1.5px solid rgba(180, 220, 255, 0.4);
}

.wa-reticle-tr {
  top: 3px;
  right: 3px;
  border-top: 1.5px solid rgba(180, 220, 255, 0.4);
  border-right: 1.5px solid rgba(180, 220, 255, 0.4);
}

.wa-reticle-bl {
  bottom: 3px;
  left: 3px;
  border-bottom: 1.5px solid rgba(180, 220, 255, 0.4);
  border-left: 1.5px solid rgba(180, 220, 255, 0.4);
}

.wa-reticle-br {
  bottom: 3px;
  right: 3px;
  border-bottom: 1.5px solid rgba(180, 220, 255, 0.4);
  border-right: 1.5px solid rgba(180, 220, 255, 0.4);
}

/* --- 6. FRONT FACE SPECIFICS --- */
.wa-front {
  transform: rotateY(0deg);
  z-index: 2;
}

/* Subtle Shimmer Sweep across Front Face */
.wa-shimmer-sweep {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 20%,
    rgba(195, 230, 255, 0.16) 50%,
    rgba(255, 255, 255, 0.02) 80%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: waShine 2.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
  z-index: 3;
}

.wa-front-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wa-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #A0D3FA;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.wa-tag-snowflake {
  color: #BBE1FF;
  font-size: 12px;
  line-height: 1;
}

.wa-front h3,
.wa-front-title {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(22px, 6.2vw, 25px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.wa-front p,
.wa-front-sub {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: waPulse 2s ease-in-out infinite;
}

/* --- 7. BACK FACE SPECIFICS --- */
.wa-back {
  transform: rotateY(180deg);
  z-index: 1;
}

.wa-back-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
}

.wa-back .wa-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
}

/* 50% OFF Strongest Visual Element */
.wa-offer {
  font-family: var(--font-display);
  font-size: clamp(34px, 9.5vw, 40px);
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  letter-spacing: 0.02em;
  margin: 3px 0 6px;
  text-shadow: 0 0 20px rgba(180, 220, 255, 0.28);
}

/* WINTER Coupon Code Box */
.wa-code-wrap {
  margin: 2px 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(180, 220, 255, 0.38);
  border-radius: 0;
}

.wa-code {
  font-family: var(--font-mono);
  font-size: clamp(19px, 5.2vw, 22px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--white);
  text-indent: 0.22em;
  user-select: all;
  -webkit-user-select: all;
}

/* Copy Button matching site .btn-primary */
.wa-copy {
  padding: 8px 24px !important;
  font-size: 12.5px !important;
  letter-spacing: 0.08em !important;
  min-height: 38px !important;
  cursor: pointer;
  border-radius: 0 !important;
  margin-top: 2px;
}

button.btn.wa-copy.copied,
button.btn.wa-copy.copied:hover,
button.btn.wa-copy.copied:focus,
button.btn.wa-copy.copied:active,
.wa-copy.copied,
.wa-copy.copied:hover {
  background: #3BE08C !important;
  background-color: #3BE08C !important;
  border-color: #3BE08C !important;
  color: #08080A !important;
  box-shadow: 0 0 24px rgba(59, 224, 140, 0.55) !important;
}

button.btn.wa-copy.copied *,
button.btn.wa-copy.copied:hover *,
.wa-copy.copied * {
  color: #08080A !important;
  font-weight: 700 !important;
}

button.btn.wa-copy.failed,
.wa-copy.failed {
  background: #3A181C !important;
  border-color: var(--red) !important;
  color: var(--white) !important;
}

/* --- 8. KEYFRAME ANIMATIONS --- */
@keyframes waCardDrop {
  0% {
    transform: translateY(-120vh) scale(0.95) rotate(-2.5deg);
    opacity: 0;
  }
  62% {
    transform: translateY(20px) scale(1.01) rotate(0.4deg);
    opacity: 1;
  }
  84% {
    transform: translateY(-6px) scale(0.996) rotate(-0.15deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes waShine {
  0% {
    left: -130%;
  }
  42%, 100% {
    left: 170%;
  }
}

@keyframes waPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.58;
  }
}

@keyframes waFall {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: var(--wa-opacity, 0.65);
  }
  85% {
    opacity: var(--wa-opacity, 0.65);
  }
  100% {
    transform: translateY(105vh) translateX(var(--driftX, 30px)) rotate(var(--rot, 180deg));
    opacity: 0;
  }
}

@keyframes waBurstParticle {
  0% {
    transform: translate(-50%, -50%) translate3d(0, 0, 0) scale(0.5) rotate(0deg);
    opacity: 1;
  }
  60% {
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) translate3d(var(--bx), var(--by), 0) scale(var(--bs, 1)) rotate(var(--br, 90deg));
    opacity: 0;
  }
}

/* --- 9. ACCESSIBILITY: REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  .wa-overlay.wa-show .wa-wrap {
    animation: none !important;
    transform: none !important;
  }

  .wa-shimmer-sweep {
    display: none !important;
    animation: none !important;
  }

  .wa-front p,
  .wa-front-sub {
    animation: none !important;
    opacity: 1 !important;
  }

  .wa-card {
    transition: transform 0.2s ease !important;
  }

  .wa-flake {
    animation: none !important;
    display: none !important;
  }

  .wa-burst-particle {
    display: none !important;
  }
}
