/* ---------------------------------------------------------------------------
   Product card. 318x507 on the reference at 1440, and every part of it — the
   square photo on #f5f5f5, the badge stack, the 40px heart, the 24px price —
   is measured from there.
   --------------------------------------------------------------------------- */

/* position: relative is load-bearing. WooCommerce's price HTML carries a
   <span class="screen-reader-text"> — position: absolute — for sale and
   range prices. With no positioned ancestor its containing block is the
   root, so on a card scrolled off to the right that invisible 1px box sat at
   x=2600 against <html>, immune to the rail's overflow clip, and made the
   whole page scroll sideways. Contained here, it is clipped with the card. */
.bs-card { position: relative; display: flex; flex-direction: column; }

.bs-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bs-gray-ultra-light);
}

.bs-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s var(--bs-ease);
}

.bs-card:hover .bs-card__media img { transform: scale(1.03); }

/* Two pictures stacked; the gallery one fades in over the cover on hover and
   fades back out when the pointer leaves. */
.bs-card__media--swap img { position: absolute; inset: 0; }
.bs-card__media--swap .bs-card__img--hover { opacity: 0; transition: opacity .35s var(--bs-ease), transform .4s var(--bs-ease); }
.bs-card:hover .bs-card__media--swap .bs-card__img--hover { opacity: 1; }
@media (hover: none) { .bs-card__media--swap .bs-card__img--hover { display: none; } }

/* Badges stack from the top-left corner of the photo. */
.bs-card__badges {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bs-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  background: var(--bs-black);
  color: var(--bs-white);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bs-badge--sale { background: var(--bs-red-announcement); }
.bs-badge--new { background: var(--bs-green); }
.bs-badge--best { background: var(--bs-black); }

/* 60px of hit area around a 40px white disc — comfortable on a phone without
   a 60px white circle sitting on the photo. */
.bs-card__wish {
  position: absolute;
  top: 3px; right: 3px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  color: var(--bs-black);
  cursor: pointer;
}

.bs-card__wish::before {
  content: "";
  position: absolute;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bs-white);
}

.bs-card__wish svg { position: relative; }
.bs-card__wish:hover { color: var(--bs-red-discount); }
.bs-card__wish.is-on { color: var(--bs-red-discount); }

.bs-card__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin-top: 16px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
}

.bs-card__variant {
  margin-top: 8px;
  color: var(--bs-gray);
  font-size: 14px;
  line-height: 21px;
}

/* Every card prices alike: the figure the buyer pays is 18px and red,
   whether or not a struck-through old price sits beside it. Mixed sizes
   made a plain price look like the headline and a sale look like a note. */
.bs-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin-top: 8px;
  color: var(--bs-red-discount);
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

/* A figure never breaks in the middle; if two of them cannot share the line,
   the break falls between them. */
.bs-card__price .woocommerce-Price-amount,
.bs-card__price .amount { white-space: nowrap; }

/* "28.105.000 đ – 31.638.000 đ" is 27 characters where "465,90 €" is 8.
   At 18px a range or a sale pair sits on one 318px line. */
.bs-card__price--long { font-size: 18px; line-height: 24px; }

.bs-card__price--sale del { color: var(--bs-gray); font-size: 14px; font-weight: 400; text-decoration: line-through; }
.bs-card__price--sale ins { text-decoration: none; }

.bs-card__was {
  margin-left: 8px;
  color: var(--bs-gray);
  font-size: 16px;
  font-weight: 400;
  text-decoration: line-through;
}

.bs-card__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--bs-gray);
  font-size: 14px;
}

.bs-stars { display: inline-flex; gap: 1px; color: var(--bs-star); }
.bs-stars svg { display: block; }

.bs-card__colors { display: flex; gap: 6px; margin-top: 12px; }

.bs-card__colors .bs-card__dot {
  width: 20px; height: 20px;
  border: 1px solid var(--bs-gray-light);
  border-radius: 50%;
}

.bs-card__more { align-self: center; color: var(--bs-gray); font-size: 14px; line-height: 20px; }
