  /* ===================================================================
     Product card — matches InvoEcommerceFront's default "classic" card
     (product-grid-style1) exactly: a flat rectangular photo with a
     secondary-image crossfade on hover, a top-left "Sale!" ribbon, a
     left-aligned single-line ellipsis title, a plain price line (bold
     accent color, struck-through compare-at price above when
     discounted), and an always-visible footer row with an outlined
     "Add to cart" button (fills solid on hover) next to a circular
     wishlist heart button. Accent color is wired through --pc-accent so
     it still follows settings.accent_color when set. All existing JS
     hooks (.js-product-card, .js-card-image, .js-swatch,
     .js-card-variant-name, .js-card-price, .js-card-cta,
     .js-add-to-cart-form) are kept so card-click navigation,
     colour-swatch swapping and AJAX add-to-cart keep working unchanged.
     Scoped with a cx- prefix; the legacy `product-card` class stays on
     the root element for backward compatibility with any page-level
     overrides.
     =================================================================== */

  .cx-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid rgb(236, 236, 236);
    border-radius: 12px;
    box-sizing: border-box;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: 0.3s;
  }

  .cx-product-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
  }

  .cx-product-card__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
  }

  .cx-product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s;
  }

  /* Secondary hover image: stacked on top of the primary image, hidden
     until the card is hovered. Only rendered when the product has a
     second image (see js-card-image-alt below). */
  .cx-product-card__media img.js-card-image-alt {
    position: absolute;
    inset: 0;
    opacity: 0;
  }

  /* Swap only while the pointer is over the IMAGE (not the whole card), and only when a second
     image exists — a one-image product keeps its photo on hover instead of going blank. */
  .cx-product-card__media:hover:has(img.js-card-image-alt) img:not(.js-card-image-alt) {
    opacity: 0;
  }

  .cx-product-card__media:hover img.js-card-image-alt {
    opacity: 1;
  }

  .cx-product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: color-mix(in srgb, var(--pc-accent) 45%, #999);
  }

  /* Sale ribbon: rectangular pill, top-left of the photo, uppercase,
     solid accent fill. */
  .cx-product-card__label-group {
    display: flex;
    flex-direction: column;
    position: absolute;
    inset-inline-start: 1.2rem;
    top: 1.2rem;
    z-index: 2;
    max-width: calc(100% - 2.4rem);
    border-radius:4px;
  }

  .cx-product-card__discount {
    display: inline-block;
    text-align: center;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.6rem;
    font-size: 13px;
    border-radius: 2px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: var(--pc-accent);
    text-transform: uppercase;
    white-space: nowrap;
  }

  .cx-product-card__details {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: #fff;
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
  }

  .cx-product-card__title {
    margin: 0 0 0.3rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cx-product-card__link:hover .cx-product-card__title {
    color: var(--pc-accent);
  }

  .cx-product-card__variant {
    display: block;
    margin: -0.15rem 0 0.4rem;
    font-size: 0.8125rem;
    color: #767677;
  }

  /* Plain price line: bold accent-colored current price, with the
     compare-at price struck through just above it when discounted. */
  .cx-product-card__price-row {
    margin: 0 0 0.6rem;
  }

  .cx-product-card__price-compare {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #999;
    text-decoration: line-through;
  }

  .cx-product-card__price {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pc-accent);
  }

  .cx-product-card__meta {
    display: block;
    margin: 0 0 0.6rem;
    font-size: 0.8125rem;
    color: #767677;
  }

  /* Colour-swatch matrix. */
  .cx-product-card__swatches {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.9rem;
  }

  .cx-product-card__swatch {
    flex: 0 0 auto;
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background-color: #eee;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }

  .cx-product-card__swatch:hover {
    border-color: var(--pc-accent);
  }

  .cx-product-card__swatch.is-active {
    border-color: var(--pc-accent);
    box-shadow: 0 0 0 1px var(--pc-accent);
  }

  .cx-product-card__swatch-more {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 700;
    color: #555;
  }

  .cx-product-card__stock {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0 0 0.6rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #b3261e;
  }

  /* Footer action row: outlined "Add to cart" button (fills solid on
     hover) next to a circular wishlist icon button. Always visible in
     the normal flow — mirrors InvoEcommerceFront's .product-action row
     as rendered inside .product-details (no hover-reveal there). */
  .cx-product-card__footer {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
  }

  .cx-product-card__add-form {
    flex: 1;
    margin: 0;
    min-width: 0;
  }

  .cx-product-card__add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.6rem;
    border: 1px solid var(--pc-accent);
    border-radius: 10px;
    background: transparent;
    color: var(--pc-accent);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    padding: 0 1rem;
    gap: 0.4rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .cx-product-card__add-icon { flex-shrink: 0; }

  .cx-product-card__add-btn:hover,
  .cx-product-card__media:hover ~ .cx-product-card__details .cx-product-card__add-btn {
    background: var(--pc-accent);
    color: #fff;
  }

  .cx-product-card__view-btn {
    text-decoration: none;
    box-sizing: border-box;
  }

  .cx-product-card__wishlist-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    margin: 0;
    border: 0;
    border-radius: 10px;
    background-color: #fff;
    color: #999;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  }

  .cx-product-card__wishlist-btn:hover {
    /* border-color: #e53935; */
    color: #e53935;
    background-color: #eee;
  }

  .cx-product-card__wishlist-btn.is-filled {
    color: #e53935;
  }

  .cx-product-card__wishlist-btn.is-filled:hover {
    color: #e53935;
  }

  .cx-product-card__wishlist-btn svg {
    width: 1.4rem;
    height: 1.4rem;
  }

  /* Sold-out state: same footer slot as the add-to-cart button, but a
     plain muted label instead of an actionable button. */
  .cx-product-card__sold-out {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.6rem;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #f7f7f7;
    color: #999;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    padding: 0 1rem;
  }

  /* "Add to cart" → "Add" on mobile (full label stays for screen readers). */
  .cx-product-card__add-label--short { display: none; }
  @media (max-width: 600px) {
    .cx-product-card__add-label--full {
      position: absolute; width: 1px; height: 1px; overflow: hidden;
      clip: rect(0 0 0 0); white-space: nowrap;
    }
    .cx-product-card__add-label--short { display: inline; }
  }

  @media (max-width: 480px) {
    .cx-product-card__label-group {
      inset-inline-start: 0.8rem;
      top: 0.8rem;
    }

    .cx-product-card__title {
      font-size: 0.98rem;
    }

    .cx-product-card__price {
      font-size: 0.98rem;
    }

    .cx-product-card__add-btn,
    .cx-product-card__sold-out {
      height: 2.2rem;
      font-size: 0.8125rem;
      padding: 0 0.85rem;
    }

    .cx-product-card__wishlist-btn {
      width: 2.2rem;
      height: 2.2rem;
    }
  }

  /* ===================================================================
     List view — merchant-selectable per section (view_type: 'list').
     Flips the card to a horizontal row: small square thumbnail on the
     left, content column on the right. Pure modifier on the same
     markup used for grid mode, so every existing hook (swatches,
     wishlist, add-to-cart form) keeps working unchanged.
     =================================================================== */
  .cx-product-card--list {
    flex-direction: row;
    align-items: stretch;
  }

  .cx-product-card--list .cx-product-card__media {
    width: 140px;
    flex: 0 0 140px;
    aspect-ratio: auto;
  }

  .cx-product-card--list .cx-product-card__details {
    flex: 1;
    min-width: 0;
    padding-left: 1rem;
  }

  .cx-product-card--list .cx-product-card__footer {
    max-width: 320px;
  }

  @media (max-width: 480px) {
    .cx-product-card--list .cx-product-card__media {
      width: 90px;
      flex-basis: 90px;
    }

    .cx-product-card--list .cx-product-card__details {
      padding: 0.9rem;
    }

    .cx-product-card--list .cx-product-card__footer {
      flex-direction: column;
      align-items: stretch;
      gap: 0.4rem;
      max-width: none;
    }
  }

  /* ===================================================================
     Reference redesign (menu / shop / search / every product grid):
     bordered 16px card, rounded grey image tile with a round heart over
     its top-right corner, bold title, accent price, full-width filled
     "ADD TO CART" button; sold-out = grey disabled button. In list mode
     (phones on the menu page, view_type: 'list') the card is a row: thumb
     left, then title / price / [ADD  ♡] stacked on the right.
     =================================================================== */
  .cx-product-card {
    padding: 0.5rem;
    border: 1px solid var(--adi-gray-200, #e5e5e5);
    border-radius: 16px;
  }

  .cx-product-card__media {
    border-radius: 12px;
    background: var(--adi-gray-100, #f2f3f5);
  }

  .cx-product-card__label-group { inset-inline-start: 0.6rem; top: 0.6rem; }
  .cx-product-card__discount { border-radius: 6px; }

  /* The heart lives in the footer markup; on grid cards it floats over the image corner. */
  .cx-product-card__details { position: static; padding: 0.7rem 0.35rem 0.35rem; }

  .cx-product-card__wishlist-form {
    position: absolute;
    top: 0.95rem;
    inset-inline-end: 0.95rem;
    z-index: 3;
    margin: 0;
  }

  .cx-product-card__wishlist-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #fff;
    color: #555;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  }

  .cx-product-card__wishlist-btn svg { width: 1rem; height: 1rem; }

  .cx-product-card__wishlist-btn:hover { background: #fff; color: #e53935; }

  .cx-product-card__title {
    margin: 0 0 0.25rem;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
    color: #111;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .cx-product-card__price-row { margin: 0 0 0.5rem; }
  .cx-product-card__price { font-size: 14px; font-weight: 800; }

  .cx-product-card__unavail {
    margin: 0 0 0.5rem;
    font-size: 13px;
    color: var(--adi-gray-500, #767677);
  }

  .cx-product-card__footer { padding-top: 0.35rem; gap: 0.5rem; }

  .cx-product-card__add-btn {
    height: 2.5rem;
    border-radius: 10px;
    background: var(--pc-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
  }

  .cx-product-card__add-icon { width: 18px; height: 18px; }

  .cx-product-card__add-btn:hover,
  .cx-product-card__media:hover ~ .cx-product-card__details .cx-product-card__add-btn {
    background: var(--pc-accent);
    color: #fff;
    opacity: 0.88;
  }

  .cx-product-card__sold-out {
    height: 2.5rem;
    border: 0;
    border-radius: 10px;
    background: var(--adi-gray-100, #f2f3f5);
    color: #9aa0a6;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
  }

  /* ---- List mode: row card (explicit list view, and phones on the menu page) ---- */
  .cx-product-card--list .cx-product-card__media { width: 96px; flex: 0 0 96px; }

  .cx-product-card--list .cx-product-card__details { padding: 0.1rem 0.25rem 0.1rem 0.85rem; }

  .cx-product-card--list .cx-product-card__wishlist-form { position: static; }

  .cx-product-card--list .cx-product-card__wishlist-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    border: 1px solid var(--adi-gray-200, #e5e5e5);
    box-shadow: none;
  }

  .cx-product-card--list .cx-product-card__wishlist-btn svg { width: 1.15rem; height: 1.15rem; }

  @media (max-width: 480px) {
    .cx-product-card--list .cx-product-card__footer {
      flex-direction: row;
      align-items: center;
      gap: 0.5rem;
    }
  }

  /* ---- Offer card: black "OFFER -20%" pill on the image, price with the old price struck through beside it ---- */
  .cx-product-card__discount {
    margin: 0;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
  }

  .cx-product-card__price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.1rem 0.5rem;
  }

  .cx-product-card__price,
  .cx-product-card__price-compare { display: inline; }

  .cx-product-card__price-compare { font-size: 13px; }
