/* T4 (F-008, F-009): the owj card and lineup look on the stock product card (blocks/product-card/card) and the stock
   list sections (featured-collection, main-collection-products, recommended-product, recently-viewed-product) and the
   owj-bundles grid. Loaded by the owj card blocks (blocks/owj-card/*), so it only reaches pages with those cards.
   Stock markup, classes and hooks are unchanged; everything here is CSS on the stock classes.
   Scope: a card or list counts as owj when it holds an owj card block (.owj-card). Base rules sit in :where() so
   stock and app CSS keep their weight; where a stock rule must lose, one element type is added (0,1,1), never an id
   or !important. Buy button rules set the stock custom properties. Nothing targets app containers or blocks by position. */

/* ---------- card frame ---------- */
:where(product-item:has(.owj-card)) {
  display: block;
  height: 100%;
}
theme-product-card.block-product-card:where(:has(.owj-card)) {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  color: var(--black);
  font-family: var(--b-font);
  background: var(--white);
  border: 1px solid var(--card-line);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--lift) var(--ease-soft);
}
theme-product-card.block-product-card:where(:has(.owj-card)):hover {
  box-shadow: var(--card-glow);
}

/* image: square, flush with the card edge (the card clips it) */
:where(.block-product-card:has(.owj-card)) div.block-product-image__layer-image-wrapper {
  border-radius: 0;
  box-shadow: none;
  border: 0;
}
:where(.block-product-card:has(.owj-card)) .block-product-image__image-wrapper {
  --border-radius: 0;
  border-radius: 0;
}
:where(.block-product-card:has(.owj-card)) .block-product-image__image {
  transition: transform 0.9s var(--ease-soft), opacity 0.6s var(--ease-soft);
}

/* colour stripe (owj-card/_stripe) */
.owj-card-stripe {
  flex: none;
  height: 6px;
  background: var(--band, var(--orange));
}

/* ---------- card body (product-card/_info): a grid so the price row sits at the bottom of every card in a row ---------- */
:where(.block-product-card:has(.owj-card)) div.block-product-card-info {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: repeat(6, auto) 1fr auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
  padding: 16px 16px 18px;
}
:where(.block-product-card:has(.owj-card)) .block-product-card-info > * {
  grid-column: 1 / -1;
  min-width: 0;
}
:where(.block-product-card:has(.owj-card)) .block-product-card-info > * + * {
  margin-top: 8px;
}
:where(.block-product-card:has(.owj-card)) .block-product-card-info > .block-product-price {
  grid-row: 8;
  grid-column: 1;
  margin-top: 14px;
}
:where(.block-product-card:has(.owj-card)) .block-product-card-info > .block-product-buy-button-wrapper,
:where(.block-product-card:has(.owj-card)) .block-product-card-info > .owj-card-choose {
  grid-row: 8;
  grid-column: 2;
  margin-top: 14px;
}

/* heat meter (owj-card/_heat; the meter itself is components/owj/heat, styled in style.css) */
.owj-card-heat {
  display: flex;
  align-items: center;
  min-height: 19px;
}

/* title (product-title) */
:where(.block-product-card:has(.owj-card)) a.block-product-title {
  margin-top: 6px;
  color: var(--black);
  font-family: var(--d-font);
  font-weight: 400;
  font-size: calc(30px * var(--fs-h, 1));
  line-height: 0.95;
  letter-spacing: var(--h-ls, 0.01em);
  text-transform: var(--h-case, uppercase);
  text-decoration: none;
  transition: color 0.2s;
}
:where(.block-product-card:has(.owj-card)) a.block-product-title:hover {
  color: var(--orange);
}

/* card line (owj-card/_line) */
.owj-card-line {
  margin: 0;
  color: var(--charcoal);
  font-size: calc(14px * var(--fs-b, 1));
  line-height: 1.45;
}

/* bundle flavours (owj-card/_contents; the chips are components/owj/band) */
.owj-card-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* sizes (product-variant-picker): the owj pills */
:where(.block-product-card:has(.owj-card)) .block-product-card-info > form {
  margin-top: 12px;
}
:where(.block-product-card:has(.owj-card)) .variant-picker__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
:where(.block-product-card:has(.owj-card)) .block-product-variant-picker span.variant-picker__button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 12px;
  color: var(--black);
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px rgba(var(--black-rgb), 0.18);
  font: 600 calc(13px * var(--fs-b, 1)) / 1.1 var(--b-font);
  transition: box-shadow 0.35s var(--ease-soft), background-color 0.35s var(--ease-soft);
}
:where(.block-product-card:has(.owj-card)) .block-product-variant-picker span.variant-picker__button::after {
  box-shadow: none;
}
:where(.block-product-card:has(.owj-card)) .block-product-variant-picker span.variant-picker__button:hover {
  box-shadow: inset 0 0 0 1.5px rgba(var(--black-rgb), 0.45);
}
:where(.block-product-card:has(.owj-card)) .block-product-variant-picker input:checked + span.variant-picker__button {
  background-color: #fff6f0;
  box-shadow: inset 0 0 0 1.5px var(--orange), 0 0 0 3px rgba(var(--orange-rgb), 0.14);
}
:where(.block-product-card:has(.owj-card)) .block-product-variant-picker input:focus-visible + span.variant-picker__button {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
:where(.block-product-card:has(.owj-card)) .block-product-variant-picker .variant-picker__option.disabled span.variant-picker__button {
  color: var(--muted);
}

/* price (product-price) */
:where(.block-product-card:has(.owj-card)) .block-product-price .product-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}
:where(.block-product-card:has(.owj-card)) div.product-price__sale {
  color: var(--black);
  font-family: var(--d-font);
  font-weight: 400;
  font-size: calc(30px * var(--fs-h, 1));
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
:where(.block-product-card:has(.owj-card)) .product-price__origin {
  color: var(--muted);
  font-family: var(--d-font);
  font-size: calc(20px * var(--fs-h, 1));
}

/* add button (product-buy-button / owj-card/_buy): black, orange on hover, as the owj .btn.sm.dark */
:where(.block-product-card:has(.owj-card)) .block-product-buy-button-wrapper {
  padding: 0;
}
:where(.block-product-card:has(.owj-card)) .block-product-buy-button,
:where(.block-product-card:has(.owj-card)) .owj-card-choose__link {
  --color-button-background: var(--black-rgb);
  --color-button-text: var(--white-rgb);
  --button-border-radius: var(--btn-r);
  --button-border-thickness: 0px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  font: 700 calc(14px * var(--fs-b, 1)) / 1 var(--b-font);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
}
:where(.block-product-card:has(.owj-card)) .block-product-buy-button:hover,
:where(.block-product-card:has(.owj-card)) .owj-card-choose__link:hover {
  --color-button-background: var(--orange-rgb);
  --color-button-text: var(--black-rgb);
}

/* ---------- lists ---------- */
/* shared frame: the owj page width and gutters */
:where(.section-featured-collection:has(.owj-card), .main-collection-container:has(.owj-card)) .page-width {
  /* stock facets (components/facets/facets.css) pull the mobile bar out by --page-padding, so the gutter is set through it too */
  --page-padding: var(--pad);
  max-width: var(--max);
  padding-inline: var(--pad);
}
:where(.section-featured-collection, .section-recommended-product, .section-recently-viewed-product, .main-collection-container):has(.owj-card) .grid {
  --grid-horizontal-space: 26px;
  --grid-vertical-space: 26px;
  column-gap: 26px;
  row-gap: 26px;
}
:where(.section-featured-collection, .section-recommended-product, .section-recently-viewed-product):has(.owj-card) .grid > li {
  min-width: 0;
}

/* list headings (heading block): the owj display type */
:where(.section-featured-collection:has(.owj-card)) .block-heading {
  margin: 0;
  color: var(--black);
  font-family: var(--d-font);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: var(--h-ls, 0.01em);
  text-transform: var(--h-case, uppercase);
}
:where(.section-featured-collection:has(.owj-card)) .block-heading {
  font-size: calc(clamp(52px, 6.4vw, 96px) * var(--fs-h, 1));
}
/* featured collection: one collection, no tab row (the stock tab button stays in the DOM for tabs.js) */
:where(.section-featured-collection:has(.owj-card)) .featured-collection__tabs-list:has(> .featured-collection__tab:only-child) {
  display: none;
}
:where(.section-featured-collection:has(.owj-card)) div.featured-collection__tabs-header:has(> .featured-collection__tabs-list > .featured-collection__tab:only-child) {
  margin-block-end: 0;
}

/* collection page (main-collection-products, collection.flavors): the h1 above it is the rich-text heading */
:where(body.owj) .rich-text__content > h1.block-heading {
  margin: 0;
  max-width: var(--max);
  color: var(--black);
  font-family: var(--d-font);
  font-weight: 400;
  font-size: calc(clamp(52px, 6.4vw, 96px) * var(--fs-h, 1));
  line-height: 0.92;
  letter-spacing: var(--h-ls, 0.01em);
  text-transform: var(--h-case, uppercase);
}
:where(body.owj) .rich-text:has(> .rich-text__content > h1.block-heading) .rich-text__content {
  align-items: flex-start;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* ---------- owj-bundles grid (sections/owj-bundles: the stock card per bundle) ---------- */
.owj-bgrid {
  list-style: none;
}
.owj-bgrid > .owj-bgrid__item {
  min-width: 0;
}
.owj-bgrid > .owj-bgrid__byob {
  grid-column: 1 / -1;
}
.owj-bgrid > .owj-bgrid__byob > .bcard {
  height: 100%;
}
.owj-bgrid .owj-card-contents .band {
  font-size: calc(13px * var(--fs-b, 1));
}

/* the first bundle as the wide dark card (section setting feature_first) */
@media (min-width: 960px) {
  .owj-bgrid--feature > .owj-bgrid__item:first-child {
    grid-column: 1 / -1;
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) theme-product-card.block-product-card {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    color: var(--white);
    background: var(--black);
    border-color: var(--card-line-dark);
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) div.block-product-card-info {
    align-content: center;
    grid-template-rows: none;
    padding: clamp(28px, 4vw, 56px);
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .block-product-card-info > .block-product-price,
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .block-product-card-info > .block-product-buy-button-wrapper,
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .block-product-card-info > .owj-card-choose {
    grid-row: auto;
    margin-top: 22px;
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .block-product-card-info > .block-product-buy-button-wrapper,
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .block-product-card-info > .owj-card-choose {
    justify-self: start;
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) a.block-product-title {
    color: var(--white);
    font-size: calc(clamp(52px, 5.4vw, 84px) * var(--fs-h, 1));
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .owj-card-line {
    max-width: 40ch;
    color: rgba(var(--white-rgb), 0.82);
    font-size: calc(16px * var(--fs-b, 1));
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) div.product-price__sale {
    color: var(--white);
    font-size: calc(44px * var(--fs-h, 1));
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .block-product-buy-button,
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .owj-card-choose__link {
    --color-button-background: var(--orange-rgb);
    --color-button-text: var(--black-rgb);
    min-height: 52px;
    padding: 0 26px;
    font-size: calc(15px * var(--fs-b, 1));
  }
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .block-product-buy-button:hover,
  :where(.owj-bgrid--feature > .owj-bgrid__item:first-child) .owj-card-choose__link:hover {
    --color-button-background: var(--white-rgb);
    --color-button-text: var(--black-rgb);
  }
}

/* ---------- small screens ---------- */
@media (max-width: 719px) {
  .owj-bgrid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 959px) {
  :where(.section-featured-collection, .section-recommended-product, .section-recently-viewed-product, .main-collection-container):has(.owj-card) .grid {
    column-gap: 14px;
    row-gap: 18px;
  }
  :where(.block-product-card:has(.owj-card)) div.block-product-card-info {
    padding: 14px 14px 16px;
  }
  :where(.block-product-card:has(.owj-card)) a.block-product-title {
    font-size: calc(28px * var(--fs-h, 1));
  }
}

/* perf: phones have no hover, so the hover-swap photo never shows; display:none keeps the lazy image from downloading */
@media (hover: none) {
  .block-product-image__image-wrapper > .block-product-image__image:nth-of-type(2) {
    display: none;
  }
}

/* perf: a card photo box holds only the image (the stock popover/modal sit outside it), so it can skip rendering until near the viewport; its lazy image then waits too. aspect-ratio keeps the box size. */
.block-product-image__image-wrapper {
  content-visibility: auto;
}

/* ---------- restore (2026-11-17): owj buy box (owj-card/_buybox, components/owj/buybox) ----------
   Fills rows 7 to 8 of the card body grid, so its own price + Add to bag row (margin-top:auto) sits at the bottom of
   every card and the buttons line up across a row; sizes, subscribe and the ladder follow the card text. */
:where(.block-product-card:has(.owj-card)) .block-product-card-info > .owj-card-buybox {
  grid-row: 7 / span 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}
.owj-buybox, .owj-buybox .owj-pf { display: flex; flex-direction: column; flex: 1 1 auto; gap: 10px; }
.owj-buybox .owj-pf > :empty:not(button):not(input):not(select) { display: none; }
.owj-buybox .card-row { margin-top: auto; padding-top: 6px; }
.owj-buybox .card-row .price { font: 700 calc(20px * var(--fs-b, 1)) / 1 var(--b-font); color: var(--black); }
.owj-buybox .card-row .btn[disabled] { opacity: .5; cursor: not-allowed; }
.owj-buybox .sub-check { margin-top: 0; padding-top: 2px; }
.owj-buybox .save { margin: 0; }
/* sizes stacked one per row: dot, size left, price right (design bundleCard) */
.sz.stack { grid-template-columns: 1fr; gap: 6px; }
.sz.stack button { grid-template-columns: auto 1fr auto; }
.sz.stack button small { justify-self: end; color: var(--black); font-weight: 600; }
.sz.stack button[disabled] { opacity: .5; cursor: not-allowed; }
.owj-buybox .picks { gap: 6px; }
.owj-buybox .pick { display: flex; align-items: center; gap: 10px; font: 600 calc(13px * var(--fs-b, 1)) / 1.2 var(--b-font); }
.owj-buybox .pick > span { flex: none; width: 46px; }
/* review stars hook: hidden until a review app or the theme setting turns it on */
.stars[hidden] { display: none; }
.owj-card-heat.card-top { justify-content: space-between; }
/* promo card in the flavour lineup (owj-card/_promo) */
.owj-promo-li { list-style: none; }
.owj-promo-li > .card-promo { height: 100%; display: flex; flex-direction: column; }
.owj-promo-li .promo-in { display: flex; flex-direction: column; flex: 1 1 auto; }
.owj-promo-li .owj-buybox { margin-top: auto; }
@media (max-width: 640px) {
  .sz.stack button { padding: 9px 10px; }
}
/* promo card inside the stock lineup track: same look as the old owj lineup (style.css .grid>.card-promo) */
@media (min-width: 960px) {
  .featured-collection__track > .owj-promo-li { grid-column: span 2; }
}
.owj-promo-li > .card-promo { display: grid; grid-template-columns: 1.08fr 1fr; gap: 12px; padding: 12px; border-radius: var(--r); border: 1px solid var(--card-line-dark); }
.owj-promo-li .promo-img { position: relative; min-width: 0; min-height: 220px; background: linear-gradient(#3793bd, #2f88b2); }
.owj-promo-li .promo-img .shot { position: absolute; left: 0; right: 0; bottom: 0; height: auto; aspect-ratio: 1 / 1; background: transparent; -webkit-mask-image: linear-gradient(transparent, #000 14%); mask-image: linear-gradient(transparent, #000 14%); }
.owj-promo-li .promo-in { min-width: 0; border-radius: 12px; border: 1px solid var(--card-line-dark); background: radial-gradient(120% 80% at 100% 100%, rgba(var(--orange-rgb), .24), rgba(var(--orange-rgb), 0) 60%), #171717; padding: clamp(20px, 3vw, 40px); }
.owj-promo-li .promo-in .price { color: var(--white); }
@media (max-width: 959px) {
  .owj-promo-li > .card-promo { grid-template-columns: 1fr; }
}

/* restore: BYO card "from" price, Buy now hidden while a plan is chosen on the product page */
.byob-price .byob-from, .byob-price .byob-min { display: block; font: 600 calc(12px * var(--fs-b, 1)) / 1.2 var(--b-font); opacity: .75; text-transform: none; letter-spacing: 0; }
.payment-button-wrapper.owj-sub-hide { display: none; }
.owj-pdp-sub { margin-top: 4px; }

/* restore fix: a card body holding the buy box is a column; the buy box takes the free height so its price row
   (margin-top:auto) sits at the bottom of every card in a row and the Add to bag buttons line up */
:where(.block-product-card:has(.owj-card)) div.block-product-card-info:has(> .owj-card-buybox) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
:where(.block-product-card:has(.owj-card)) .block-product-card-info > .owj-card-buybox {
  flex: 1 1 auto;
}
.owj-buybox .card-row .price { color: inherit; }
/* the wide dark feature bundle */
@media (min-width: 960px) {
  .owj-bgrid--feature > .owj-bgrid__item:first-child div.block-product-card-info:has(> .owj-card-buybox) { justify-content: center; }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .owj-card-buybox { flex: 0 0 auto; }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .owj-buybox .btn.dark { background: var(--orange); color: var(--black); min-height: 56px; padding: 0 34px; }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .owj-buybox .card-row { justify-content: flex-start; gap: 24px; margin-top: 8px; }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .owj-buybox .card-row .price { font-size: calc(30px * var(--fs-b, 1)); }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .sub-check small { color: rgba(var(--white-rgb), .7); }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .save { border-color: rgba(var(--white-rgb), .18); }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .save-r { border-top-color: rgba(var(--white-rgb), .18); color: rgba(var(--white-rgb), .75); }
  .owj-bgrid--feature > .owj-bgrid__item:first-child .save-r b { color: var(--white); }
}
/* the stock layout class (style:layout:flex) sets flex 0 1 auto on the card body; with a buy box it must grow to the card's height */
theme-product-card.block-product-card div.block-product-card-info:has(> .owj-card-buybox) { flex: 1 1 auto; }
