/**
 * Product Badge Custom Styles
 * 产品标签自定义样式
 */

/* 自定义 Badge 颜色 */
.f-badge--custom {
  color: #fff;
  font-weight: 600;
}

/* 确保自定义颜色的可读性 */
.f-badge--custom:where([style*="background-color: #f"]),
.f-badge--custom:where([style*="background-color: #F"]),
.f-badge--custom:where([style*="background-color: rgb(2"]),
.f-badge--custom:where([style*="background-color: rgb(1"]) {
  /* 浅色背景使用深色文字 */
  color: #000;
}

/* 颜色样本 - 更多颜色标记 */
.swatch-item--more {
  display: flex;
  align-items: center;
  justify-content: center;
}

.swatch-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  border: 1px solid #e0e0e0;
}

/* Flash Sale 滚动标签优化 */
.product-card__flash-sale {
  overflow: hidden;
  pointer-events: none;
}

.scrolling-promotion {
  display: flex;
  overflow: hidden;
  white-space: nowrap;
}

.promotion--animated {
  animation: scrolling-promotion-left var(--duration, 7.5s) linear infinite;
}

@keyframes scrolling-promotion-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* 颜色样本交互 - 切换图片功能 */
.js-color-swatch {
  cursor: pointer;
  transition: all 0.2s ease;
}

.js-color-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

/* 颜色样本有变体图片时的提示 */
.js-color-swatch[data-variant-image]::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #4A90E2;
  border-radius: 50%;
  border: 1px solid #fff;
  opacity: 0.8;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .swatch-more {
    min-width: 28px;
    height: 28px;
    font-size: 11px;
  }
  
  .js-color-swatch:hover {
    transform: scale(1.1);
  }
}
