/*
 * component-related.css — related-products section components (carousel / bought_together /
 * complete_look / compact_list / grid_minimal). apb-rx-* namespace, tokens only (no brand-tinted
 * literals), no !important. Rendered by trait-apb-component-render-related.php. Fail-open, no JS.
 */

/* shared -------------------------------------------------------------------------------------- */
.apb-rx-relc-h, .apb-rx-relb-h, .apb-rx-rell-h, .apb-rx-relr-h, .apb-rx-relg-h {
  font-family: var(--apb-rx-font-display, inherit); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 0;
}
.apb-rx-relc-ey, .apb-rx-relb-ey, .apb-rx-rell-ey {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--apb-rx-accent-text, var(--apb-rx-brand));
}
.apb-rx-rel-add {
  flex: none; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  border: 1px solid var(--apb-rx-line); background: var(--apb-rx-surface); color: var(--apb-rx-ink);
  border-radius: calc(var(--apb-rx-radius) * .6); width: 34px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer;
  transition: border-color var(--apb-rx-t-fast, .2s), color var(--apb-rx-t-fast, .2s);
}
.apb-rx-rel-add:hover { border-color: var(--apb-rx-brand); color: var(--apb-rx-accent-text, var(--apb-rx-brand)); }
.apb-rx-rel-more, .apb-rx-rell-more { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--apb-rx-accent-text, var(--apb-rx-brand)); white-space: nowrap; }

/* 1 — carousel ------------------------------------------------------------------------------- */
.apb-rx-relc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.apb-rx-relc-h { font-size: clamp(24px, 3.5vw, 34px); margin-top: 8px; }
.apb-rx-relc-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; margin-top: 24px; padding-bottom: 4px; scrollbar-width: none; }
.apb-rx-relc-track::-webkit-scrollbar { display: none; }
.apb-rx-relc-card { flex: 0 0 240px; scroll-snap-align: start; }
.apb-rx-relc-media { position: relative; border-radius: var(--apb-rx-radius); overflow: hidden; aspect-ratio: 1/1; background: var(--apb-rx-soft); }
.apb-rx-relc-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apb-rx-relc-badge { position: absolute; top: 10px; left: 10px; background: var(--apb-rx-brand); color: var(--apb-rx-accent-contrast, #fff); font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.apb-rx-relc-cat { font-size: 12px; color: var(--apb-rx-dim); margin-top: 12px; }
.apb-rx-relc-name { font-weight: 600; font-size: 15px; margin-top: 2px; }
.apb-rx-relc-stars { color: var(--apb-rx-accent-text, var(--apb-rx-brand)); letter-spacing: 1px; font-size: 13px; margin-top: 4px; }
.apb-rx-relc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 10px; }
.apb-rx-relc-price { font-weight: 700; }
.apb-rx-relc-price s { color: var(--apb-rx-dim); font-weight: 400; margin-right: 6px; }

/* 2 — bought together ------------------------------------------------------------------------ */
.apb-rx-relb-wrap { max-width: 960px; margin: 0 auto; }
.apb-rx-relb-h { font-size: clamp(24px, 3.5vw, 34px); margin-top: 8px; }
.apb-rx-relb-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin: 28px 0 0; }
.apb-rx-relb-item { flex: 1; min-width: 140px; text-align: center; }
.apb-rx-relb-media { border-radius: var(--apb-rx-radius); overflow: hidden; aspect-ratio: 1/1; background: var(--apb-rx-soft); }
.apb-rx-relb-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apb-rx-relb-name { font-weight: 600; font-size: 14px; margin-top: 10px; }
.apb-rx-relb-price { font-size: 14px; color: var(--apb-rx-dim); }
.apb-rx-relb-plus { align-self: center; font-size: 24px; font-weight: 300; color: var(--apb-rx-dim); }
.apb-rx-relb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 0; background: var(--apb-rx-surface); border: 1px solid var(--apb-rx-line); border-radius: var(--apb-rx-radius); padding: 18px 22px; }
.apb-rx-relb-tnote { font-size: 13px; color: var(--apb-rx-dim); }
.apb-rx-relb-total { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.apb-rx-relb-total b { font-family: var(--apb-rx-font-display, inherit); font-weight: 800; font-size: 26px; }
.apb-rx-relb-total s { font-size: 15px; color: var(--apb-rx-dim); }
.apb-rx-relb-save { font-size: 13px; font-weight: 600; color: var(--apb-rx-accent-text, var(--apb-rx-brand)); }

/* 3 — complete the look ---------------------------------------------------------------------- */
.apb-rx-rell-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); align-items: stretch; }
.apb-rx-rell-hero { position: relative; border-radius: calc(var(--apb-rx-radius) * 1.4); overflow: hidden; min-height: 420px; background: var(--apb-rx-soft); }
.apb-rx-rell-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.apb-rx-rell-hbadge { position: absolute; left: 20px; bottom: 20px; background: var(--apb-rx-surface); color: var(--apb-rx-ink); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 8px 14px; border-radius: 999px; }
.apb-rx-rell-h { font-size: clamp(24px, 3.4vw, 34px); margin: 8px 0 16px; }
.apb-rx-rell-rows { display: flex; flex-direction: column; gap: 12px; }
.apb-rx-rell-row { display: flex; align-items: center; gap: 14px; border: 1px solid var(--apb-rx-line); border-radius: var(--apb-rx-radius); padding: 12px; }
.apb-rx-rell-thumb { flex: none; width: 64px; height: 64px; border-radius: calc(var(--apb-rx-radius) * .7); overflow: hidden; background: var(--apb-rx-soft); }
.apb-rx-rell-thumb img { width: 100%; height: 100%; object-fit: cover; }
.apb-rx-rell-info { flex: 1; min-width: 0; }
.apb-rx-rell-name { font-weight: 600; font-size: 15px; }
.apb-rx-rell-meta { font-size: 13px; color: var(--apb-rx-dim); }
.apb-rx-rell-right { text-align: right; }
.apb-rx-rell-price { font-weight: 700; }
.apb-rx-rell-add { display: inline-block; margin-top: 6px; text-decoration: none; border: 1px solid var(--apb-rx-line); background: var(--apb-rx-surface); color: var(--apb-rx-ink); border-radius: 999px; font-size: 12px; font-weight: 600; padding: 5px 12px; cursor: pointer; }
.apb-rx-rell-add:hover { border-color: var(--apb-rx-brand); color: var(--apb-rx-accent-text, var(--apb-rx-brand)); }
.apb-rx-rell-more { display: inline-block; margin-top: 18px; }

/* 4 — compact list --------------------------------------------------------------------------- */
.apb-rx-relr-wrap { max-width: 460px; margin: 0 auto; }
.apb-rx-relr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.apb-rx-relr-h { font-size: 20px; letter-spacing: -.01em; }
.apb-rx-relr-rows { display: flex; flex-direction: column; }
.apb-rx-relr-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--apb-rx-line); }
.apb-rx-relr-row:last-child { border-bottom: 0; }
.apb-rx-relr-thumb { flex: none; width: 56px; height: 56px; border-radius: calc(var(--apb-rx-radius) * .7); overflow: hidden; background: var(--apb-rx-soft); }
.apb-rx-relr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.apb-rx-relr-info { flex: 1; min-width: 0; }
.apb-rx-relr-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apb-rx-relr-stars { color: var(--apb-rx-accent-text, var(--apb-rx-brand)); font-size: 12px; letter-spacing: 1px; }
.apb-rx-relr-price { font-weight: 700; font-size: 14px; white-space: nowrap; }
.apb-rx-relr .apb-rx-rel-add { width: 32px; height: 32px; font-size: 16px; }

/* 5 — minimal grid --------------------------------------------------------------------------- */
.apb-rx-relg-h { font-size: clamp(24px, 3.5vw, 34px); text-align: center; margin: 0 0 24px; }
.apb-rx-relg-grid { display: grid; grid-template-columns: repeat(var(--apb-rx-cols, 4), 1fr); gap: 20px; }
.apb-rx-relg-card { text-align: center; }
.apb-rx-relg-media { position: relative; border-radius: var(--apb-rx-radius); overflow: hidden; aspect-ratio: 3/4; background: var(--apb-rx-soft); }
.apb-rx-relg-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apb-rx-relg-qa { position: absolute; left: 12px; right: 12px; bottom: 12px; opacity: 0; transform: translateY(8px); transition: opacity var(--apb-rx-t, .25s), transform var(--apb-rx-t, .25s); }
.apb-rx-relg-qa a { display: block; text-align: center; text-decoration: none; background: var(--apb-rx-surface); color: var(--apb-rx-ink); font-weight: 600; font-size: 13px; padding: 11px; border-radius: calc(var(--apb-rx-radius) * .7); box-shadow: var(--apb-rx-shadow-1, 0 6px 20px rgba(0,0,0,.12)); }
.apb-rx-relg-card:hover .apb-rx-relg-qa, .apb-rx-relg-card:focus-within .apb-rx-relg-qa { opacity: 1; transform: translateY(0); }
.apb-rx-relg-name { font-weight: 600; font-size: 14px; margin-top: 12px; }
.apb-rx-relg-price { font-size: 14px; color: var(--apb-rx-dim); margin-top: 2px; }

/* responsive --------------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .apb-rx-rell-grid { grid-template-columns: 1fr; }
  .apb-rx-relg-grid { grid-template-columns: repeat(2, 1fr); }
  .apb-rx-relg-qa { opacity: 1; transform: none; }
}
