/* Product Card Base */
.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  height: 100%;
}

/* Product Card Link - wraps image and info */
.product-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.product-card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Product Card Info - inside the link */
.product-card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Product Card Actions - outside the link (variants + button) */
.product-card-actions {
  padding: 0 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card-image {
  position: relative;
  width: 100%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.product-image-placeholder svg {
  width: 60%;
  height: 60%;
  opacity: 0.5;
}

/* Discount Badge */
.product-discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Card Content */
.product-card-content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* Product info (title, price, variants) */
.product-card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Title spacing */
.product-card-content > .product-title {
  margin-bottom: 4px;
}

/* Price row spacing */
.product-card-content > .product-price-row {
  margin-bottom: 4px;
}

/* Variants spacing */
.product-card-content > .product-variants {
  margin-bottom: 8px;
}

/* Add to cart button always at bottom */
.product-card-content > .product-add-btn {
  margin-top: auto;
}

/* Rating */
.product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-value {
  font-size: 11px;
  color: #6b7280;
  margin-left: 4px;
}

/* Title */
.product-title {
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Description */
.product-description {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Price Row */
.product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-price {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.product-original-price {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: line-through;
}

/* Add to Cart Button */
.product-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: auto !important;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
}

.product-add-btn:hover {
  opacity: 0.9;
}

/* Shrink button text on smaller cards */
.product-add-btn .btn-text-full {
  display: inline;
}

.product-add-btn .btn-text-short {
  display: none;
}

@media (max-width: 768px) {
  .product-add-btn {
    font-size: 12px;
    padding: 8px 10px;
    gap: 4px;
  }
  
  .product-add-btn .btn-text-full {
    display: none;
  }
  
  .product-add-btn .btn-text-short {
    display: inline;
  }
}

/* Container queries for button text - shrink in tight spaces */
@container (max-width: 200px) {
  .product-add-btn .btn-text-full {
    display: none;
  }
  
  .product-add-btn .btn-text-short {
    display: inline;
  }
}

/* Fallback: Also shrink based on button width with CSS */
.product-add-btn.compact .btn-text-full {
  display: none;
}

.product-add-btn.compact .btn-text-short {
  display: inline;
}

/* Product Variants */
.product-variants {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
  padding-bottom: 4px;
}

.product-variants::-webkit-scrollbar {
  height: 4px;
}

.product-variants::-webkit-scrollbar-track {
  background: transparent;
}

.product-variants::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

.variant-colors,
.variant-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  flex-shrink: 0;
}

.variant-dot,
.variant-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex-shrink: 0;
}

.variant-dot:hover,
.variant-color-dot:hover {
  transform: scale(1.15);
}

.variant-dot.active,
.variant-color-dot.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 2px #0891b2, 0 2px 6px rgba(0, 0, 0, 0.3);
}

.variant-chip {
  padding: 2px 8px;
  font-size: 11px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.variant-chip:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.variant-chip.active {
  background: #0891b2;
  border-color: #0891b2;
  color: white;
}

/* Card Type Variations */

/* Card Type 1 - Standard vertical */
.product-card-card-1 {
  /* Default style */
}

/* Card Type 2 - Horizontal layout */
.product-card-card-2 {
  flex-direction: row;
}

.product-card-card-2 .product-card-image {
  width: 40%;
  flex-shrink: 0;
}

.product-card-card-2 .product-card-content {
  flex: 1;
  justify-content: center;
}

/* Card Type 3 - Compact with button overlay */
.product-card-card-3 .product-card-content {
  padding: 8px;
}

.product-card-card-3 .product-title {
  font-size: 13px;
}

.product-card-card-3 .product-add-btn {
  padding: 8px 12px;
  font-size: 12px;
}

/* Card Type 4 - Large image focus */
.product-card-card-4 .product-card-image {
  aspect-ratio: 1 / 1 !important;
}

.product-card-card-4 .product-card-content {
  padding: 16px;
  text-align: center;
}

.product-card-card-4 .product-price-row {
  justify-content: center;
}

/* Card Type 5 - Minimal */
.product-card-card-5 {
  border: none !important;
  background: transparent !important;
}

.product-card-card-5 .product-card-image {
  border-radius: 8px;
  overflow: hidden;
}

.product-card-card-5 .product-card-content {
  padding: 12px 0;
}

.product-card-card-5 .product-add-btn {
  width: 100%;
}


