/* ==========================================================================
   FLASH ADVERTISEMENT BANNER
   ========================================================================== */

/* ---- Shared base ---- */
.flash-ad {
  --flash-bg: #0b5ed7;
  --flash-fg: #ffffff;
  --flash-accent: #ff6b1a;
  position: relative;
  color: var(--flash-fg);
  background: var(--flash-bg);
  font-family: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
  isolation: isolate;
}

.flash-ad::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 35%,
    transparent 70%
  );
  z-index: -1;
  transform: translateX(-100%);
  animation: flash-shine 6s linear infinite;
}

@keyframes flash-shine {
  to { transform: translateX(100%); }
}

/* Soft radial glow in the accent color */
.flash-ad::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: var(--flash-accent);
  opacity: 0.22;
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

/* ---- Layout ---- */
.flash-ad__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}

.flash-ad__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.95rem;
  color: #fff;
  flex: 0 0 auto;
  animation: flash-pulse 2.4s ease-in-out infinite;
}

@keyframes flash-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(255,255,255,0.06); }
}

.flash-ad__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.flash-ad__headline {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--flash-fg);
}

.flash-ad__text {
  font-size: 0.82rem;
  line-height: 1.4;
  color: color-mix(in srgb, var(--flash-fg) 82%, transparent);
}

/* ---- CTA button ---- */
.flash-ad__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--flash-accent);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 6px 18px -8px var(--flash-accent);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  flex: 0 0 auto;
  text-decoration: none;
}

.flash-ad__cta:hover {
  background: color-mix(in srgb, var(--flash-accent) 88%, black);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px -10px var(--flash-accent);
}

.flash-ad__cta i {
  font-size: 0.72em;
  transition: transform 0.16s ease;
}

.flash-ad__cta:hover i {
  transform: translateX(3px);
}

/* ---- Countdown ---- */
.flash-ad__countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.flash-ad__cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 2px;
  line-height: 1;
}

.flash-ad__cd-block b {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.flash-ad__cd-block small {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* ---- Close button ---- */
.flash-ad__close {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease;
  z-index: 2;
}

.flash-ad__close:hover {
  background: rgba(0, 0, 0, 0.36);
}

/* When close button is present, give space on the right */
.flash-ad:has(.flash-ad__close) .flash-ad__inner {
  padding-right: 44px;
}

/* ==========================================================================
   VARIANTS
   ========================================================================== */

/* --- Bar (top strip) --- */
.flash-ad--bar {
  position: relative;
  z-index: 850;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.flash-ad--bar .flash-ad__inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* --- Floating (bottom right) --- */
.flash-ad--floating {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  z-index: 940;
  border-radius: 16px;
  box-shadow: 0 20px 44px -18px rgba(15, 23, 42, 0.55);
  animation: flash-float-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes flash-float-in {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.flash-ad--floating .flash-ad__inner {
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 18px;
  gap: 12px;
}

.flash-ad--floating .flash-ad__icon {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

.flash-ad--floating .flash-ad__cta {
  width: 100%;
  justify-content: center;
}

.flash-ad--floating .flash-ad__countdown {
  align-self: stretch;
  justify-content: center;
}

.flash-ad--floating .flash-ad__close {
  top: 12px;
  right: 12px;
  transform: none;
}

/* --- Popup (centered modal) --- */
.flash-ad--popup {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  animation: flash-fade-in 0.3s ease both;
}

@keyframes flash-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.flash-ad--popup .flash-ad__inner {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 30px 26px;
  width: min(92vw, 420px);
  background: var(--flash-bg);
  border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(15, 23, 42, 0.55);
  position: relative;
  overflow: hidden;
  animation: flash-popup-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes flash-popup-in {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.flash-ad--popup .flash-ad__icon {
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
  align-self: flex-start;
}

.flash-ad--popup .flash-ad__headline {
  font-size: 1.15rem;
  line-height: 1.25;
}

.flash-ad--popup .flash-ad__cta {
  justify-content: center;
  padding: 12px 22px;
  font-size: 0.9rem;
}

.flash-ad--popup .flash-ad__close {
  top: 12px;
  right: 12px;
  transform: none;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.24);
}

/* ==========================================================================
   RESPONSIVE
========================================================================== */
@media (max-width: 720px) {
  .flash-ad__inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    text-align: center;
  }

  .flash-ad--bar .flash-ad__inner {
    padding-right: 44px;
  }

  .flash-ad__headline {
    font-size: 0.85rem;
  }

  .flash-ad__text {
    font-size: 0.75rem;
  }

  .flash-ad__icon {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .flash-ad__cta {
    width: 100%;
    justify-content: center;
    order: 3;
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .flash-ad__countdown {
    order: 2;
  }

  .flash-ad--floating {
    right: 12px;
    left: 12px;
    bottom: 12px;
    max-width: none;
  }
}

@media (max-width: 580px) {
  .flash-ad__countdown {
    align-items: center;
    justify-content: center;
    text-align: center;
  }

}

@media (prefers-reduced-motion: reduce) {
  .flash-ad,
  .flash-ad::before,
  .flash-ad__icon {
    animation: none !important;
  }
}