/* ═══ DIWALI DHAMAKA OFFER — popup + floating banner + cursor tag ═══
   Patterns adapted from 21st.dev: Event Countdown Card (urgency timer),
   unlumen Cursor (spring-follow label with velocity tilt), Cursor Trail (particles). */
:root {
  --dw-night: #16040f;
  --dw-plum: #2a0a22;
  --dw-gold: #ffd36b;
  --dw-amber: #ff9f1c;
  --dw-red: #ff5555;
  --dw-cream: #fff4dc;
  --dw-gold-grad: linear-gradient(100deg, #fff1b8 0%, #ffd36b 30%, #ff9f1c 60%, #ffd36b 100%);
}

/* ── POPUP ─────────────────────────────────────────────── */
#dw-pop {
  position: fixed; inset: 0; z-index: 99996;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(10, 2, 8, 0.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s;
}
#dw-pop.dw-open { opacity: 1; visibility: visible; }

.dw-card {
  position: relative; width: 100%; max-width: 460px;
  max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 26px; padding: 30px 26px 24px;
  color: var(--dw-cream); font-family: "Nunito", sans-serif; text-align: center;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 159, 28, .35), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(255, 85, 85, .25), transparent 60%),
    linear-gradient(160deg, var(--dw-plum), var(--dw-night) 70%);
  box-shadow: 0 30px 90px rgba(255, 159, 28, .3), 0 0 40px rgba(255, 85, 85, .25);
  transform: translateY(40px) scale(.92); opacity: 0;
  transition: transform .6s cubic-bezier(.2, 1.4, .4, 1), opacity .4s ease;
  scrollbar-width: none;
}
.dw-card::-webkit-scrollbar { display: none; }
#dw-pop.dw-open .dw-card { transform: none; opacity: 1; }

/* rotating glow border */
.dw-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--dw-angle, 0deg), #ffd36b, #ff5555, #ff9f1c, #ffd36b);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: dw-spin 4s linear infinite;
}
@property --dw-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes dw-spin { to { --dw-angle: 360deg; } }

/* twinkling sparkles background */
.dw-sky { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.dw-sky i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--dw-gold); box-shadow: 0 0 8px 2px rgba(255, 211, 107, .7);
  animation: dw-twinkle 2.4s ease-in-out infinite;
}
@keyframes dw-twinkle { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.3); } }

/* hanging diyas */
.dw-diyas { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 22px; pointer-events: none; }
.dw-diyas span {
  display: block; font-size: 22px; transform-origin: top center;
  animation: dw-swing 2.8s ease-in-out infinite;
}
.dw-diyas span::before { content: ""; display: block; width: 1px; height: 14px; margin: 0 auto; background: rgba(255, 211, 107, .5); }
.dw-diyas span:nth-child(2) { animation-delay: -.9s; } .dw-diyas span:nth-child(3) { animation-delay: -1.7s; }
@keyframes dw-swing { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }

.dw-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255, 244, 220, .25); background: rgba(255, 255, 255, .06);
  color: var(--dw-cream); font-size: 15px; line-height: 1; cursor: pointer; z-index: 2;
  transition: background .2s, transform .2s;
}
.dw-close:hover { background: rgba(255, 255, 255, .16); transform: rotate(90deg); }

.dw-badge {
  position: relative; display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  padding: 6px 14px; border-radius: 50px; font-size: 12px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: #2a0a00;
  background: var(--dw-gold-grad); background-size: 200% 100%;
  animation: dw-shine 3s linear infinite;
}
@keyframes dw-shine { to { background-position: -200% 0; } }

.dw-title {
  position: relative; margin: 14px 0 4px;
  font-family: "Unbounded", "Bricolage Grotesque", sans-serif; font-weight: 800;
  font-size: clamp(1.45rem, 5.4vw, 1.9rem); line-height: 1.15; color: #fff;
}
.dw-title em {
  font-style: normal; background: var(--dw-gold-grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: dw-shine 3s linear infinite;
}
.dw-price {
  position: relative; display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 6px 0 2px;
}
.dw-price b {
  font-family: "Unbounded", "Bricolage Grotesque", sans-serif; font-weight: 900;
  font-size: clamp(2.6rem, 11vw, 3.4rem); line-height: 1;
  background: var(--dw-gold-grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 159, 28, .45));
  animation: dw-shine 3s linear infinite, dw-pulse 1.8s ease-in-out infinite;
}
.dw-price small { font-size: 1rem; font-weight: 700; color: rgba(255, 244, 220, .8); }
@keyframes dw-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.dw-sub { position: relative; font-size: .92rem; line-height: 1.5; color: rgba(255, 244, 220, .78); margin: 4px 0 14px; }

.dw-pick-label { position: relative; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dw-gold); margin-bottom: 8px; }
.dw-chips { position: relative; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-bottom: 16px; }
.dw-chip {
  padding: 7px 12px; border-radius: 50px; font: 700 .8rem "Nunito", sans-serif;
  color: var(--dw-cream); background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 211, 107, .28); cursor: pointer;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.dw-chip:hover { transform: translateY(-2px); border-color: var(--dw-gold); }
.dw-chip[aria-pressed="true"] { background: var(--dw-gold-grad); color: #2a0a00; border-color: transparent; }

.dw-timer { position: relative; display: flex; justify-content: center; gap: 8px; margin-bottom: 18px; }
.dw-timer div {
  min-width: 58px; padding: 8px 4px 6px; border-radius: 12px;
  background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 211, 107, .22);
}
.dw-timer b { display: block; font: 800 1.25rem "Unbounded", "Bricolage Grotesque", sans-serif; color: #fff; font-variant-numeric: tabular-nums; }
.dw-timer span { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 244, 220, .6); }
.dw-ends { position: relative; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dw-red); margin-bottom: 6px; }

.dw-cta {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px 20px; border: 0; border-radius: 16px; cursor: pointer;
  font: 800 1.05rem "Nunito", sans-serif; color: #fff; text-decoration: none;
  background: linear-gradient(100deg, #ff5555, #ff7a1c 55%, #ff5555);
  box-shadow: 0 12px 30px rgba(255, 85, 85, .45);
  transition: transform .2s, box-shadow .2s;
  animation: dw-cta-pop 2.2s ease-in-out infinite;
}
.dw-cta::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); animation: dw-sweep 2.6s ease-in-out infinite;
}
.dw-cta:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 16px 40px rgba(255, 85, 85, .6); }
@keyframes dw-sweep { 0% { left: -60%; } 60%, 100% { left: 130%; } }
@keyframes dw-cta-pop { 0%, 100% { box-shadow: 0 12px 30px rgba(255, 85, 85, .45); } 50% { box-shadow: 0 12px 44px rgba(255, 159, 28, .7); } }

.dw-later { position: relative; margin-top: 10px; background: none; border: 0; color: rgba(255, 244, 220, .55); font: 600 .82rem "Nunito", sans-serif; cursor: pointer; text-decoration: underline; }
.dw-trust { position: relative; margin-top: 10px; font-size: .75rem; color: rgba(255, 244, 220, .6); }

/* firework burst particles (popup open + CTA click) */
.dw-burst { position: fixed; z-index: 99998; width: 6px; height: 6px; border-radius: 50%; pointer-events: none;
  animation: dw-burst .9s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes dw-burst { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* ── FLOATING BANNER (follows scroll) ──────────────────── */
#dw-float {
  position: fixed; left: 92px; bottom: 22px; z-index: 9997;
  width: 300px; border-radius: 20px; padding: 14px 16px 14px 14px;
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  font-family: "Nunito", sans-serif; color: var(--dw-cream);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 159, 28, .35), transparent 55%),
    linear-gradient(140deg, var(--dw-plum), var(--dw-night));
  box-shadow: 0 18px 50px rgba(22, 4, 15, .45), 0 0 0 1px rgba(255, 211, 107, .3) inset;
  transform: translateY(160px); opacity: 0;
  transition: opacity .4s ease;
  will-change: transform;
}
#dw-float.dw-in { opacity: 1; }
#dw-float::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  background: conic-gradient(from var(--dw-angle, 0deg), #ffd36b, transparent 30%, #ff5555 50%, transparent 80%, #ffd36b);
  animation: dw-spin 3.5s linear infinite;
}
.dw-f-link { display: flex; align-items: center; gap: inherit; width: 100%; color: inherit; text-decoration: none; }
.dw-f-diya { position: relative; flex: 0 0 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  font-size: 28px; background: rgba(255, 211, 107, .12); }
.dw-f-diya::after { content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 211, 107, .55), transparent 70%); animation: dw-flicker 1.2s ease-in-out infinite alternate; }
@keyframes dw-flicker { from { opacity: .4; transform: scale(.85); } to { opacity: 1; transform: scale(1.15); } }
.dw-f-txt { flex: 1; min-width: 0; line-height: 1.25; }
.dw-f-tag { white-space: nowrap; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dw-gold); }
.dw-f-main { font-weight: 800; font-size: .95rem; color: #fff; }
.dw-f-main b { background: var(--dw-gold-grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: dw-shine 3s linear infinite; }
.dw-f-timer { font-size: .72rem; color: rgba(255, 244, 220, .7); font-variant-numeric: tabular-nums; }
.dw-f-go { flex: 0 0 auto; padding: 8px 11px; border-radius: 10px; font-weight: 800; font-size: .78rem; color: #fff;
  background: linear-gradient(100deg, #ff5555, #ff7a1c); animation: dw-cta-pop 2.2s ease-in-out infinite; }
.dw-f-x { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff4dc; color: #2a0a22; font-size: 11px; font-weight: 900; line-height: 24px; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }

/* ── CURSOR TAG + SPARKLE TRAIL (desktop) ──────────────── */
#dw-cursor {
  position: fixed; top: 0; left: 0; z-index: 99997; pointer-events: none;
  padding: 7px 12px 7px 9px; border-radius: 50px; white-space: nowrap;
  font: 800 .78rem "Nunito", sans-serif; color: #2a0a00;
  background: var(--dw-gold-grad); background-size: 200% 100%;
  box-shadow: 0 8px 24px rgba(255, 159, 28, .45);
  opacity: 0; transition: opacity .3s ease;
  animation: dw-shine 3s linear infinite;
  will-change: transform;
}
#dw-cursor.dw-show { opacity: 1; }
#dw-cursor i { font-style: normal; margin-right: 4px; }
.dw-spark { position: fixed; z-index: 99996; width: 5px; height: 5px; border-radius: 50%; pointer-events: none;
  background: #ffd36b; box-shadow: 0 0 6px 2px rgba(255, 180, 60, .8);
  animation: dw-fall .8s ease-out forwards; }
@keyframes dw-fall { to { transform: translate(var(--dx), 26px) scale(0); opacity: 0; } }

/* ── MOBILE ────────────────────────────────────────────── */
@media (max-width: 600px) {
  #dw-float { left: 10px; right: 86px; bottom: 90px; width: auto; padding: 10px 12px 10px 10px; gap: 10px; border-radius: 16px; }
  .dw-f-diya { flex-basis: 42px; height: 42px; font-size: 22px; }
  .dw-f-main { font-size: .85rem; }
  .dw-f-timer { display: none; }
  .dw-card { padding: 26px 18px 20px; }
  .dw-timer div { min-width: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .dw-card::before, #dw-float::before, .dw-sky i, .dw-diyas span, .dw-price b, .dw-cta, .dw-cta::after,
  .dw-f-go, .dw-f-diya::after, .dw-badge, .dw-title em, .dw-f-main b { animation: none !important; }
}
