/* 最小化预售显示 */
.zapa-presale-minimal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(0, 124, 186, 0.15);
  border-radius: 3px;
  margin: 4px 0;
}

.zapa-presale-minimal.ended {
  background: rgba(220, 53, 69, 0.15);
}

.presale-icon {
  font-size: 10px;
}

.presale-text {
  font-weight: 600;
  color: #333;
}

.presale-timer-micro {
  font-size: 10px;
  color: #666;
}

.presale-result {
  font-weight: 600;
  color: #007cba;
}

.zapa-presale-minimal.ended .presale-result {
  color: #dc3545;
}

/* 产品列表页面预售样式 */

/* 产品循环中的预售信息 */
.zapa-presale-loop {
  margin: 8px 0;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #007cba;
  font-size: 13px;
}

.zapa-presale-loop.ended {
  border-left-color: #dc3545;
  background: #fff5f5;
}

.presale-badge {
  font-weight: 600;
  color: #007cba;
  font-size: 11px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.presale-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.presale-progress-small {
  flex: 1;
  min-width: 0;
}

.progress-text {
  font-weight: 600;
  color: #333;
  font-size: 12px;
}

.progress-bar-small {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}

.progress-fill-small {
  height: 100%;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.presale-timer-small {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #666;
  white-space: nowrap;
}

.timer-icon {
  font-size: 10px;
}

.presale-status {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* 紧凑型预售信息 */
.zapa-presale-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0;
  padding: 4px 8px;
  background: rgba(0, 124, 186, 0.1);
  border-radius: 4px;
  font-size: 12px;
}

.zapa-presale-compact.ended {
  background: rgba(220, 53, 69, 0.1);
}

.presale-label {
  font-weight: 600;
  color: #007cba;
}

.presale-numbers {
  font-weight: 600;
  color: #333;
}

.presale-bar-mini {
  height: 3px;
  background: #007cba;
  border-radius: 2px;
  min-width: 20px;
  max-width: 40px;
  transition: width 0.3s ease;
}

.presale-timer-mini {
  font-size: 11px;
  color: #666;
}

/* 产品图片上的预售角标 */
.woocommerce ul.products li.product {
  position: relative;
}

.zapa-presale-badge-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 124, 186, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  z-index: 10;
  text-align: center;
  min-width: 50px;
}

.zapa-presale-badge-overlay.success {
  background: rgba(40, 167, 69, 0.9);
}

.badge-text {
  display: block;
  line-height: 1.2;
}

.badge-progress {
  font-size: 9px;
  opacity: 0.9;
  margin-top: 1px;
}

/* 预售筛选器 */
.zapa-presale-filter {
  margin-bottom: 20px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.zapa-presale-filter label {
  font-weight: 600;
  margin: 0;
}

.zapa-presale-filter select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .presale-info {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  
  .presale-timer-small {
    justify-content: center;
  }
  
  .zapa-presale-compact {
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .zapa-presale-badge-overlay {
    top: 4px;
    left: 4px;
    padding: 3px 6px;
    font-size: 9px;
    min-width: 40px;
  }
  
  .zapa-presale-filter {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* 深色主题适配 */
@media (prefers-color-scheme: dark) {
  .zapa-presale-loop {
    background: #2d3748;
    color: #e2e8f0;
  }
  
  .progress-bar-small {
    background: #4a5568;
  }
  
  .presale-label {
    color: #90cdf4;
  }
  
  .presale-numbers {
    color: #e2e8f0;
  }
  
  .zapa-presale-filter {
    background: #2d3748;
    color: #e2e8f0;
  }
}

/* 与常见主题的兼容性 */
.storefront .zapa-presale-loop,
.astra .zapa-presale-loop,
.twentytwentyone .zapa-presale-loop {
  margin-top: 0.5em;
}

.oceanwp .zapa-presale-badge-overlay {
  top: 10px;
  left: 10px;
}

/* 动画效果 */
.zapa-presale-badge-overlay {
  animation: presaleBadgeFadeIn 0.3s ease-out;
}

@keyframes presaleBadgeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hover效果 */
.woocommerce ul.products li.product:hover .zapa-presale-badge-overlay {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

.zapa-presale-loop:hover {
  background: #e9ecef;
  transition: background 0.2s ease;
}

.zapa-presale-loop.ended:hover {
  background: #f8e8e8;
}