/**
 * Products Showcase Section Styles
 * Product grid with cards
 */

/* ============================================
   Products Showcase Section
   ============================================ */
.products-showcase-section {
  padding-block: var(--section-spacing-mobile);
  background: var(--color-white);
}

@media (min-width: 768px) {
  .products-showcase-section {
    padding-block: var(--section-spacing);
  }
}

/* ============================================
   Product Card
   ============================================ */
.product-card {
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-border);
}

/* ============================================
   Product Image
   ============================================ */
.product-image-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-gray-50);
}

.product-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-image {
  transform: scale(1.08);
}

/* ============================================
   Product Badges
   ============================================ */
.product-badges {
  position: absolute;
  top: var(--space-3);
  inset-inline-start: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-base);
}

.product-badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Wishlist Button
   ============================================ */
.product-wishlist {
  position: absolute;
  top: var(--space-3);
  inset-inline-end: var(--space-3);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border: none;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  z-index: var(--z-base);
}

.product-wishlist:hover {
  background: var(--color-error);
  color: var(--color-white);
  transform: scale(1.1);
}

.product-wishlist i {
  font-size: var(--text-lg);
}

/* ============================================
   Product Content
   ============================================ */
.product-content {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-grow: 1;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.product-category {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--weight-medium);
}

.product-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  margin: 0;
}

.product-link {
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-link:hover {
  color: var(--color-primary);
}

.product-brand {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

/* ============================================
   Product Card Rating
   ============================================ */
.product-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-block: 4px;
  font-size: var(--text-xs);
}

.rating-count-sm {
  font-size: var(--text-xs);
}

/* ============================================
   Product Pricing
   ============================================ */
.product-pricing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
}

.product-price {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
}

.product-price-old {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.product-price-from {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: var(--weight-normal, 400);
  align-self: center;
}

/* ============================================
   Add to Cart Button
   ============================================ */
.btn-add-to-cart {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
}

.btn-add-to-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-view-options {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
}

.btn-view-options.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   Grid Adjustments
   ============================================ */

/* Mobile: 1 column */
@media (max-width: 575px) {
  .product-card {
    max-width: 100%;
  }
}

/* Tablet: 2 columns */
@media (min-width: 576px) and (max-width: 767px) {
  .product-card {
    max-width: 100%;
  }
}

/* Desktop: 3-4 columns handled by Bootstrap grid */

/* ============================================
   Hover States
   ============================================ */
@media (hover: hover) {
  .product-card:hover .product-link {
    color: var(--color-primary);
  }
}

/* ============================================
   Accessibility
   ============================================ */
.product-wishlist:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.product-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .product-card {
    transition: none;
  }

  .product-card:hover {
    transform: none;
  }

  .product-card:hover .product-image {
    transform: none;
  }

  .product-wishlist {
    transition: none;
  }

  .product-wishlist:hover {
    transform: none;
  }
}

/* ============================================
   Products Showcase Carousel (Slider Layout)
   ============================================ */

.products-showcase-carousel-wrapper {
  position: relative;
  padding-inline: 40px;
}

@media (max-width: 575px) {
  .products-showcase-carousel-wrapper {
    padding-inline: 36px;
  }
}

.products-showcase-carousel {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.products-showcase-carousel .carousel-inner {
  overflow: visible;
}

.products-showcase-carousel .carousel-item {
  padding-inline: var(--space-2);
}

.products-showcase-carousel-wrapper .carousel-control-prev,
.products-showcase-carousel-wrapper .carousel-control-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 50%;
  opacity: 1;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.products-showcase-carousel-wrapper .carousel-control-prev { left: 0; }
.products-showcase-carousel-wrapper .carousel-control-next { right: 0; }

.products-showcase-carousel-wrapper .carousel-control-prev:hover,
.products-showcase-carousel-wrapper .carousel-control-next:hover {
  background: rgba(0, 0, 0, 0.85);
}

.products-showcase-carousel-wrapper .carousel-control-prev i,
.products-showcase-carousel-wrapper .carousel-control-next i {
  font-size: 1rem;
  color: #fff;
  line-height: 1;
}

[dir="rtl"] .products-showcase-carousel-wrapper .carousel-control-prev {
  left: auto;
  right: 0;
}

[dir="rtl"] .products-showcase-carousel-wrapper .carousel-control-next {
  right: auto;
  left: 0;
}

@media (prefers-reduced-motion: reduce) {
  .products-showcase-carousel {
    --bs-carousel-transition: none;
  }
}
