/* V123 WS-C -- PB Universal Product Card R5 (PB-C033) + engagement strip. Switch 74 v123_product_card: linked only by
   Views/Shared/_V123CardAssets.cshtml, so with the switch off nothing here applies. PB tokens only (light + dark + black through
   pb-tokens.css), logical properties (RTL + LTR), content targets >= 48 x 48 CSS px, prefers-reduced-motion, forced colors.
   Card: radius 16, padding 16, a thin semantic INSET stroke (it takes no layout width: a 173 px card keeps 141 px inside),
   no heavy shadow. Strip (I02): measured by its own inner width (container query), never by device:
     one line   from its single-line minimum (4 actions 244, 3 without Download 172, Favorite + Download + Like 192 ...),
     two columns from its two-column minimum (4 actions 140, 3 with Like 120 ...), one column below (139 px with a consuming border). */

/* ------------------------------------------------------------------ host (the consumer's own list item / block) */
.pb123-host { display: flex; flex-direction: column; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important;
    padding: 0 !important; overflow: visible !important; transform: none !important; }

/* ------------------------------------------------------------------ card */
.pb123c {
    position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0;
    background: var(--pb-color-surface); color: var(--pb-color-text); border-radius: var(--pb-radius-card, 16px);
    font-size: 16px; line-height: 1.4;
}
.pb123c::before {
    /* the inset stroke: drawn above the media, never takes width, never catches a press */
    content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    border: 1px solid var(--pb-color-border); border-radius: inherit;
}
.pb123c:focus-within::before { border-color: var(--pb-color-border-strong); }
.pb123c.is-unavailable .pb123c-media img { opacity: .72; }

.pb123c-media {
    position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
    border-start-start-radius: inherit; border-start-end-radius: inherit;
    background: var(--pb-color-skeleton, var(--pb-color-surface-subtle));   /* the skeleton of the same size until the image paints */
}
.pb123c-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pb123c-media.is-contain { background: var(--pb-color-surface-subtle); }
.pb123c-media.is-contain img { object-fit: contain; }
.pb123c-media img.is-broken { display: none; }
.pb123c-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--pb-color-text-tertiary); }
.pb123c-render { z-index: 2; }
.pb123c-badge, .pb123c-imgs {
    position: absolute; z-index: 2; inset-block-start: 8px; display: inline-flex; align-items: center; gap: 4px;
    min-height: 24px; padding: 0 8px; border-radius: var(--pb-radius-pill, 9999px); font-size: 12px; line-height: 18px; font-weight: 600;
    background: var(--pb-color-surface); color: var(--pb-color-text); border: 1px solid var(--pb-color-border);
}
.pb123c-badge { inset-inline-start: 8px; }
.pb123c-imgs { inset-inline-end: 8px; font-variant-numeric: tabular-nums; }

.pb123c-body { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; padding: 12px 16px 16px; min-width: 0; }
.pb123c-title { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.pb123c-link {
    color: var(--pb-color-text); text-decoration: none;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;   /* 2 lines in the gallery; full name on the page */
}
/* ONE semantic item link: its stretched area covers the whole card (image included); every other control sits above it */
.pb123c-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--pb-radius-card, 16px); }
.pb123c-link:hover { text-decoration: underline; }
.pb123c-link:focus-visible { outline: none; }
.pb123c-link:focus-visible::after { outline: 2px solid var(--pb-color-focus); outline-offset: -2px; }
.pb123c-variant { display: block; font-weight: 400; font-size: 14px; color: var(--pb-color-text-muted); }

.pb123c-info { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0; font-size: 13px; line-height: 19px; color: var(--pb-color-text-muted); }
.pb123c-type { font-weight: 600; }
.pb123c-cue { color: var(--pb-color-text); font-weight: 600; }
.pb123c-cue.is-soldout, .pb123c-cue.is-unavailable { color: var(--pb-warning-text, var(--pb-color-text)); }
.pb123c-by { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; font-size: 13px; line-height: 19px; color: var(--pb-color-text-muted); min-width: 0; }
.pb123c-author {
    position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; max-width: 100%;
    color: var(--pb-color-text-muted); text-decoration: none; min-width: 0;
}
.pb123c-author:hover .pb123c-name { text-decoration: underline; }
.pb123c-author:focus-visible { outline: 2px solid var(--pb-color-focus); outline-offset: 2px; border-radius: 6px; }
.pb123c-author.is-plain { min-height: 24px; }
.pb123c-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }   /* one line in the gallery */
.pb123c-avatar {
    flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; overflow: hidden;
    border-radius: 50%; background: var(--pb-color-surface-subtle); color: var(--pb-color-text); font-size: 11px; font-weight: 700; line-height: 1;
    box-shadow: inset 0 0 0 1px var(--pb-color-border);
}
.pb123c-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pb123c-credit { margin: 0; font-size: 13px; color: var(--pb-color-text-muted); overflow-wrap: anywhere; }
.pb123c-extra { position: relative; z-index: 2; margin-block-start: 8px; min-width: 0; }   /* consumer slot outside the item link */

/* ------------------------------------------------------------------ engagement strip: aligned to the card end, own inner width */
.pb123c-acts { position: relative; z-index: 2; margin-block-start: auto; padding-block-start: 8px; container-type: inline-size; min-width: 0; }
.pb123s { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; }
.pb123s-i { display: flex; min-width: 0; }
.pb123f { display: flex; flex: 1 1 auto; margin: 0; min-width: 0; }

/* two columns of two (row-major = the logical order) */
@container (min-width: 68px)  { .pb123s--two-68  { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 120px) { .pb123s--two-120 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 140px) { .pb123s--two-140 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* one line: every action in its logical order */
@container (min-width: 48px)  { .pb123s--n1.pb123s--one-48, .pb123s--n1.pb123s--one-68 { grid-template-columns: minmax(0, 1fr); } }
@container (min-width: 100px) { .pb123s--n2.pb123s--one-100 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 120px) { .pb123s--n2.pb123s--one-120 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 140px) { .pb123s--n2.pb123s--one-140 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 172px) { .pb123s--n3.pb123s--one-172 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 192px) { .pb123s--n3.pb123s--one-192 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 244px) { .pb123s--n4.pb123s--one-244 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* a browser without container queries: two columns (the 2 x 2 layout fits every supported card width) */
@supports not (container-type: inline-size) { .pb123s { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* content wider than its minimum (a long count, 200% zoom, a large font): the script measures an overflow and stacks the strip */
.pb123s.pb123s--force1 { grid-template-columns: minmax(0, 1fr) !important; }

.pb123a {
    flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-width: 48px; min-height: 48px; padding: 0 4px; margin: 0; box-sizing: border-box;
    border: 1px solid transparent; border-radius: var(--pb-radius-control, 10px); background: transparent;
    color: var(--pb-color-text-muted); font: inherit; font-size: 12px; line-height: 1; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pb123a--count { min-width: 68px; }
.pb123a:hover { background: var(--pb-color-surface-hover); color: var(--pb-color-text); }
.pb123a:focus-visible { outline: 2px solid var(--pb-color-focus); outline-offset: 0; }
.pb123a-n { font-variant-numeric: tabular-nums; min-width: 3.2ch; text-align: start; white-space: nowrap; font-weight: 600; }
.pb123a-n.is-unknown { color: var(--pb-color-text-tertiary); }

.pb123i { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* selected = a change of SHAPE (filled) + colour + aria-pressed, never colour alone */
.pb123a[aria-pressed="true"] { color: var(--pb-color-action); }
.pb123a[aria-pressed="true"] .pb123i-f { fill: currentColor; }
.pb123a--target[aria-pressed="true"] { color: var(--pb-color-text); }
.pb123a--target[aria-pressed="true"] .pb123i-tg { fill: url(#pb123-tg); stroke: var(--pb-color-text); }
.pb123a--target[aria-pressed="true"] .pb123i-dot { fill: var(--pb-color-surface); stroke: var(--pb-color-text); }
/* pending: the wanted state is shown dashed until the server answers (aria-pressed keeps the confirmed state) */
/* V138 R2: a pending press already shows the wanted state (optimistic); no dashed / faded look */
.pb123a.is-pending.is-want-on .pb123i-f { fill: currentColor; }
.pb123a.is-pending.is-want-off .pb123i-f { fill: none; }

.pb123c-inshop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0 0; font-size: 13px; color: var(--pb-success-text, var(--pb-color-text)); }
.pb123c-manage { display: inline-flex; align-items: center; min-height: 48px; color: var(--pb-color-link); }
.pb123c-msg { margin: 6px 0 0; font-size: 13px; line-height: 19px; color: var(--pb-danger-text, var(--pb-color-text)); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pb123c-msg[hidden] { display: none; }
.pb123c-msg button {
    min-height: 48px; padding: 0 12px; border: 1px solid var(--pb-color-border-strong); border-radius: var(--pb-radius-control, 10px);
    background: var(--pb-color-secondary, var(--pb-color-surface)); color: var(--pb-color-text); font: inherit; cursor: pointer;
}
/* ------------------------------------------------------------------ item page bar (G5): the same strip, no card chrome, + Share */
.pb123-barwrap { margin: 10px 0 0; max-width: 420px; }
.pb123c.pb123c--bar { background: none; border-radius: 0; }
.pb123c.pb123c--bar::before { display: none; }
.pb123c--bar .pb123c-acts { padding-block-start: 0; }
.pb123-share { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 8px; }
.pb123-sharebtn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; cursor: pointer; font: inherit; font-size: 14px;
    border: 1px solid var(--pb-color-border-strong); border-radius: var(--pb-radius-control, 10px); background: var(--pb-color-secondary, var(--pb-color-surface)); color: var(--pb-color-text);
}
.pb123-sharebtn[hidden] { display: none; }
.pb123-sharebtn:focus-visible { outline: 2px solid var(--pb-color-focus); outline-offset: 2px; }
.pb123-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* a guest / signed-in return intent lands on its action */
.pb123a.is-intent { outline: 2px solid var(--pb-color-focus); outline-offset: 0; }

@media (prefers-reduced-motion: no-preference) {
    .pb123a { transition: background-color .12s ease, color .12s ease; }
}
@media (forced-colors: active) {
    .pb123c::before { border-color: CanvasText; }
    .pb123a { border-color: ButtonText; }
    .pb123a[aria-pressed="true"] { outline: 2px solid Highlight; }
    .pb123a[aria-pressed="true"] .pb123i-f { fill: Highlight; }
}

/* Localized card titles grow at word boundaries, with fallback for long unbroken strings. */
html[data-pb-qa-26="1"] .pb123c-title,
html[data-pb-qa-26="1"] .pb123c-link {
    word-break: normal; overflow-wrap: anywhere; white-space: normal;
}
html[data-pb-qa-26="1"] .pb123c-link {
    display: block; -webkit-line-clamp: unset; overflow: visible;
}

.pb123c-rights { margin: 0 0 4px; color: var(--pb-color-text-muted); font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
a.pb123c-author { min-inline-size: 48px; }
