/* =========================================================
   Bernstein Woo — product card
   Values measured 1:1 from the reference design.
   ========================================================= */

.product-item {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- Image with hover swap ---------- */

.product-item__image {
  position: relative;
  margin-bottom: 8px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.product-item__image > a { display: block; height: 100%; }

.product-item__image .media { position: absolute; inset: 0; }
.product-item__image .media img { width: 100%; height: 100%; object-fit: cover; }

.media--alter {
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.product-item:hover .media--alter { opacity: 1; }

/* ---------- Badges: a row in the top-left corner ---------- */

.product-badges {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
}

.product-badges__item {
  height: 22px;
  padding: 0 6px;
  border-radius: 2px;
  background-color: var(--color-red-badge);
  color: var(--color-white);
  font-size: 11px;
  font-weight: 500;
  line-height: 22px;
  white-space: nowrap;
}

.product-badges__item--new        { background-color: var(--color-green); }
.product-badges__item--bestseller { background-color: var(--color-blue); }
.product-badges__item--soldout    { background-color: var(--color-gray); }

/* ---------- Wishlist ---------- */

.product-item-wishlist {
  position: absolute;
  top: 4px; right: 4px;
  z-index: 3;
}

.wishlist_button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  color: var(--color-black);
  transition: transform var(--dur) var(--ease);
}

.wishlist_button:hover { transform: scale(1.1); }
.wishlist_button svg { stroke: currentColor; fill: none; }
.wishlist_button.is-active svg { fill: var(--color-red-discount); stroke: var(--color-red-discount); }

/* ---------- Title ---------- */

.product-item__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--color-black);
}

.product-item__title a { color: var(--color-black); }

.product-item__title a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Subtitle ---------- */

.product-item__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-gray);
}

/* ---------- Info block: price above swatches ---------- */

.product-item__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- Price ---------- */

.price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.price__main {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-black);
}

.price__main ins,
.price__main del { text-decoration: none; }
.price__main .amount { font-weight: 700; color: inherit; }

/* Woo prints "regular <del> sale <ins>" for variable ranges — keep it black. */
.price__main del { display: none; }

.price__compare {
  font-size: 14px;
  color: var(--color-gray);
  text-decoration: line-through;
}

.price__compare .amount { font-weight: 400; }

@media only screen and (min-width: 768px) {
  .price__main { font-size: 20px; }
}

@media only screen and (min-width: 1400px) {
  .price__main { font-size: 24px; }
}

/* ---------- Colour swatches ---------- */

.product-item__colors { min-height: 20px; }

.colors {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
}

.colors__item { flex: none; }

.colors__item-image {
  display: block;
  width: 20px; height: 20px;
  border-radius: 50%;
  background-color: var(--color-gray-light);
  background-size: cover;
  background-position: center;
  transition: box-shadow var(--dur) var(--ease);
}

/* Light chips need a hairline so they stay visible on white. */
.colors__item-image--light { box-shadow: inset 0 0 0 1px var(--color-gray-medium); }

.colors__item-image:hover,
.colors__item-image.is-active {
  box-shadow: 0 0 0 2px var(--color-white), 0 0 0 3px var(--color-black);
}

.colors__plus {
  flex: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  color: var(--color-gray);
}

/* ---------- Grid (archives) ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 16px;
}

@media only screen and (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media only screen and (min-width: 1200px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 24px; }
}
