/* ============================================================
 *  TECH ZONE — flash-deals.css
 *  Premium Flash Deals section: animated countdown header,
 *  auto-scrolling cards with urgency design, progress bars,
 *  and fully responsive layout for all screen sizes.
 * ============================================================ */

/* ── Section ─────────────────────────────────────────────── */
.tz-flash-section {
  background: linear-gradient(160deg, #1a0a00 0%, #2d1000 40%, #1f0800 100%);
  position: relative;
  overflow: hidden;
  padding: 0 0 36px;
}

/* Animated background grain texture */
.tz-flash-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 10% 20%, rgba(255,122,0,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(224,32,32,0.10) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* Floating spark particles */
.tz-flash-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.tz-flash-spark {
  position: absolute;
  border-radius: 50%;
  animation: tz-spark-float linear infinite;
  opacity: 0;
}
.tz-flash-spark:nth-child(1)  { width:3px; height:3px; background:#ff7a00; left:8%;  animation-duration:4.2s; animation-delay:0s;    top:60%; }
.tz-flash-spark:nth-child(2)  { width:2px; height:2px; background:#ffb347; left:18%; animation-duration:3.8s; animation-delay:0.7s;  top:70%; }
.tz-flash-spark:nth-child(3)  { width:4px; height:4px; background:#e02020; left:30%; animation-duration:5.1s; animation-delay:1.2s;  top:75%; }
.tz-flash-spark:nth-child(4)  { width:2px; height:2px; background:#ff7a00; left:45%; animation-duration:3.5s; animation-delay:0.3s;  top:65%; }
.tz-flash-spark:nth-child(5)  { width:3px; height:3px; background:#ffb347; left:60%; animation-duration:4.7s; animation-delay:1.8s;  top:72%; }
.tz-flash-spark:nth-child(6)  { width:2px; height:2px; background:#ff7a00; left:72%; animation-duration:3.9s; animation-delay:0.9s;  top:68%; }
.tz-flash-spark:nth-child(7)  { width:4px; height:4px; background:#e02020; left:85%; animation-duration:4.4s; animation-delay:2.1s;  top:78%; }
.tz-flash-spark:nth-child(8)  { width:2px; height:2px; background:#ffb347; left:93%; animation-duration:3.6s; animation-delay:0.5s;  top:62%; }

@keyframes tz-spark-float {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  10%  { opacity: 0.9; }
  80%  { opacity: 0.6; }
  100% { transform: translateY(-120px) scale(0.3); opacity: 0; }
}

/* ── Header band ─────────────────────────────────────────── */
.tz-flash-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 20px 18px;
  max-width: 1280px;
  margin: 0 auto;
  flex-wrap: wrap;
}

/* Brand label */
.tz-flash-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.tz-flash-bolt {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ff7a00, #e02020);
  border-radius: 10px;
  box-shadow:
    0 0 0 3px rgba(255,122,0,0.25),
    0 4px 14px rgba(255,122,0,0.45);
  animation: tz-bolt-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes tz-bolt-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,122,0,0.25), 0 4px 14px rgba(255,122,0,0.45); }
  50%       { box-shadow: 0 0 0 6px rgba(255,122,0,0.15), 0 4px 20px rgba(255,122,0,0.60); }
}

.tz-flash-bolt svg { width: 22px; height: 22px; color: #fff; }

.tz-flash-title-group h2 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 900;
  color: #fff;
  margin: 0;
  letter-spacing: -0.3px;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.tz-flash-title-group span {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Divider */
.tz-flash-divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
@media (max-width: 520px) { .tz-flash-divider { display: none; } }

/* ── Countdown clock ─────────────────────────────────────── */
.tz-flash-clock {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tz-flash-clock-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  white-space: nowrap;
}

.tz-flash-clock-units {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tz-flash-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 5px 9px 4px;
  min-width: 44px;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

/* flip-card shimmer line */
.tz-flash-unit::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0,0,0,0.3);
}

.tz-flash-unit__num {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -1px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.tz-flash-unit__num.flip {
  transform: translateY(-4px);
  opacity: 0.5;
}

.tz-flash-unit__label {
  font-size: 0.52rem;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 2px;
}

.tz-flash-colon {
  font-size: 1.3rem;
  font-weight: 900;
  color: rgba(255,255,255,0.5);
  line-height: 1;
  margin-bottom: 6px;
  animation: tz-blink 1s step-end infinite;
}

@keyframes tz-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* Ends-soon warning */
.tz-flash-urgent {
  font-size: 0.65rem;
  font-weight: 700;
  color: #ff7a00;
  background: rgba(255,122,0,0.15);
  border: 1px solid rgba(255,122,0,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  animation: tz-urgent-pulse 1.8s ease-in-out infinite;
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.tz-flash-urgent.hidden { display: none; }

@keyframes tz-urgent-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* See all link */
.tz-flash-see-all {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 7px 16px;
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
  backdrop-filter: blur(6px);
}
.tz-flash-see-all:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

/* ── Carousel outer ──────────────────────────────────────── */
.tz-flash-carousel-outer {
  position: relative;
  z-index: 2;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg,
    transparent 0%, #000 3%, #000 97%, transparent 100%);
  mask-image: linear-gradient(90deg,
    transparent 0%, #000 3%, #000 97%, transparent 100%);
}
@media (max-width: 600px) {
  .tz-flash-carousel-outer {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.tz-flash-track-wrap {
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  padding: 4px 0 6px;
}
.tz-flash-track-wrap.is-dragging { cursor: grabbing; }

.tz-flash-track {
  display: flex;
  gap: 14px;
  width: max-content;
  will-change: transform;
  padding: 8px 20px 12px;
}

/* ── Flash deal slide (wraps the standard flap-card at a fixed
   width so the auto-scrolling track can measure/animate it) ── */
.tz-flash-slide {
  display: flex;
}
.tz-flash-slide .tz-flap-card { width: 100%; }

/* ── Flash deal card ─────────────────────────────────────── */
.tz-flash-card {
  flex: 0 0 190px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition:
    transform 0.32s cubic-bezier(.25,.8,.25,1),
    box-shadow 0.32s cubic-bezier(.25,.8,.25,1);
  will-change: transform;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
}
@media (min-width: 480px) { .tz-flash-card { flex: 0 0 200px; } }
@media (min-width: 768px) { .tz-flash-card { flex: 0 0 215px; } }
@media (min-width: 1200px) { .tz-flash-card { flex: 0 0 225px; } }

.tz-flash-card:hover,
.tz-flash-card.is-active {
  transform: translateY(-7px) scale(1.025);
  box-shadow:
    0 20px 48px rgba(0,0,0,0.4),
    0 0 0 2px rgba(255,122,0,0.5),
    0 8px 24px rgba(255,122,0,0.25);
  z-index: 4;
}

/* ── HOT badge (top-left) ────────────────────────────────── */
.tz-flash-card__hot {
  position: absolute;
  top: 0; left: 0;
  background: linear-gradient(90deg, #e02020, #ff4444);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 10px 4px 8px;
  border-radius: 0 0 10px 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tz-flash-card__hot svg { width: 9px; height: 9px; }

/* ── Discount badge (top-right) ──────────────────────────── */
.tz-flash-card__off {
  position: absolute;
  top: 8px; right: 8px;
  background: #1f2937;
  color: #ff7a00;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 5px;
  z-index: 4;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255,122,0,0.3);
}

/* ── Image ───────────────────────────────────────────────── */
.tz-flash-card__img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  overflow: hidden;
}
.tz-flash-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.42s cubic-bezier(.25,.8,.25,1);
}
.tz-flash-card:hover .tz-flash-card__img-wrap img,
.tz-flash-card.is-active .tz-flash-card__img-wrap img {
  transform: scale(1.08);
}

/* Hover overlay */
.tz-flash-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.28s ease;
  z-index: 3;
}
.tz-flash-card:hover .tz-flash-card__overlay,
.tz-flash-card.is-active .tz-flash-card__overlay { opacity: 1; }

.tz-flash-overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: none;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transform: translateY(8px);
  transition:
    transform 0.28s cubic-bezier(.25,.8,.25,1),
    background 0.2s;
}
.tz-flash-card:hover .tz-flash-overlay-btn,
.tz-flash-card.is-active .tz-flash-overlay-btn { transform: translateY(0); }
.tz-flash-overlay-btn:nth-child(2) { transition-delay: 0.055s; }

.tz-flash-overlay-btn--view { background: #ff7a00; color: #fff; }
.tz-flash-overlay-btn--view:hover { background: #e56700; color: #fff; }
.tz-flash-overlay-btn--wl { background: rgba(255,255,255,0.9); color: #1f2937; }
.tz-flash-overlay-btn--wl:hover { background: #fff; }
.tz-flash-overlay-btn--wl.active { background: #fff0f0; color: #e02020; }
.tz-flash-overlay-btn svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── Card body ───────────────────────────────────────────── */
.tz-flash-card__body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.tz-flash-card__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
  /* Reserve height for 2 lines always (2 × 1.35 line-height), so a
     short 1-line name doesn't leave its card shorter than a card
     whose name actually wraps to 2 lines. */
  min-height: 2.7em;
}
.tz-flash-card__name:hover { color: #ff7a00; }

/* Price row — forced to a single line. Without this, flex-wrap lets
   a long "was" price wrap onto a second line, making that one card
   taller than cards without an old price. Truncating with ellipsis
   keeps every card's price row exactly one line tall. */
.tz-flash-card__prices {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-top: 3px;
}
.tz-flash-card__price {
  font-size: 1.08rem;
  font-weight: 900;
  color: #e02020;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  white-space: nowrap;
}
.tz-flash-card__old {
  font-size: 0.72rem;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Stock / sold progress bar ───────────────────────────── */
.tz-flash-card__stock {
  margin-top: 8px;
}
.tz-flash-card__stock-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
}
.tz-flash-card__stock-label .sold-pct { color: #e02020; font-weight: 700; }

.tz-flash-progress-track {
  height: 5px;
  background: #f3f4f6;
  border-radius: 20px;
  overflow: hidden;
}
.tz-flash-progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #ff7a00, #e02020);
  transition: width 1s cubic-bezier(.25,.8,.25,1);
  min-width: 8%;
}
/* Critical stock: red pulsing */
.tz-flash-progress-bar.critical {
  animation: tz-prog-pulse 1.5s ease-in-out infinite;
}
@keyframes tz-prog-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── Cart button ─────────────────────────────────────────── */
.tz-flash-card__action {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}

.tz-flash-btn-cart {
  flex: 1;
  background: linear-gradient(90deg, #e02020 0%, #ff4040 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(224,32,32,0.3);
}
.tz-flash-btn-cart:hover {
  background: linear-gradient(90deg, #c01010 0%, #e02020 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(224,32,32,0.42);
  color: #fff;
}
.tz-flash-btn-cart svg { width: 13px; height: 13px; flex-shrink: 0; }
.tz-flash-btn-cart--oos {
  background: #f3f4f6;
  color: #9ca3af;
  box-shadow: none;
  cursor: default;
}
.tz-flash-btn-cart--oos:hover { transform: none; box-shadow: none; }

.tz-flash-btn-wl {
  flex: 0 0 34px;
  width: 34px; height: 34px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #9ca3af;
}
.tz-flash-btn-wl:hover { background: #fff0f0; border-color: #fca5a5; color: #e02020; }
.tz-flash-btn-wl.active { background: #fff0f0; border-color: #fca5a5; color: #e02020; }
.tz-flash-btn-wl svg { width: 14px; height: 14px; }

/* ── Navigation arrows ───────────────────────────────────── */
.tz-flash-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
}
.tz-flash-nav:hover {
  background: #ff7a00;
  border-color: #ff7a00;
  box-shadow: 0 4px 16px rgba(255,122,0,0.45);
}
.tz-flash-nav--prev { left: 6px; }
.tz-flash-nav--next { right: 6px; }
.tz-flash-nav svg { width: 18px; height: 18px; }

@media (max-width: 600px) { .tz-flash-nav { display: none; } }

/* ── Dot indicators ──────────────────────────────────────── */
.tz-flash-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  padding: 0 20px;
}
.tz-flash-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  padding: 0;
}
.tz-flash-dot.active {
  background: #ff7a00;
  width: 20px;
  border-radius: 20px;
  box-shadow: 0 0 8px rgba(255,122,0,0.6);
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tz-flash-card,
  .tz-flash-card__img-wrap img,
  .tz-flash-card__overlay,
  .tz-flash-overlay-btn,
  .tz-flash-progress-bar,
  .tz-flash-bolt,
  .tz-flash-spark,
  .tz-flash-colon,
  .tz-flash-urgent {
    animation: none !important;
    transition: none !important;
  }
}