/** Related/Upsells exactly inherit the active catalog v0.8 card presentation.
 * The catalogue styles are NOT modified by this file. Do not render the full product description.
 * Generated from the existing catalogue's canonical preview + v082 card styles.
 */

body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products {
    padding: 0; margin: 0; list-style: none;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products li.product {
    min-width: 0; width: 100%; margin: 0; float: none; display: block;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card {
    box-sizing: border-box; border: 1px solid #e9dbc7; border-radius: 4px;
    background: #fffdfa; padding: 4px 4px 10px; margin: 0;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card:hover { border-color: #cfaf84; box-shadow: 0 3px 14px #8d63381a; }
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__media,
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__media a { display: block; width: 100%; overflow: hidden; }
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__media img {
    display: block; width: 100%; height: 100%; aspect-ratio: 1.22 / 1; object-fit: cover; max-width: none;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__title {
    text-align: left; padding: 8px 8px 0; margin: 0; font: 21px/1.12 var(--kupetz-font-serif, Georgia, serif);
    color: var(--kcv8-text); min-height: 56px;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__weight-value { color: #a57755; margin: 0 8px 5px; text-align: left; font-size: 12px; }
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__divider { display: none; }
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__purchase {
    margin: auto 0 0; padding: 5px 8px 0; display: flex; align-items: end; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__price,
body.kcv9-active.single-product :is(.related.products, .upsells.products) .woocommerce-Price-amount.amount { color: var(--kcv8-wine); font: 700 20px/1.15 var(--kupetz-font-serif, Georgia, serif); }
body.kcv9-active.single-product :is(.related.products, .upsells.products) .add_to_cart_button,
body.kcv9-active.single-product :is(.related.products, .upsells.products) .button.product_type_simple,
body.kcv9-active.single-product :is(.related.products, .upsells.products) .button.product_type_variable {
    background: var(--kcv8-wine); color: #fff2df; border: 1px solid var(--kcv8-wine);
    border-radius: 3px; font: 12px/1.3 var(--kupetz-font-body, Arial, sans-serif);
    width: auto; max-width: none; min-height: 36px; padding: 8px 12px; margin: 0;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .add_to_cart_button::after,
body.kcv9-active.single-product :is(.related.products, .upsells.products) .button.product_type_simple::after { display: none; }

/* Same canonical v082 card rules, scoped only to Related/Upsells */
/**
 * Kupetz catalog v0.8.2: product-card visual refinement.
 * Scope: active v0.8 pilot, product cards ONLY; category tiles not affected.
 * No generated content and no replacement of WooCommerce price or cart handlers.
 */

body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products li.product:not(.product-category) {
    min-width: 0;
    height: 100%;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    padding: 0 0 14px;
    border: 1px solid #e6d7c3;
    border-radius: 4px;
    background: #fffdfa;
    box-shadow: 0 2px 12px rgb(52 4 12 / 4%);
    overflow: hidden;
    transition: border-color .18s ease, box-shadow .18s ease;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card:hover {
    border-color: #cba975;
    box-shadow: 0 7px 22px rgb(52 4 12 / 10%);
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__inner {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
}

/* The actual product photo fills the entire media region, including its edges. */
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__media {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f7f1e8;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__media img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    transition: transform .32s ease;
}

@media (hover: hover) and (pointer: fine) {
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card:hover .kupetz-product-card__media img {
        transform: scale(1.025);
    }
}

/* Preserve complete imported product names; avoid splitting the card grid. */
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__title {
    display: block;
    min-height: 0;
    min-width: 0;
    margin: 0;
    padding: 12px 13px 4px;
    color: #40252b;
    font-family: var(--kupetz-font-serif, Georgia, serif);
    font-size: clamp(17px, 1.15vw, 19px);
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__weight-value {
    margin: 2px 13px 8px;
    color: #92745e;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__purchase {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 9px 8px;
    margin: auto 0 0;
    padding: 9px 13px 0;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__price-wrap {
    flex: 1 1 88px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    text-align: left;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__price,
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .woocommerce-Price-amount.amount {
    color: #540b16;
    font-family: var(--kupetz-font-serif, Georgia, serif);
    font-size: clamp(17px, 1.25vw, 21px);
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__price bdi {
    white-space: nowrap;
}

/* Do not replace WooCommerce purchase logic: only improve its interactive skin. */
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .add_to_cart_button,
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_simple,
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_variable,
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_external {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 98px;
    min-height: 38px;
    max-width: 100%;
    width: auto;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #540b16;
    border-radius: 3px;
    background: #540b16;
    color: #fff8ed;
    font-family: var(--kupetz-font-body, Arial, sans-serif);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    text-align: center;
    white-space: normal;
    transition: background-color .18s ease, border-color .18s ease;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .add_to_cart_button:hover,
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_simple:hover,
body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_variable:hover {
    background: #792130;
    border-color: #792130;
    color: #fff8ed;
}

body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card a:focus-visible {
    outline: 2px solid #b18b52;
    outline-offset: 2px;
}

/* Keep two readable columns on small screens. */
@media (max-width: 860px) {
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__title {
        font-size: 18px;
        padding: 10px 10px 4px;
    }
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__purchase {
        padding: 8px 10px 0;
    }
}

@media (max-width: 480px) {
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__title {
        font-size: 16px;
        line-height: 1.24;
        padding: 9px 9px 3px;
    }
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__weight-value {
        margin-inline: 9px;
    }
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__purchase {
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
        padding: 8px 9px 0;
    }
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .kupetz-product-card__price-wrap {
        flex: 0 0 auto;
        width: 100%;
    }
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .add_to_cart_button,
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_simple,
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_variable,
    body.kcv9-active.single-product :is(.related.products, .upsells.products) li.product:not(.product-category) .button.product_type_external {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card,
    body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__media img,
    body.kcv9-active.single-product :is(.related.products, .upsells.products) .add_to_cart_button {
        transition: none;
    }
}

/* Respect the catalogue's desktop card footprint (about 258px wide).
   Related previously defaulted to 240px cards with disproportionate gaps. */
body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 258px));
  gap: 14px;
  justify-content: space-between;
  align-items: stretch;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products > li.product {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  float: none;
  height: 100%;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card {
  min-height: 444px;
  width: 100%;
  max-width: none;
  height: 100%;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}
body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__purchase { margin-top: auto; }
@media (max-width: 1300px) {
  body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products {
    grid-template-columns: repeat(3, minmax(0, 258px));
    gap: 12px;
  }
}
@media (max-width: 860px) {
  body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__title {
    min-height: 58px;
    font-size: 17px;
    padding: 7px 4px 0;
  }
  body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__purchase {
    align-items: stretch;
    flex-direction: column;
    padding: 5px 4px 0;
  }
  body.kcv9-active.single-product :is(.related.products, .upsells.products) .add_to_cart_button,
  body.kcv9-active.single-product :is(.related.products, .upsells.products) .button.product_type_simple { width: 100%; }
}
@media (max-width: 359px) {
  body.kcv9-active.single-product :is(.related.products, .upsells.products) ul.products { gap: 7px; }
  body.kcv9-active.single-product :is(.related.products, .upsells.products) .kupetz-product-card__title { font-size: 16px; }
}
