/* ==========================================================================
   PRODUCT CARD (list item) — shared by /shop (archive-product.html) and the
   homepage product-section pattern (patterns/product-section.php).

   Scoped under .wp-block-woocommerce-product-collection (WooCommerce's own
   wrapper class, present on both pages) instead of #wp--skip-link--target —
   front-page.html has no <main> / skip-link id. The 2-class specificity
   (0,0,2,0) still beats shop-1.css's .wc-block-*{…!important} (0,0,1,0), so
   keep every !important below and never drop to a single class.

   Self-contained: the tokens and box-sizing below are duplicated from
   archive-product-reskin.css §1 because that reset file is NOT enqueued on
   the homepage. Star-rating glyphs: see product-rating.css.
   ========================================================================== */
:root {
  --bg: #ffffff;
  --surface: #f9f9f8;
  --surface-200: #f6f5f4;
  --fg: #191918;
  --muted: #78736f;
  --muted-600: #615d59;
  --border: #dfdcd9;
  --border-400: #a39e98;
  --accent-100: oklch(98% 0.015 96);
  --accent-300: oklch(90% 0.055 90);
  --accent-500: oklch(76% 0.105 81);
  --accent-600: oklch(69.9% 0.130 77);
  --accent-700: oklch(60% 0.125 75);
  --accent-800: oklch(50% 0.115 73);
  --font-body: "Helvetica Neue", system-ui, sans-serif;
}

.wp-block-woocommerce-product-collection,
.wp-block-woocommerce-product-collection * {
  box-sizing: border-box;
}

.wp-block-woocommerce-product-collection a {
  color: inherit;
  text-decoration: none;
}

/* Star-rating glyphs (woocommerce/product-rating) live in product-rating.css. */

/* Card shell — li padding is 0 (image sits edge-to-edge against the card
   border), overflow:hidden clips the image to the border-radius, and every
   element below the image (title/price/button) carries its own padding:
   0 1rem instead. */
.wp-block-woocommerce-product-collection .wc-block-product {
  position: relative;
  isolation: isolate;
  display: flex !important;
  flex-direction: column;
  min-height: 0;
  height: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wp-block-woocommerce-product-collection .wc-block-product:focus-within {
    border-color: var(--border-400);
  box-shadow: 0 2px 10px rgb(25 25 24 / 0.06);
}
.wp-block-woocommerce-product-collection .wc-block-product a:focus-visible {
  outline: none;
}

.wp-block-woocommerce-product-collection .wc-block-product:hover {
  border-color: var(--border-400);
  box-shadow: 0 2px 10px rgb(25 25 24 / 0.06);
}

.wp-block-woocommerce-product-collection .wc-block-components-product-image {
  position: relative;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  border-bottom: 1px solid var(--border);
}

.wp-block-woocommerce-product-collection .wc-block-components-product-image a {
  display: block;
  width: 100%;
  height: 100%;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: cover !important;
}

/* Sale badge — position follows WC's own alignment modifier class
   (align-left is the unmodified default) instead of hardcoding one corner.
   !important on color/background is required: the base reset otherwise wins
   over a plain-class badge-text rule and renders near-black text on the
   near-black pill. */
.wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge {
  position: absolute !important;
  top: 10px;
  left: 10px;
  right: auto;
  background: red !important;
  border: 1px solid red;
  color: var(--bg) !important;
  font-size: 11px;
  font-weight: 590;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  transition: box-shadow 0.15s ease;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge.alignright,
.wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge--align-right {
  left: auto;
  right: 10px;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge.aligncenter,
.wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge--align-center {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge__text {
  color: inherit !important;
}

.wp-block-woocommerce-product-collection .wc-block-product:hover .wc-block-components-product-sale-badge {
  box-shadow: 0 2px 6px rgb(25 25 24 / 0.25);
}

/* Stock indicator — overlay tag on the image, mirrors the sale badge's pill
   look. WC appends the --out-of-stock/--in-stock/--low-stock modifier
   server-side. */
.wp-block-woocommerce-product-collection .wc-block-components-product-stock-indicator {
  position: absolute !important;
  top: 10px;
  left: 10px;
  right: auto;
  margin: 0 !important;
  background: var(--bg) !important;
  color: var(--fg) !important;
  font-size: 11px;
  font-weight: 590;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.wp-block-woocommerce-product-collection .wc-block-components-product-stock-indicator--out-of-stock {
  background: #eaeaea !important;
  color: var(--muted) !important;
  border-color: #dcdcdc !important;
}

/* Rating left, add-to-cart pinned right: "*****      [Add to cart]".
   Each side is its own group so the row keeps two stable flex items even
   when the rating block renders empty (WC outputs nothing for 0-review
   products). */
.wp-block-woocommerce-product-collection .product-rating-cart-row {
  align-items: center;
  margin: 0 0 1rem 0;
  padding: 0 1rem;
}

.wp-block-woocommerce-product-collection .product-rating-slot,
.wp-block-woocommerce-product-collection .product-cart-slot {
  min-width: 1px;
}

.wp-block-woocommerce-product-collection .product-cart-slot {
  margin-left: auto;
}

/* font-weight / line-height / letter-spacing carry !important so the
   single-product page's #wp--skip-link--target .wp-block-post-title rule
   (higher specificity, styles the main product title) can't bleed into the
   related-products cards, which are descendants of the same skip-link id. */
.wp-block-woocommerce-product-collection .wp-block-post-title {
  font-family: var(--font-body) !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  margin: 0.75rem 0 0;
  padding: 0 1rem;
  line-height: 1.4 !important;
  min-height: calc(1.4em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wp-block-woocommerce-product-collection .wp-block-post-title a:hover {
  color: var(--muted-600);
}

.wp-block-woocommerce-product-collection .wc-block-components-product-price {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0.375rem 0 0;
  padding: 0 1rem;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-price del {
  color: var(--muted);
  font-weight: 400;
  text-decoration: line-through;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-price ins {
  color: var(--fg);
  text-decoration: none;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-button {
  margin-top: auto;
  padding: 0;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-button .wp-block-button__link,
.wp-block-woocommerce-product-collection .wc-block-components-product-button__button,
.wp-block-woocommerce-product-collection .add_to_cart_button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0.625rem 1.25rem !important;
  margin: 0 !important;
  border-radius: 999px !important;
  background: var(--fg) !important;
  color: var(--bg) !important;
  font-weight: 700;
  font-size: 0.875rem;
  border: none !important;
  cursor: pointer;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-button .wp-block-button__link:hover,
.wp-block-woocommerce-product-collection .wc-block-components-product-button__button:hover,
.wp-block-woocommerce-product-collection .add_to_cart_button:hover {
  background: var(--fg) !important;
  color: var(--bg) !important;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-button .wp-block-button__link:active,
.wp-block-woocommerce-product-collection .wc-block-components-product-button__button:active,
.wp-block-woocommerce-product-collection .add_to_cart_button:active {
  background: var(--fg) !important;
  color: var(--bg) !important;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-button .wp-block-button__link:focus-visible,
.wp-block-woocommerce-product-collection .wc-block-components-product-button__button:focus-visible,
.wp-block-woocommerce-product-collection .add_to_cart_button:focus-visible {
  background: var(--fg) !important;
  color: var(--bg) !important;
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.wp-block-woocommerce-product-collection .add_to_cart_button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* In-cart state: view-cart link visible -> swap the button to a subdued
   outline so it never reads as a second solid CTA in the same card. */
.wp-block-woocommerce-product-collection .wc-block-components-product-button:has(.added_to_cart:not([hidden])) .add_to_cart_button {
  background: transparent !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
}

.wp-block-woocommerce-product-collection .wc-block-components-product-button:has(.added_to_cart:not([hidden])) .add_to_cart_button:hover {
  border-color: var(--border-400) !important;
  background: var(--surface) !important;
}

/* WC ships an inline-computed `margin: 13px 0 0` on this link; the button
   block's own gap already separates it, so the extra margin only doubles
   the gap. Zeroed here. */
.wp-block-woocommerce-product-collection .added_to_cart {
  margin: 0 !important;
  font-size: 0.8125rem;
  color: var(--fg) !important;
  text-decoration: underline;
}

.wp-block-woocommerce-product-collection .added_to_cart:focus-visible {
  outline: 2px solid var(--accent-600);
  outline-offset: 2px;
}

/* ==========================================================================
   WHOLE-CARD CLICK TARGET

   A second, invisible product-title block (className "product-card__link",
   isLink:true) is rendered inside each card. The visible title above is
   isLink:false — this overlay anchor is the card's only link. It stretches
   over li.wc-block-product (position:relative, overflow:hidden — set on the
   card shell rule near the top of this file). Not added on the product
   search results template.

   z-index: overlay 1, real controls (image link, add-to-cart, view-cart) 2.
   ========================================================================== */
.wp-block-woocommerce-product-collection .product-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  min-height: 0;
  line-height: 0;
  font-size: 0;
  color: transparent;
  display: block;
  -webkit-line-clamp: none;
  overflow: hidden;
}

.wp-block-woocommerce-product-collection .product-card__link a {
  display: block;
  width: 100%;
  height: 100%;
  color: transparent !important;
}

/* Real controls sit above the overlay. Raise the cart slot itself as well as
   WooCommerce's button wrapper so nested cart/empty-cart layouts cannot let
   the full-card link become the hit target. */
.wp-block-woocommerce-product-collection .wc-block-components-product-button,
.wp-block-woocommerce-product-collection .added_to_cart {
  z-index: 3;
  pointer-events: auto;
  position: relative;
}

/* Visible title is no longer a link — keep the hover affordance on the card */
.wp-block-woocommerce-product-collection .wc-block-product:hover .wp-block-post-title:not(.product-card__link) {
  color: var(--muted-600);
}

/* Card focus ring driven by the overlay anchor */
.wp-block-woocommerce-product-collection .product-card__link a:focus-visible {
  outline: none;
}

.wp-block-woocommerce-product-collection .wc-block-product:has(.product-card__link a:focus-visible) {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}
