/* =====================================================================
   Product card (spec 4.4): tinted rounded cover with an inset photo, a
   white wishlist circle, a category chip, a Playfair title, a price and a
   quick-add control. Tint comes from --pc-tint (set inline by the snippet
   from Theme settings > Product cards). Legacy cx-product-card__* classes
   stay on the elements because scripts hook onto them.
   ===================================================================== */

.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--f-body);
  color: var(--c-ink);
}

/* ---- cover ---- */
.pcard__cover {
  position: relative;
  width: 100%;
  aspect-ratio: var(--pc-ratio, 4 / 5);
  padding: var(--card-inset, 16px);
  box-sizing: border-box;
  border-radius: var(--r-card);
  background: var(--pc-tint, var(--c-yellow));
  overflow: hidden;
}
.pcard__photo-link { display: block; width: 100%; height: 100%; color: inherit; text-decoration: none; }
.pcard__photo {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--r-media);
  overflow: hidden;
  background: color-mix(in srgb, var(--c-white) 55%, transparent);
}
.pcard__photo img {
  width: 100%;
  height: 100%;
  object-fit: var(--img-fit, contain);
  display: block;
  transition: transform .35s ease;
}
.pcard:hover .pcard__photo img { transform: scale(1.04); }
.pcard__photo img.js-card-image-alt { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease, transform .35s ease; }
.pcard:hover .pcard__photo img.js-card-image-alt { opacity: 1; }
.pcard__placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--c-gray); }

/* badge (sold out / pre-order) */
.pcard__badge {
  position: absolute;
  top: 28px;
  inset-inline-start: 28px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--c-yellow);
  color: var(--c-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.2;
}
html[dir="rtl"] .pcard__badge { letter-spacing: 0; }
.pcard--soldout .pcard__photo img { opacity: .55; }

/* wishlist circle */
.pcard__wish-form { position: absolute; top: 28px; inset-inline-end: 28px; z-index: 3; margin: 0; }
.pcard__wish {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--c-white); color: var(--c-ink);
  cursor: pointer;
  transition: transform .15s ease, color .15s ease;
}
.pcard__wish:hover { transform: scale(1.08); }
.pcard__wish svg { width: 18px; height: 18px; }
.pcard__wish.is-saved { color: var(--c-danger); }

/* compare icon sits just inside the heart */
.pcard .cx-product-card__compare-form { position: absolute; top: 28px; inset-inline-end: 76px; z-index: 3; margin: 0; }
.pcard .cx-product-card__compare {
  position: static;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--c-white); color: var(--c-ink);
  cursor: pointer;
  transition: transform .15s ease;
}
.pcard .cx-product-card__compare:hover:not(:disabled) { transform: scale(1.08); }
.pcard .cx-product-card__compare:disabled { opacity: .4; cursor: not-allowed; }
.pcard .cx-product-card__compare.is-active { background: var(--c-ink); color: var(--c-cream); }
.pcard .cx-product-card__compare svg { width: 18px; height: 18px; }

/* swatches (hover) */
.pcard__swatches {
  position: absolute;
  inset-inline: var(--card-inset, 16px);
  bottom: var(--card-inset, 16px);
  z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px;
  border-radius: 0 0 var(--r-media) var(--r-media);
  background: linear-gradient(to top, color-mix(in srgb, var(--c-white) 92%, transparent) 55%, transparent);
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.pcard:hover .pcard__swatches { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cx-product-card__swatch {
  flex: 0 0 auto; width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--c-white); background-color: var(--c-line); background-size: cover; background-position: center;
  cursor: pointer; box-shadow: 0 0 0 1px var(--c-line);
}
.cx-product-card__swatch:hover, .cx-product-card__swatch.is-active { box-shadow: 0 0 0 2px var(--c-ink); }
.cx-product-card__swatch-more { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--c-gray); }

/* ---- body ---- */
.pcard__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1 1 auto; min-width: 0; }
.pcard__chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-paper);
  color: var(--c-ink);
  font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.3;
}
html[dir="rtl"] .pcard__chip { letter-spacing: 0; }
.pcard__title-link { display: block; color: inherit; text-decoration: none; }
.pcard__title {
  margin: 0;
  font-family: var(--f-heading);
  font-weight: var(--w-heading);
  font-size: 24px;
  line-height: 30px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--c-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
html[dir="rtl"] .pcard__title { font-family: var(--f-ar); }
.pcard__title-link:hover .pcard__title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.pcard__author { margin: -4px 0 0; font-size: 14px; color: var(--c-gray); }
.pcard__variant { font-size: 13px; color: var(--c-gray); }
.cx-product-card__stock { margin: 0; font-size: 12px; font-weight: 600; color: var(--c-danger); }

.pcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: auto; }
.pcard__price-row { display: flex; align-items: baseline; gap: 6px; }
.pcard__price { font-size: 18px; font-weight: 700; color: var(--c-ink); }
.pcard__price-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-gray); }
.pcard__add-form { margin: 0; margin-inline-start: auto; }

/* quick add */
.pcard__add {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--c-ink); color: var(--c-cream);
  font: 600 14px/1 var(--f-body); cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.pcard__add:hover { background: var(--c-blue); color: var(--c-white); }
.pcard__add--circle { width: 42px; height: 42px; padding: 11px; border-radius: 50%; }
.pcard__add--pill { padding: 10px 20px; border-radius: 999px; }
.pcard__add--cart { padding: 11px 22px; font-size: 15px; }

/* ---- list view (horizontal row) ---- */
.pcard--list { flex-direction: row; align-items: stretch; gap: 16px; }
.pcard--list .pcard__cover { flex: 0 0 110px; width: 110px; height: auto; aspect-ratio: 1 / 1; padding: 8px; border-radius: 24px; align-self: flex-start; }
.pcard--list .pcard__photo { border-radius: 16px; }
.pcard--list .pcard__wish-form, .pcard--list .cx-product-card__compare-form, .pcard--list .pcard__badge { display: none; }
.pcard--list .pcard__body { justify-content: center; gap: 6px; }
.pcard--list .pcard__title { font-size: 20px; line-height: 26px; -webkit-line-clamp: 1; }

@media (max-width: 1099px) {
  .pcard__title { font-size: 22px; line-height: 28px; }
}
@media (max-width: 600px) {
  .pcard { gap: 12px; }
  .pcard__wish-form, .pcard__badge { top: 22px; }
  .pcard__wish-form { inset-inline-end: 22px; }
  .pcard__badge { inset-inline-start: 22px; }
  .pcard .cx-product-card__compare-form { top: 22px; inset-inline-end: 70px; }
  .pcard__wish, .pcard .cx-product-card__compare { width: 34px; height: 34px; }
  .pcard__title { font-size: 19px; line-height: 24px; }
  .pcard__price { font-size: 16px; }
  .pcard__add--circle { width: 38px; height: 38px; padding: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard__photo img, .pcard__swatches, .pcard__add, .pcard__wish { transition: none; }
}

/* Grid cards: the photo fills the width of the tinted frame and is shown whole (contain). */
.pcard:not(.pcard--list) .pcard__photo img { width: 100%; height: 100%; object-fit: var(--img-fit, contain); }

/* Grid cards: photo is the full width of the tinted frame, shown whole; its height follows the picture. */
.pcard:not(.pcard--list) .pcard__cover { aspect-ratio: auto; height: auto; }
.pcard:not(.pcard--list) .pcard__photo-link,
.pcard:not(.pcard--list) .pcard__photo { height: auto; }
.pcard:not(.pcard--list) .pcard__photo > img:not(.js-card-image-alt) { width: 100%; height: auto; object-fit: contain; }
.pcard:not(.pcard--list) .pcard__photo img.js-card-image-alt { height: 100%; object-fit: contain; }
.pcard:not(.pcard--list) .pcard__photo .pcard__placeholder { aspect-ratio: var(--pc-ratio, 4 / 5); height: auto; }
