/* KICKSTW reskin: the product card (templates/card.php).
   Loaded on every page while the listing switch shows, because every content-product card on the
   site is ours then: lists, the product page's rails, search, shortcodes. Every rule starts with
   body.kt-skin; the markup is li.product.kt-card > div.kt-card__tile (a.kt-card__media, then
   div.kt-card__quick > ul.kt-card__sizes), a.kt-card__brand, a.kt-card__name > h2,
   span.kt-card__price. Look: DESIGN.md "产品图" and "组件 → 产品卡片"; under the mouse:
   site_prototype/card-hover.html, option A (12 Nov). */

/* The card */
body.kt-skin ul.products li.product.kt-card {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0; /* beats .products-slick ul.products li (blaze-online single-product stylesheet, 300px) */
  margin: 0 !important; /* beats .woocommerce .products li.product (blaze-online archive stylesheet) */
  padding: 0 !important; /* beats .woocommerce .products li.product (blaze-online archive stylesheet) */
  border: 0; /* beats .products-slick ul.products li (blaze-online single-product stylesheet) */
  background: none; /* beats .woocommerce .products li.product (blaze-online archive stylesheet), .single-product.woocommerce ul.products li.product and .products-slick ul.products li (single-product stylesheet) */
  box-shadow: none !important; /* beats .woocommerce .products li.product (blaze-online archive stylesheet) */
  color: var(--ink);
  text-align: left; /* beats .woocommerce ul.products li.product.desktop-align-center (Astra dynamic CSS) */
  list-style: none; /* beats .woocommerce-js ul.products li (Astra woocommerce stylesheet) */
  transition: none; /* beats .woocommerce ul.products li.product (blaze-online theme stylesheet, 0.3s) */
}
body.kt-skin ul.products li.product.kt-card:hover {
  box-shadow: none !important; /* beats .woocommerce ul.products li.product:hover (blaze-online theme stylesheet) */
}

/* The tile: the photo link and, over its bottom edge, the sizes */
body.kt-skin ul.products li.product.kt-card div.kt-card__tile {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden; /* the sizes wait below the tile's bottom edge: cut off there, not lying unseen over the brand and name */
}

/* The photo tile: the white-background photo is multiplied onto --img-bg, whole, never cropped */
body.kt-skin ul.products li.product.kt-card a.kt-card__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 0;
  background: var(--img-bg);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__media picture {
  display: block;
  margin: 0;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__media img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100% !important; /* beats .woocommerce .products li.product a img (blaze-online archive stylesheet) */
  height: 100% !important; /* beats .woocommerce .products li.product a img (blaze-online archive stylesheet) */
  max-width: none;
  margin: 0 !important; /* beats .woocommerce .products li.product a img (blaze-online archive stylesheet) and .woocommerce-js ul.products li.product a img (Astra) */
  padding: 0; /* beats .woocommerce ul.products li.product a img (blaze-online frontpage stylesheet, 20px) */
  border: 0;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: opacity 200ms ease, transform 200ms ease;
}
/* The second photo (assets/js/card.js loads it on the first hover, then marks the card .has-photo2) */
body.kt-skin ul.products li.product.kt-card a.kt-card__media img.kt-card__photo2 {
  opacity: 0;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__media img.kt-card__photo2.is-real {
  object-fit: cover;
  mix-blend-mode: normal;
}

/* The one label, top left: the small white label; a sale reads in the sale colour */
body.kt-skin ul.products li.product.kt-card span.kt-card__label {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  margin: 0;
  padding: 4px 8px;
  background: var(--white);
  color: var(--ink);
  font: 500 12px/1.3 var(--font-body);
  text-transform: none;
  white-space: nowrap;
}
body.kt-skin ul.products li.product.kt-card span.kt-card__label--sale {
  color: var(--red-ink);
  font-weight: 600;
}

/* The theme's claim-offer badge (kept hooked) sits inside the tile, top right, so the tile does not clip it */
body.kt-skin ul.products li.product.kt-card a.kt-card__media span.claim-offer {
  position: absolute;
  top: 8px !important; /* beats .archive .products li .onsale (blaze-online theme stylesheet) */
  right: 8px !important; /* beats the inline right the theme's claim-offer badge prints */
  left: auto;
  z-index: 1;
  margin: 0;
}

/* Sizes in stock, under the mouse (from 1025px, with a mouse): plain text on the tile's own grey at
   its bottom edge, in even columns, two rows at most, no boxes. card.js measures the tile and sets
   the columns (--kt-cols), folds what does not fit into "+N" and tells the photo how far to move up
   (--kt-strip), so the sizes take the empty margin under the product. Without the script: as many
   32px columns as fit, cut after two rows, the photo where it is. */
body.kt-skin ul.products li.product.kt-card div.kt-card__quick {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: none;
  margin: 0;
  padding: 8px;
  background: var(--img-bg);
}
body.kt-skin ul.products li.product.kt-card ul.kt-card__sizes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  max-height: 56px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}
body.kt-skin ul.products li.product.kt-card ul.kt-card__sizes::before,
body.kt-skin ul.products li.product.kt-card ul.kt-card__sizes::after {
  content: none; /* the theme's clearfix on lists inside a card: its two boxes would each take a grid cell */
}
body.kt-skin ul.products li.product.kt-card div.kt-card__quick.is-laid ul.kt-card__sizes {
  grid-template-columns: repeat(var(--kt-cols, 1), minmax(0, 1fr));
  max-height: none;
}
body.kt-skin ul.products li.product.kt-card ul.kt-card__sizes li {
  float: none;
  width: auto; /* beats .woocommerce .cart-collaterals .cross-sells ul.products li (Astra woocommerce-layout-grid stylesheet) */
  min-width: 0;
  min-height: 0; /* beats .products-slick ul.products li (blaze-online single-product stylesheet, 300px) */
  margin: 0;
  padding: 0; /* beats .products-slick ul.products li (blaze-online single-product stylesheet, 20px) */
  border: 0; /* beats .products-slick ul.products li (blaze-online single-product stylesheet) */
  background: none; /* beats .products-slick ul.products li (blaze-online single-product stylesheet) */
  box-shadow: none; /* beats .products-slick ul.products li (blaze-online single-product stylesheet) */
  list-style: none; /* beats .woocommerce-js ul.products li (Astra woocommerce stylesheet) */
}
body.kt-skin ul.products li.product.kt-card ul.kt-card__sizes li[hidden] {
  display: none;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__size {
  display: block;
  height: 28px;
  margin: 0;
  padding: 0;
  background: none;
  color: var(--ink);
  font: 500 12px/28px var(--font-body);
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 200ms ease, color 200ms ease; /* beats a (blaze-online theme stylesheet, all 0.2s linear) */
}
body.kt-skin ul.products li.product.kt-card a.kt-card__size:hover,
body.kt-skin ul.products li.product.kt-card a.kt-card__size:focus-visible,
body.kt-skin ul.products li.product.kt-card a.kt-card__size.is-picked {
  background: var(--ink);
  color: var(--white) !important; /* beats body.kt-skin-page #content a (skin.css): black on black on a list page */
  outline: 0;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__size--more {
  color: var(--muted) !important; /* beats body.kt-skin-page #content a (skin.css) */
}
body.kt-skin ul.products li.product.kt-card a.kt-card__size--more:hover {
  color: var(--white) !important; /* beats the rule above */
}
/* While a size is being added: the picked one stays black, the rest step back */
body.kt-skin ul.products li.product.kt-card div.kt-card__quick.is-busy a.kt-card__size {
  pointer-events: none;
}
body.kt-skin ul.products li.product.kt-card div.kt-card__quick.is-busy a.kt-card__size:not(.is-picked) {
  opacity: 0.35;
}
/* The answer ("Added to bag", "Couldn't add this size") takes the strip's place */
body.kt-skin ul.products li.product.kt-card div.kt-card__quick.has-msg ul.kt-card__sizes {
  display: none;
}
body.kt-skin ul.products li.product.kt-card p.kt-card__msg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 28px;
  margin: 0;
  padding: 0 4px;
  color: var(--ink);
  font: 500 12px/28px var(--font-body);
  white-space: nowrap;
}
body.kt-skin ul.products li.product.kt-card p.kt-card__msg a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
  body.kt-skin ul.products li.product.kt-card div.kt-card__quick {
    display: block;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none; /* nothing to click until it is shown */
  }
  body.kt-skin ul.products li.product.kt-card:hover div.kt-card__quick,
  body.kt-skin ul.products li.product.kt-card div.kt-card__quick.is-busy,
  body.kt-skin ul.products li.product.kt-card div.kt-card__quick.has-msg {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  /* 60ms before anything moves, so a mouse crossing the grid does not set every card off */
  body.kt-skin ul.products li.product.kt-card:hover div.kt-card__quick,
  body.kt-skin ul.products li.product.kt-card:hover a.kt-card__media img {
    transition-delay: 60ms;
  }
  body.kt-skin ul.products li.product.kt-card:hover a.kt-card__media img {
    transform: translateY(calc(var(--kt-strip, 0px) / -2));
  }
  body.kt-skin ul.products li.product.kt-card.has-photo2:hover a.kt-card__media img {
    opacity: 0;
  }
  body.kt-skin ul.products li.product.kt-card.has-photo2:hover a.kt-card__media img.kt-card__photo2 {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.kt-skin ul.products li.product.kt-card a.kt-card__media img,
  body.kt-skin ul.products li.product.kt-card div.kt-card__quick,
  body.kt-skin ul.products li.product.kt-card a.kt-card__size {
    transition: none;
  }
}

/* Brand line, name, price */
body.kt-skin ul.products li.product.kt-card .kt-card__brand {
  display: block;
  margin: 12px 0 0;
  padding: 0;
  color: var(--muted) !important; /* beats body.kt-skin-page #content a (skin.css): ink on a list or product page, grey on the home page */
  font: var(--type-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__brand:hover {
  text-decoration: underline;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__name {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  color: var(--ink);
  text-decoration: none;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__media + a.kt-card__name {
  margin-top: 12px;
}
body.kt-skin ul.products li.product.kt-card a.kt-card__name:hover {
  color: var(--muted);
}
body.kt-skin ul.products li.product.kt-card a.kt-card__name h2 {
  min-height: 0 !important; /* beats the inline min-height blaze.js (setWooGridTitleMinHeight) puts on .woocommerce ul.products li.product h2 */
  margin: 0;
  padding: 0;
  color: inherit; /* beats .products-slick h2 (blaze-online single-product stylesheet, #000) */
  font: 500 14px/1.4 var(--font-body); /* beats .products-slick h2 (blaze-online single-product stylesheet, 700 24px) */
  letter-spacing: normal;
  text-align: left;
  text-transform: none; /* beats .products-slick h2 (blaze-online single-product stylesheet, uppercase) */
  overflow-wrap: anywhere;
}
body.kt-skin ul.products li.product.kt-card span.kt-card__price {
  display: block;
  margin: 4px 0 0;
  padding: 0;
  color: var(--ink);
  font: 600 14px/1.4 var(--font-body);
  text-align: left;
}
body.kt-skin ul.products li.product.kt-card span.kt-card__price del {
  display: inline;
  margin-right: 8px;
  color: var(--faint);
  font-weight: 400;
  text-decoration: line-through;
  white-space: nowrap;
  opacity: 1;
}
body.kt-skin ul.products li.product.kt-card span.kt-card__price ins {
  display: inline;
  background: none;
  color: var(--red);
  text-decoration: none;
  white-space: nowrap;
}
body.kt-skin ul.products li.product.kt-card span.kt-card__price .woocommerce-Price-amount {
  font-size: inherit; /* beats .products-slick ul.products li .woocommerce-Price-amount.amount (blaze-online single-product stylesheet, 16px) */
}
body.kt-skin ul.products li.product.kt-card span.kt-card__price .pricemore {
  margin: 0;
  padding: 0;
  color: inherit;
}
/* What the filter matched: the size on the card and whether it is ready to ship */
body.kt-skin ul.products li.product.kt-card p.kt-card__line {
  font: 400 13px/1.4 var(--font-body);
  color: var(--muted);
  margin: 4px 0 0;
}
/* While the mouse is on a size, the price line is that size's price and status, on one line */
body.kt-skin ul.products li.product.kt-card span.kt-card__price.is-size {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.kt-skin ul.products li.product.kt-card span.kt-card__price span.kt-card__note {
  color: var(--muted);
  font-weight: 400;
}
