/* Flash Sale Specific Styles */
.flash-sale-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #ff6b00 0%, #ff8c00 100%);
  padding: 15px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}

.flash-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 1px;
}

.flash-badge i {
  font-size: 24px;
  animation: flash-pulse 1.5s infinite;
}

@keyframes flash-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.flash-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.timer-label {
  font-size: 14px;
  opacity: 0.9;
}

.timer-display {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

.timer-ended {
  font-weight: 600;
  opacity: 0.9;
}

.flash-stock-section {
  background: #fff9f0;
  border: 2px solid #ffd699;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
}

.flash-stock-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.stock-sold {
  color: #666;
}

.stock-remaining {
  color: #ff6b00;
}

.flash-stock-bar {
  width: 100%;
  height: 12px;
  background-color: #ffe0cc;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.flash-stock-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b00 0%, #ff8c00 100%);
  transition: width 0.3s ease;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.flash-stock-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

.stock-urgency {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #d84315;
  display: flex;
  align-items: center;
  gap: 5px;
}

.stock-urgency i {
  font-size: 16px;
}

.flash-price {
  color: #ff6b00 !important;
  font-weight: 700;
}

.regular-price-strikethrough {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
  margin-left: 8px;
}

.discount-badge.flash {
  background: linear-gradient(135deg, #ff6b00 0%, #ff8c00 100%);
}

.flash-status-note {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 10px 15px;
  border-radius: 4px;
  margin-top: 10px;
  font-size: 13px;
  color: #1565c0;
}

.in-stock.flash {
  background: #fff3e0;
  color: #e65100;
  border-color: #ff9800;
}

/* FIXED: Only show overlay when flash sale is sold out or ended AND product is not available at regular price */
.flash-stock-overlay {
  display: none; /* Hidden by default */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 107, 0, 0.9);
  color: white;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 2px;
  z-index: 10;
}

/* Show overlay only when product is completely unavailable */
.main-image-container:has(.out-of-stock-overlay) .flash-stock-overlay,
.main-image-container .out-of-stock-overlay {
  display: flex;
}

/* Don't show flash overlay if product still has regular stock */
.main-image-container:has(+ .product-details .in-stock) .flash-stock-overlay {
  display: none !important;
}

.btn-add-cart.flash,
.btn-buy-now.flash {
  position: relative;
  overflow: hidden;
}

.btn-add-cart.flash::before,
.btn-buy-now.flash::before {
  content: "⚡";
  position: absolute;
  left: 10px;
  animation: flash-bounce 1s infinite;
}

@keyframes flash-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.flash-checkout-notice {
  background: linear-gradient(135deg, #ff6b00 0%, #ff8c00 100%);
  color: white;
  padding: 12px 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-weight: 600;
}

.flash-checkout-notice i {
  font-size: 20px;
}

@media (max-width: 768px) {
  .flash-sale-banner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .flash-badge {
    font-size: 16px;
  }

  .timer-display {
    font-size: 14px;
    padding: 6px 12px;
  }
}