/**
 * Component: Product Card - Pre-Order Variant
 *
 * Specialized styles for pre-order product cards with countdown and group progress.
 *
 * @package    Flavor_Starter
 * @subpackage Styles/Components
 * @since      1.0.0
 */

/* --------------------------------------------------------
   Card Container
   -------------------------------------------------------- */
.product-card-preorder {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius, 8px);
  border: 2px dashed #10b981;
  background-color: hsl(var(--card));
  overflow: hidden;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.product-card-preorder:hover {
  box-shadow: 0 8px 24px -6px rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
}

/* --------------------------------------------------------
   Image Section
   -------------------------------------------------------- */
.product-card-preorder__image-wrapper {
  position: relative;
  display: block;
  aspect-ratio: 2/3;
  overflow: hidden;
  background-color: hsl(var(--muted));
}

.product-card-preorder__image-wrapper img,
.product-card-preorder__image-wrapper .product-card-preorder__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card-preorder:hover .product-card-preorder__image-wrapper img {
  transform: scale(1.05);
}

/* --------------------------------------------------------
   Pre-order Badge (top-left)
   -------------------------------------------------------- */
.product-card-preorder__badge {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #f0fdf4;
  color: #10b981;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid #10b981;
  border-radius: 9999px;
  z-index: 10;
}

.product-card-preorder__badge svg {
  width: 1.4rem;
  height: 1.4rem;
}

.product-card-preorder__icon {
  border-radius: 100%;
  background-color: #10b981;
  aspect-ratio: 1;
  height: auto;
  line-height: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
}

/* --------------------------------------------------------
   Slots Available Badge (top-right)
   -------------------------------------------------------- */
.product-card-preorder__slots {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background-color: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  z-index: 10;
}

/* --------------------------------------------------------
   Countdown Banner (bottom of image)
   -------------------------------------------------------- */
.product-card-preorder__countdown-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #065f46 0%, #047857 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.product-card-preorder__countdown-label {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.product-card-preorder__countdown {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.countdown__block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.countdown__num {
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.countdown__label {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
}

.countdown__sep {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0.2rem;
}

/* --------------------------------------------------------
   Card Body
   -------------------------------------------------------- */
.product-card-preorder__body {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  gap: 1.2rem;
}

@media (min-width: 640px) {
  .product-card-preorder__body {
    padding: 2rem;
  }
}

/* --------------------------------------------------------
   Title
   -------------------------------------------------------- */
.product-card-preorder__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.3;
  margin: 0;
}

@media (min-width: 640px) {
  .product-card-preorder__title {
    font-size: 1.8rem;
  }
}

/* --------------------------------------------------------
   Description
   -------------------------------------------------------- */
.product-card-preorder__description {
  font-size: 1.3rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}

.product-card-preorder__description p {
  margin: 0;
}

/* --------------------------------------------------------
   Group Order Progress Section
   -------------------------------------------------------- */
.product-card-preorder__progress-section {
  background-color: #d1fae5;
  border-radius: 8px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-card-preorder__progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-card-preorder__progress-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #065f46;
}

.product-card-preorder__progress-icon svg {
  width: 1.6rem;
  height: 1.6rem;
  color: #059669;
}

.product-card-preorder__progress-percentage {
  font-size: 1.4rem;
  font-weight: 700;
  color: #065f46;
}

/* Progress Bar */
.product-card-preorder__progress-bar {
  width: 100%;
  height: 0.8rem;
  background-color: #fff;
  border-radius: 9999px;
  overflow: hidden;
}

.product-card-preorder__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Progress Stats */
.product-card-preorder__progress-stats {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background-color: #fff;
  border-radius: 6px;
}

.product-card-preorder__stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.product-card-preorder__stat-label {
  font-size: 1.1rem;
  color: #6b7280;
}

.product-card-preorder__stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #065f46;
}

/* Notice */
.product-card-preorder__notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem;
  background-color: #fff;
  border-radius: 6px;
  border-left: 3px solid #059669;
}

.product-card-preorder__notice svg {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  color: #059669;
  margin-top: 0.1rem;
}

.product-card-preorder__notice span {
  font-size: 1.1rem;
  line-height: 1.4;
  color: #374151;
}

/* --------------------------------------------------------
   Delivery Info
   -------------------------------------------------------- */
.product-card-preorder__delivery-info {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem;
  background-color: #f0fdf4;
  border-radius: 6px;
  border-left: 3px solid #10b981;
}

.product-card-preorder__delivery-info svg {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  color: #059669;
  margin-top: 0.2rem;
}

.product-card-preorder__delivery-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.product-card-preorder__delivery-text strong {
  font-size: 1.1rem;
  font-weight: 600;
  color: #065f46;
}

.product-card-preorder__delivery-text span {
  font-size: 1.2rem;
  line-height: 1.4;
  color: #047857;
}

/* --------------------------------------------------------
   Price
   -------------------------------------------------------- */
.product-card-preorder__price {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.product-card-preorder__price .woocommerce-Price-currencySymbol {
  font-size: 1.6rem;
  margin-right: 0.2rem;
}

/* --------------------------------------------------------
   Actions Row
   -------------------------------------------------------- */
.product-card__actions.preorder-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
}

/* Quantity Selector */
.product-card__quantity.preorder__quantity {
  display: flex;
  align-items: center;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius, 6px);
  overflow: hidden;
  height: 100%;
}

.product-card-preorder__qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 100%;
  background: hsl(var(--background));
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  color: hsl(var(--foreground));
  transition: background-color 0.15s ease;
}

.product-card-preorder__qty-btn:hover {
  background-color: hsl(var(--muted));
}

.product-card-preorder__qty-input {
  width: 4rem;
  height: 100%;
  text-align: center;
  border: none;
  border-left: 1px solid hsl(var(--border));
  border-right: 1px solid hsl(var(--border));
  font-size: 1.4rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  -moz-appearance: textfield;
}

.product-card-preorder__qty-input::-webkit-inner-spin-button,
.product-card-preorder__qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Add to Cart Button */
.product-card__add-to-cart.preorder-version {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  height: 4rem;
  padding: 0 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius, 6px);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap;
}

.product-card-preorder__add-to-cart:hover {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--foreground) / 0.2);
}

.product-card-preorder__add-to-cart svg {
  width: 1.6rem;
  height: 1.6rem;
}

/* --------------------------------------------------------
   Reserve Button
   -------------------------------------------------------- */
.product-card-preorder__reserve-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  height: 4rem;
  padding: 0 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius, 6px);
  background-color: #1f2937;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.product-card-preorder__reserve-btn:hover {
  background-color: #111827;
}

.product-card-preorder__reserve-btn:active {
  transform: scale(0.98);
}

.product-card-preorder__reserve-btn svg {
  width: 1.6rem;
  height: 1.6rem;
}

/* --------------------------------------------------------
   Refund Notice
   -------------------------------------------------------- */
.product-card-preorder__refund-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background-color: #fffbeb;
  border-radius: 6px;
  border: 1px dashed #f59e0b;
}

.product-card-preorder__refund-notice svg {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  color: #d97706;
  margin-top: 0.1rem;
}

.product-card-preorder__refund-notice span {
  font-size: 1.1rem;
  line-height: 1.4;
  color: #92400e;
}

/* --------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------- */
@media (max-width: 640px) {
  .product-card-preorder__countdown-banner {
    padding: 0.8rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .product-card-preorder__countdown-label {
    font-size: 1rem;
  }

  .countdown__num {
    font-size: 1.5rem;
  }

  .countdown__label {
    font-size: 0.8rem;
  }

  .product-card-preorder__progress-stats {
    grid-template-columns: 1fr;
  }

  .product-card-preorder__actions {
    grid-template-columns: 1fr;
  }

  .product-card-preorder__quantity {
    width: 100%;
  }
}
