/* shop.css — the MacBook Truth Engine. Flat, honest, fast. */

.shop-tag { color: var(--text-3); font-size: 13px; text-decoration: none; margin-left: 2px; }
.shop-tag:hover { color: var(--accent); }
.loading { padding: 80px 0; text-align: center; color: var(--text-3); }
.back { display: inline-block; margin: 22px 0 4px; color: var(--text-2); font-size: 14px; text-decoration: none; }
.back:hover { color: var(--accent); }

:root { --sev-critical: #c2122b; --sev-major: #c2410c; --sev-minor: #b07a00; --sev-info: #6b7585; --sev-clean: #128a4a; }
[data-theme=dark] { --sev-critical: #ff6b7d; --sev-major: #f08a4b; --sev-minor: #e0a33e; --sev-info: #8a93a3; --sev-clean: #3ad17e; }

/* ---- hero ---- */
.shop-hero { padding: 40px 0 26px; max-width: 880px; }
.shop-hero h1 { font-size: clamp(28px, 4.6vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.06; margin: 0 0 12px; }
.shop-hero .hl { background: linear-gradient(90deg, var(--accent), #7c5cff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.shop-hero .lede { font-size: 16.5px; color: var(--text-2); line-height: 1.55; margin: 0; }

/* ---- layout: filters + results ---- */
.browse { display: grid; grid-template-columns: 256px 1fr; gap: 26px; align-items: start; padding-bottom: 64px; }
.filters { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.filters::-webkit-scrollbar { width: 8px; } .filters::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.f-search input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; }
.f-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.f-group { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.f-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }
.f-pill { font-weight: 700; color: var(--accent); text-transform: none; letter-spacing: 0; }
.f-select { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; }
.f-range { width: 100%; accent-color: var(--accent); cursor: pointer; }
.f-checks { display: flex; flex-direction: column; gap: 7px; }
.f-checks.f-wrap { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.f-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.f-check input { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
/* cascading availability: options with no matches given the other filters */
.f-check.f-disabled { opacity: .32; cursor: not-allowed; }
.f-check.f-disabled input { cursor: not-allowed; }
.f-wrap .f-check.f-disabled { text-decoration: line-through; }
.f-wrap .f-check { gap: 5px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 9px; background: var(--surface-2); }
.f-wrap .f-check input { width: 13px; height: 13px; }
.f-hint { font-size: 11px; color: var(--text-3); margin: 2px 0 0; line-height: 1.4; }
.f-toggle { border-top: 1px solid var(--border); padding-top: 12px; font-weight: 600; color: var(--text); }
.f-clear { margin-top: 2px; padding: 9px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.f-clear:hover { border-color: var(--border-strong); color: var(--text); }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

.browse-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.count { color: var(--text); font-size: 14px; font-weight: 700; }
.browse-note { color: var(--text-3); font-size: 12px; }

/* ---- the flat offer grid ---- */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 16px; }
.sentinel { height: 1px; }
.ocard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: border-color .14s, transform .14s, box-shadow .14s; }
.ocard:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.10); }
.ocard-high { border-color: #c1121f; box-shadow: 0 0 0 1px #c1121f inset; }
.ocard-high:hover { box-shadow: 0 0 0 1px #c1121f inset, 0 12px 30px rgba(193,18,31,.22); }
.ocard-caution { border-color: color-mix(in srgb, #b45309 55%, var(--border)); }

/* loud, unmissable warning banner across the top of risky listings */
.oc-warn { display: flex; gap: 7px; align-items: flex-start; padding: 8px 11px; font-size: 11.5px; font-weight: 650; line-height: 1.32; color: #fff; }
.oc-warn-i { font-size: 13px; line-height: 1.1; flex-shrink: 0; }
.warn-high { background: #c1121f; }
.warn-caution { background: #b45309; }

.oc-img { position: relative; aspect-ratio: 4/3; background: #fff; display: flex; align-items: center; justify-content: center; }
[data-theme=dark] .oc-img { background: #f4f5f7; }
.oc-img img { width: 100%; height: 100%; object-fit: contain; padding: 14px; position: relative; z-index: 1; }
.oc-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa3b2; font-weight: 800; font-size: 18px; z-index: 0; text-align: center; padding: 0 12px; }
.oc-cond { position: absolute; top: 9px; left: 9px; z-index: 2; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,.92); color: #333; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.oc-cond.cond-new { background: #e6f5ec; color: #128a4a; }
.oc-cond.cond-refurb, .oc-cond.cond-open_box { background: #e9f0ff; color: #0052ff; }
.oc-cond.cond-used, .oc-cond.cond-renewed { background: #fbf2da; color: #9a6a00; }

.oc-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.oc-title { font-weight: 680; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.oc-specs { display: flex; flex-wrap: wrap; gap: 5px; }
.oc-specs .spec { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); }
.oc-sub { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 11px; color: var(--text-3); }
.oc-model { font-family: var(--mono, ui-monospace, monospace); color: var(--text-2); }
.oc-macos { color: var(--text-3); }

.oc-flags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 1px; }
.flag { font-size: 10.5px; font-weight: 650; padding: 3px 8px; border-radius: 7px; border: 1px solid transparent; line-height: 1.1; }
.flag.sev-critical { background: color-mix(in srgb, var(--sev-critical) 14%, transparent); color: var(--sev-critical); border-color: color-mix(in srgb, var(--sev-critical) 35%, transparent); }
.flag.sev-major { background: color-mix(in srgb, var(--sev-major) 13%, transparent); color: var(--sev-major); }
.flag.sev-minor { background: color-mix(in srgb, var(--sev-minor) 13%, transparent); color: var(--sev-minor); }
.flag.sev-info { background: var(--surface-3); color: var(--text-3); }
.flag.clean { background: color-mix(in srgb, var(--sev-clean) 12%, transparent); color: var(--sev-clean); }
.flag.more { background: var(--surface-3); color: var(--text-3); }

.oc-seller { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); margin-top: auto; }
.oc-ret { font-weight: 700; color: var(--text-2); }
.oc-name { color: var(--text-3); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-rating { font-weight: 700; margin-left: auto; }
.oc-rating.good { color: var(--sev-clean); } .oc-rating.ok { color: var(--sev-minor); } .oc-rating.low { color: var(--sev-critical); }

.oc-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--border); }
.oc-price b { font-size: 19px; font-weight: 760; letter-spacing: -.01em; }
.oc-price .oc-off { display: block; font-size: 11px; color: var(--sev-clean); font-weight: 600; }
.oc-price .oc-oos { display: block; font-size: 11px; color: var(--text-3); }
.oc-buy { font-size: 12.5px; font-weight: 650; color: var(--accent); white-space: nowrap; }
.ocard:hover .oc-buy { text-decoration: underline; }

/* ---- single product (deep links) ---- */
.truth-hero { display: grid; grid-template-columns: 280px 1fr; gap: 36px; padding: 14px 0 30px; align-items: start; }
.th-media { background: #fff; border: 1px solid var(--border); border-radius: 16px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 22px; }
.th-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.th-brand { color: var(--text-3); font-size: 14px; font-weight: 600; }
.th-info h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 780; letter-spacing: -.02em; margin: 4px 0 0; }
.th-variant { color: var(--text-3); font-weight: 500; font-size: .62em; }
.th-specrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.th-specrow .spec { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); }
.th-specrow .spec.macos { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.th-summary { margin: 18px 0 0; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 14px 16px; }
.th-summary-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 6px; }
.th-summary p { margin: 0; color: var(--text); line-height: 1.55; font-size: 14.5px; }
.th-anchors { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.anchor { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; min-width: 110px; }
.anchor span { display: block; font-size: 12px; color: var(--text-3); }
.anchor b { font-size: 22px; font-weight: 700; }

.offers { padding: 18px 0 70px; }
.offers-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 18px; }
.offers-head h2 { font-size: 19px; font-weight: 700; margin: 0; }
.offers-sub { color: var(--text-3); font-size: 13.5px; }
.offer { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.offer-risk { border-left: 4px solid var(--sev-critical); }
.of-main { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center; padding: 15px 18px; }
.of-retailer { font-weight: 680; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cond { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--surface-3); color: var(--text-2); }
.cond-new { background: #e6f5ec; color: #128a4a; }
.cond-used, .cond-renewed { background: #fbf2da; color: #9a6a00; }
.cond-refurb, .cond-open_box { background: #e9f0ff; color: #0052ff; }
.of-meta { font-size: 12.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.prov { font-size: 11px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--border); }
.prov-api { color: var(--sev-clean); border-color: var(--sev-clean); }
.of-price { text-align: right; }
.of-price b { font-size: 21px; font-weight: 750; }
.of-price span { display: block; font-size: 12px; }
.of-price .off { color: var(--sev-clean); }
.of-price .oos { color: var(--text-3); }
.of-buy { white-space: nowrap; background: var(--accent); color: var(--accent-contrast); font-weight: 620; font-size: 14px; padding: 10px 16px; border-radius: 10px; text-decoration: none; }
.of-buy:hover { background: var(--accent-hover); }
.of-faults { border-top: 1px dashed var(--border); padding: 14px 18px; background: var(--surface-2); }
.ff-head { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.of-faults ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fault { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.fault .fdot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
.sev-critical .fdot { background: var(--sev-critical); } .sev-major .fdot { background: var(--sev-major); }
.sev-minor .fdot { background: var(--sev-minor); } .sev-info .fdot { background: var(--sev-info); }
.fault b { font-size: 14px; }
.fault p { margin: 2px 0 0; color: var(--text-2); font-size: 13.3px; line-height: 1.5; }
.verified { font-size: 10.5px; font-weight: 700; color: var(--sev-clean); }
.unverified { font-size: 10.5px; font-weight: 600; color: var(--text-3); }
.of-claims { padding: 12px 18px; display: grid; gap: 10px; }
.claim { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.cl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cl-said { font-size: 13.5px; color: var(--text-2); font-style: italic; }
.cl-tag { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; background: var(--surface-3); color: var(--text-3); }
.cl-real { font-size: 13.3px; margin-top: 6px; line-height: 1.5; }

.shop-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 26px 0; color: var(--text-3); font-size: 13px; line-height: 1.6; }
.shop-footer strong { color: var(--text-2); }

@media (max-width: 880px) {
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .truth-hero { grid-template-columns: 1fr; }
  .of-main { grid-template-columns: 1fr auto; row-gap: 12px; }
  .of-buy { grid-column: 1 / -1; text-align: center; }
}
