/* 
 * Universal Product Card Styling
 * For use across all Buizz pages
 * Features:
 * - Square image
 * - One line title
 * - One line description 
 * - Price range display for variations
 * - Conditional buttons
 */

:root {
  --primary-color: #066cfa;
  --secondary-color: #212121;
  --accent-color: #ff4f70;
  --text-color: #212121;
  --text-muted: #757575;
  --text-light: #adb5bd;
  --border-color: #e0e0e0;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.1);
  --transition-normal: 0.25s ease;
}

/* Base Product Card */
.product-card-wrapper {
  padding: 0 !important;
  margin-bottom: 20px;
  padding: 0 10px !important; /* Add horizontal padding for gap between cards */
}

.product-card {
  height: 100%;
  border-radius: 8px;
  background-color: #fff;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
  border-color: #d0d0d0;
}

/* Product Image - Square Shape */
.product-card-image {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio */
  overflow: hidden;
  background-color: #f9f9f9;
}

.product-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

/* Badges for product cards */
.product-card-badge {
  position: absolute;
  top: 10px;
  z-index: 2;
  padding: 5px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.badge-sale {
  left: 10px;
  background-color: var(--accent-color);
  color: #fff;
}

/* Favorite button replacing variation badge */
.btn-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  color: #adb5bd;
}

.btn-favorite:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.btn-favorite.favorited {
  color: #ff4f70;
}

/* Product Content */
.product-card-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Product Title - One Line */
.product-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
  text-decoration: none;
  line-height: 1.3;
}

.product-card-title:hover {
  color: var(--primary-color);
}

/* Product Description - One Line */
.product-card-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  flex-grow: 1;
  text-decoration: none;
}

.product-card-description:hover {
  color: var(--text-muted);
}

/* Product Footer with price and action button */
.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* Price Display */
.product-card-price {
  display: flex;
  flex-direction: column;
}

.price-current {
  font-weight: 700;
  color: var(--text-color);
  font-size: 1rem;
}

.price-range {
  font-weight: 700;
  color: var(--text-color);
  font-size: 1rem;
}

.price-original {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through !important;
  margin-top: 0.1rem;
}

/* Action Buttons */
.product-card-action {
  display: flex;
  align-items: center;
}

.btn-add-to-cart,
.btn-view-options {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-add-to-cart,
.btn-view-options {
  background-color: var(--primary-color);
}

.btn-add-to-cart:hover,
.btn-view-options:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

.btn-add-to-cart:hover,
.btn-view-options:hover {
  background-color: #0559cc;
}

/* Button ripple effect */
.btn-add-to-cart:after,
.btn-view-options:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.4s ease;
}

.btn-add-to-cart:hover:after,
.btn-view-options:hover:after {
  transform: translate(-50%, -50%) scale(2);
  opacity: 0;
}

/* Quick View Overlay */
.quick-view-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 10px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  justify-content: center;
  z-index: 3;
}

.product-card:hover .quick-view-overlay {
  transform: translateY(0);
}

.btn-quick-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary-color);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 15px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  width: 100%;
}

.btn-quick-view:hover {
  background-color: #0559cc;
}

.btn-quick-view i {
  margin-right: 0.5rem;
}

/* Out of Stock Label */
.out-of-stock-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc3545;
  padding: 4px 8px;
  background-color: rgba(220, 53, 69, 0.1);
  border-radius: 4px;
  white-space: nowrap;
}

/* Media query adjustment for small screens */
@media (max-width: 576px) {
  .out-of-stock-label {
    font-size: 0.7rem;
    padding: 3px 6px;
  }
}

/* Media Queries */
@media (max-width: 1199px) {
  .product-card-content {
    padding: 12px;
  }
}

@media (max-width: 991px) {
  .product-card-title {
    font-size: 0.9rem;
  }

  .product-card-description {
    font-size: 0.8rem;
  }

  .price-current,
  .price-range {
    font-size: 0.95rem;
  }

  .btn-add-to-cart,
  .btn-view-options {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 767px) {
  .product-card-wrapper {
    margin-bottom: 15px;
  }

  .product-card-content {
    padding: 10px;
  }

  .product-card-title {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }

  .product-card-description {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }

  .btn-add-to-cart,
  .btn-view-options {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 575px) {
  .product-card-badge {
    font-size: 0.65rem;
    padding: 4px 8px;
  }

  .quick-view-overlay {
    padding: 8px;
  }

  .btn-quick-view {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}
