/**
 * Best Sellers section — same as reference: header (title + subtitle + Explore button), 5-col product grid.
 * Cards: image + SALE badge, brand, name, variants, price, In Stock, QUICK ADD. Fully responsive.
 */

.best-sellers-section {
  background: #fff;
  padding: 2.5rem 1rem 3rem;
  overflow: hidden;
}

.best-sellers-container {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header: title left, subtitle below, button right */
.best-sellers-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.best-sellers-head-left {
  flex: 1 1 auto;
  min-width: 0;
}

.best-sellers-title {
  font-family: 'Anybody', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #333;
  margin: 0 0 0.35rem 0;
  line-height: 1.1;
}

@media (min-width: 768px) {
  .best-sellers-title {
    font-size: 2.25rem;
  }
}

.best-sellers-subtitle {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
  line-height: 1.45;
  max-width: 520px;
}

@media (min-width: 768px) {
  .best-sellers-subtitle {
    font-size: 0.9375rem;
  }
}

.best-sellers-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #333;
  background: #fff;
  border: 1px solid #999;
  border-radius: 6px;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.best-sellers-btn:hover {
  border-color: #333;
  color: #000;
}

@media (min-width: 768px) {
  .best-sellers-btn {
    font-size: 0.8125rem;
    padding: 0.65rem 1.35rem;
  }
}

/* Grid: on phone = horizontal scroll; tablet+ = grid 2–5 cols */
.best-sellers-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.5rem;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.best-sellers-grid::-webkit-scrollbar {
  height: 6px;
}

.best-sellers-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.best-sellers-grid::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

/* Card in horizontal scroll: fixed width, snap */
.bs-card {
  scroll-snap-align: start;
  flex: 0 0 280px;
  min-width: 280px;
}

@media (min-width: 480px) {
  .best-sellers-grid {
    flex: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
    scroll-snap-type: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    gap: 1.25rem;
  }

  .bs-card {
    flex: none;
    min-width: 0;
  }
}

@media (min-width: 768px) {
  .best-sellers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .best-sellers-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1280px) {
  .best-sellers-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
  }
}

.best-sellers-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  padding: 2rem;
}

/* Related products grid — same card design; horizontal scroll on mobile */
.related-products-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.5rem;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.related-products-grid::-webkit-scrollbar {
  height: 6px;
}

.related-products-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.related-products-grid::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.related-products-grid .bs-card {
  scroll-snap-align: start;
  flex: 0 0 280px;
  min-width: 280px;
}

@media (min-width: 480px) {
  .related-products-grid {
    flex: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
    scroll-snap-type: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    gap: 1.25rem;
  }

  .related-products-grid .bs-card {
    flex: none;
    min-width: 0;
  }
}

@media (min-width: 768px) {
  .related-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .related-products-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.related-products-grid .related-products-empty {
  flex: 0 0 100%;
  min-width: 100%;
  text-align: center;
}

@media (min-width: 480px) {
  .related-products-grid .related-products-empty {
    grid-column: 1 / -1;
  }
}

/* Shop grid — prevent card overflow on mobile (2 cols) */
.shop-products-grid {
  min-width: 0;
  overflow: hidden;
}

.shop-products-grid .bs-card {
  min-width: 0;
  max-width: 100%;
}

.shop-products-grid .bs-card-body {
  min-width: 0;
}

.shop-products-grid .bs-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.shop-products-grid .bs-card-title a {
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.shop-products-grid .bs-card-image-wrap {
  min-width: 0;
}

.shop-products-grid .bs-card-price {
  flex-wrap: wrap;
}

.shop-products-grid .bs-card-quick-add {
  min-width: 0;
}

/* Card */
.bs-card {
  background: #fff;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Image area — light grey bg */
.bs-card-image-wrap {
  position: relative;
  display: block;
  background: #e5e7eb;
  aspect-ratio: 1;
  overflow: hidden;
}

.bs-card-image-bg {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
  z-index: 0;
}

.bs-card-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.bs-card-badge-sale {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  background: var(--primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.6rem;
  border-radius: 0 0 6px 0;
}

/* Body */
.bs-card-body {
  padding: 1rem 0 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.bs-card-brand {
  font-size: 0.75rem;
  color: #999;
  margin: 0 0 0.25rem 0;
}

.bs-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: 1.25;
}

.bs-card-title a {
  color: #333;
  text-decoration: none;
}

.bs-card-title a:hover {
  color: var(--primary);
}

/* Variant dots + oval label */
.bs-card-variants {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
}

.bs-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bs-card-variant-label {
  font-size: 0.75rem;
  color: #999;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  margin-left: 0.25rem;
}

/* Price — sale price (green), original (strikethrough), discount % in parentheses */
.bs-card-price {
  margin-bottom: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.bs-card-price-current {
  font-size: 1.125rem;
  font-weight: 700;
  color: #059669;
}

.bs-card-price-old {
  font-size: 0.8125rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.bs-card-price-discount {
  font-size: 0.8125rem;
  color: #059669;
  font-weight: 500;
}

/* In Stock */
.bs-card-stock {
  font-size: 0.75rem;
  color: #059669;
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bs-card-stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #059669;
  flex-shrink: 0;
}

/* QUICK ADD button */
.bs-card-quick-add {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: auto;
}

.bs-card-quick-add:hover {
  background: var(--primary-dark);
}
