/* ============================================================================
   Demo-only styles, paired with app-demos.jsx. Moved out of index.html so the
   main file stays lean. Shared classes the real app also uses (cmp-, pos-demo-,
   cad-, ced-, cta-, meter, cart-empty) deliberately stay in index.html.
   ============================================================================ */

/* Wheel-spin demo (#/wheel-spin-demo) — continuous spin candidates to pick
     a shape whose rotation actually tracks the tire before wiring the trigger. */
  .ws-stage { height: 150px; display: flex; align-items: center; justify-content: center; }

.ws-art { height: 120px; width: auto; display: block; }

.ws-art.tilt { transform: perspective(520px) rotateY(-24deg) scaleX(1.08); transform-origin: center; }

.ws-spin-tire { transform-box: view-box; transform-origin: 142px 135px; animation: wsSpin 4s linear infinite; }

.ws-spin-circle { transform-box: view-box; transform-origin: 100px 100px; animation: wsSpin 4s linear infinite; }

@keyframes wsSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .ws-spin-tire, .ws-spin-circle { animation: none; }
  }

/* Layered candidate: original casing/tread (static) + a circular wheel face
     tilted in true 3D so its rotation tracks the tire. Tune --ws-tilt (match
     the original ellipse), and the face's left/top/size to seat it in the rim. */
  .ws-layer { position: relative; width: 130px; height: 130px; margin: 0 auto; }

.ws-base2 { position: absolute; top: 50%; left: 50%; height: 124px; width: auto; transform: translate(-50%, -50%); }

.ws-face {
    position: absolute; top: 50%; left: 58%;
    height: 86px; width: 86px;
    animation: wsFaceRoll 4s linear infinite;
  }

@keyframes wsFaceRoll {
    from { transform: translate(-50%, -50%) perspective(620px) rotateY(var(--ws-tilt, 52deg)) rotate(0deg); }
    to   { transform: translate(-50%, -50%) perspective(620px) rotateY(var(--ws-tilt, 52deg)) rotate(360deg); }
  }

@media (prefers-reduced-motion: reduce) {
    .ws-face { animation: none; transform: translate(-50%, -50%) perspective(620px) rotateY(var(--ws-tilt, 52deg)); }
  }

/* .cd-cats / .cd-browse / .cd-peek (home-car-demo tiles + VS card) moved to
   index.html — they're now shared by /car (AnchoredHome) and this demo. */

/* ===== Wheel thickness refinement (#/wheel-thickness-demo) ===== */
  .wtd-head { font-size: 14px; font-weight: 600; color: var(--text); padding: 22px 16px 6px; }

.wtd-card { margin: 8px 16px 0; border: 1px solid var(--hairline); border-radius: 16px; padding: 18px 16px; background: var(--white); }

.wtd-vlabel { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; margin-bottom: 14px; }

.wtd-row { display: flex; gap: 12px; }

.wtd-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.wtd-art { height: 132px; display: flex; align-items: center; justify-content: center; }

.wtd-cap { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Category reference — the locked 2.9px treatment. */
  .wtd-cat svg { width: 88px; height: 88px; color: var(--text); }

.wtd-cat svg * { vector-effect: non-scaling-stroke; stroke-width: 2.9px; }

/* Wheel, variation 1 — pinned uniform stroke so it's a single dial-able value. */
  .wtd-wheel.v1 .h3dp-base *, .wtd-wheel.v1 .h3dp-face * { vector-effect: non-scaling-stroke; stroke-width: 2.1px; }

/* Scale the whole wheel up — keeps its line-to-gap proportions (same spacing),
     just larger, to recover the presence the thinner stroke gave away. */
  .wtd-wheel .h3d-peek-stage { transform: scale(1.2); transform-origin: center center; }

/* Query-indicator demo — #/query-demo. Side-by-side comparison of where
     and how to show "Results for {q}" on the search results page. Cards
     stack a strip of variant name + description + a mini-Discover mock
     so the placement can be felt, not just described. */
  .qid-demo { background: var(--canvas); min-height: 100vh; padding-bottom: 40px; }

.qid-demo-body { padding: 20px 16px; }

.qid-demo-title { font-size: 17px; font-weight: 600; margin: 0 0 6px; }

.qid-demo-sub {
    font-size: 12px; color: var(--muted);
    margin: 0 0 18px;
    line-height: 1.55;
  }

.qid-demo-list { display: flex; flex-direction: column; gap: 16px; }

.qid-demo-card {
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    overflow: hidden;
  }

.qid-demo-card-head {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--hairline);
  }

.qid-demo-card-name { font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }

.qid-demo-card-desc {
    font-size: 11.5px; color: var(--muted);
    margin: 0; line-height: 1.55;
  }

.qid-demo-mock { padding: 12px; background: var(--white); }

.qid-mock-carbar {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 11.5px;
  }

.qid-mock-carbar::before {
    content: ""; width: 22px; height: 16px;
    background: var(--canvas-2); border-radius: 3px; flex-shrink: 0;
  }

.qid-mock-search {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 12.5px; color: var(--muted);
    margin-bottom: 8px;
  }

.qid-mock-search.has-q { color: var(--text); }

.qid-mock-search svg { width: 14px; height: 14px; flex-shrink: 0; }

.qid-mock-chips {
    display: flex; gap: 6px;
    overflow: hidden;
    margin-bottom: 8px;
  }

.qid-mock-chip {
    padding: 5px 10px;
    background: var(--canvas-2);
    border-radius: 999px;
    font-size: 10.5px;
    white-space: nowrap;
  }

.qid-mock-chip.is-active { background: var(--text); color: var(--white); }

.qid-mock-controls {
    display: flex; gap: 6px;
    padding: 8px 0;
    border-top: 1px solid var(--hairline);
  }

.qid-mock-pill {
    padding: 5px 10px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 10.5px;
  }

.qid-mock-results {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 8px;
  }

.qid-mock-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px;
    background: var(--canvas-2);
    border-radius: 6px;
  }

.qid-mock-row::before {
    content: ""; width: 34px; height: 24px;
    background: var(--white); border-radius: 4px; flex-shrink: 0;
  }

.qid-mock-row::after {
    content: ""; flex: 1; height: 8px;
    background: var(--white); border-radius: 4px;
  }

.qid-mock-breadcrumb {
    font-size: 11px; color: var(--muted);
    margin-bottom: 8px; line-height: 1.4;
  }

.qid-mock-breadcrumb b { color: var(--text); font-weight: 600; }

/* The indicator itself — the thing being demoed. */
  .qid-indicator {
    font-size: 12.5px; color: var(--text);
    margin-bottom: 8px; line-height: 1.5;
  }

.qid-indicator b { font-weight: 600; }

.qid-indicator.in-controls {
    margin: 8px 0; padding: 6px 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
  }

/* PDP hero variants demo — #/pdp-hero-demo. Three stacked phone-shaped
     mocks compare how aggressively the product image is demoted relative
     to the title+fitment+price "trust trio." Same sample part across all
     three so only hierarchy differs. */
  .pdph-demo { background: var(--canvas); min-height: 100vh; padding-bottom: 40px; }

.pdph-demo-body { padding: 20px 16px; }

.pdph-demo-title { font-size: 17px; font-weight: 600; margin: 0 0 6px; }

.pdph-demo-sub {
    font-size: 12px; color: var(--muted);
    margin: 0 0 18px;
    line-height: 1.6;
  }

.pdph-card {
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
  }

.pdph-card-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--hairline); }

.pdph-card-name { font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }

.pdph-card-desc {
    font-size: 11.5px; color: var(--muted);
    margin: 0; line-height: 1.6;
  }

.pdph-card-desc b { color: var(--text); font-weight: 600; }

/* Phone-shaped frame inside the card */
  .pdph-frame {
    background: var(--canvas-2);
    padding: 10px 10px 14px;
  }

.pdph-frame-carbar {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    font-size: 11.5px;
    margin-bottom: 6px;
  }

.pdph-frame-carbar-chev { color: var(--muted); font-size: 14px; }

.pdph-frame-carbar-thumb {
    width: 22px; height: 16px;
    background: var(--canvas-2); border-radius: 3px;
  }

.pdph-frame-carbar-name { flex: 1; font-weight: 500; }

.pdph-frame-carbar-cart {
    width: 16px; height: 16px;
    background: var(--canvas-2); border-radius: 4px;
  }

.pdph-frame-search {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 11.5px; color: var(--muted);
    margin-bottom: 10px;
  }

.pdph-frame-search-ico {
    width: 12px; height: 12px; border-radius: 50%;
    border: 1.5px solid var(--muted);
  }

.pdph-frame-body {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    padding: 12px;
  }

/* Title block — sized to the variant (md = inside hero card, lg = standalone) */
  .pdph-title-block { margin-bottom: 10px; }

.pdph-title { margin: 0; font-weight: 600; line-height: 1.35; color: var(--text); }

.pdph-title-lg .pdph-title { font-size: 17px; }

.pdph-title-md .pdph-title { font-size: 15px; }

.pdph-oem { font-size: 11px; color: var(--muted); margin-top: 3px; }

.pdph-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.pdph-rating { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }

.pdph-rating .mono { color: var(--text); font-weight: 600; font-size: 11.5px; }

.pdph-rating-count { color: var(--muted); }

/* Fitment confirm — green strip echoing PDP's pdp-fit-strip */
  .pdph-fit {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    background: #DCFCE7; color: #166534;
    border-radius: 999px;
    font-size: 11.5px; font-weight: 500;
    margin-bottom: 10px;
  }

.pdph-fit-ico { display: inline-flex; }

.pdph-fit-ico svg { width: 12px; height: 12px; }

/* Price */
  .pdph-price-block { margin-bottom: 10px; }

.pdph-price-block.is-compact { margin-bottom: 8px; }

.pdph-price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.pdph-price { font-size: 20px; font-weight: 700; color: var(--text); }

.pdph-was { font-size: 11.5px; color: var(--muted); text-decoration: line-through; }

.pdph-off {
    font-size: 10.5px; font-weight: 600;
    color: #B91C1C; background: #FEE2E2;
    padding: 2px 6px; border-radius: 4px;
  }

.pdph-cta {
    display: block; width: 100%;
    padding: 10px;
    background: var(--text); color: var(--white);
    border: none; border-radius: 10px;
    font-size: 13.5px; font-weight: 600;
    cursor: pointer;
  }

/* Image variants — hero (large), thumb (medium framed), deferred (smaller, after a rule) */
  .pdph-img {
    background: var(--canvas-2);
    display: flex; align-items: center; justify-content: center;
    margin: 10px 0;
  }

.pdph-img svg { max-width: 60%; max-height: 60%; }

.pdph-img-hero { height: 150px; border-radius: 8px; }

.pdph-img-hero svg { max-width: 50%; max-height: 100px; }

.pdph-img-thumb {
    height: 90px; border-radius: 8px;
    border: 1px solid var(--hairline);
  }

.pdph-img-thumb svg { max-width: 45%; max-height: 60px; }

/* Mid-flow image (variant C) — sits between title/price and the
     fitment+guarantee block. Sized between hero and thumb to read as a
     visual confirmation step, not headline. */
  .pdph-img-mid {
    height: 110px; border-radius: 8px;
    border: 1px solid var(--hairline);
  }

.pdph-img-mid svg { max-width: 48%; max-height: 70px; }

/* Fitment + guarantee combined trust block (variant C). Soft-green tinted
     card with two rows — fitment confirmation and Speero match guarantee.
     Sits right before the CTA so trust crests at commit time. */
  .pdph-fitguard {
    margin: 4px 0 10px;
    border: 1px solid #BBF7D0;
    background: #F0FDF4;
    border-radius: 10px;
    padding: 10px 12px;
  }

.pdph-fitguard-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px;
    line-height: 1.4;
  }

.pdph-fitguard-row + .pdph-fitguard-row { margin-top: 6px; }

.pdph-fitguard-fit { color: #166534; font-weight: 500; }

.pdph-fitguard-guard { color: var(--text); }

.pdph-fitguard-ico { display: inline-flex; flex-shrink: 0; }

.pdph-fitguard-ico svg { width: 14px; height: 14px; }

.pdph-fitguard-fit .pdph-fitguard-ico { color: #16A34A; }

.pdph-fitguard-guard .pdph-fitguard-ico { color: #6B7280; }

/* Unified hero card (B + C) — visually grouped block */
  .pdph-herocard {
    padding: 12px;
    background: var(--canvas);
    border-radius: 10px;
    border: 1px solid var(--hairline);
  }

.pdph-herocard .pdph-title-block { margin-bottom: 8px; }

.pdph-herocard .pdph-fit { margin-bottom: 8px; }

.pdph-herocard .pdph-price-block { margin-bottom: 8px; }

/* Meter color variants demo — #/meter-demo. 5 stacked cards, each shows
     the meter at FULL state with the proposed color palette (3 colors,
     one per tier). Never red — that's the core constraint. */
  .mcd-demo { background: var(--canvas); min-height: 100vh; padding-bottom: 40px; }

.mcd-demo-body { padding: 20px 16px; }

.mcd-demo-title { font-size: 17px; font-weight: 600; margin: 0 0 6px; }

.mcd-demo-sub {
    font-size: 12px; color: var(--muted);
    margin: 0 0 18px;
    line-height: 1.6;
  }

.mcd-card {
    background: var(--white);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
  }

.mcd-card-head {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--hairline);
  }

.mcd-card-name { font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }

.mcd-card-desc {
    font-size: 11.5px; color: var(--muted);
    margin: 0; line-height: 1.6;
  }

/* Panel mimics the real PDP fitguard surroundings so the colour reads in
     the same context — canvas-2 bg, similar padding, header label above. */
  .mcd-card-panel {
    padding: 16px 18px;
    background: var(--canvas-2);
  }

.mcd-label {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
  }

.mcd-meter {
    display: flex;
    gap: 4px;
    margin-bottom: 9px;
  }

.mcd-meter-seg {
    flex: 1;
    height: 12px;
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }

.mcd-meter-labels {
    display: flex;
    gap: 4px;
  }

.mcd-meter-labels-item {
    flex: 1;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.02em;
    line-height: 1.35;
  }

/* Active = green (the destination tier when reached). */
  .mcd-meter-labels-item.is-active {
    color: #15803D;
    font-weight: 700;
  }

/* Achievement badge next to «مضمون» — small filled green circle with a
     white checkmark. Only renders at the high active position; reinforces
     that the user has reached the destination tier (the meter's color
     alone is subtle at 11px). */
  .mcd-meter-labels-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #15803D;
    color: var(--white);
    margin-inline-start: 5px;
    vertical-align: -2px;
  }

.mcd-meter-labels-badge svg { width: 8px; height: 8px; }

/* Any non-active tier (passed or future) reads as gray — only the
     current position carries color emphasis. */
  .mcd-meter-labels-item.is-passed {
    color: var(--muted);
    font-weight: 500;
  }

/* Hairline separator when a variant card stacks multiple panels (F shows
     all 3 fill states for evaluation). */
  .mcd-card-panel + .mcd-card-panel {
    border-top: 1px solid var(--hairline);
  }

/* Full N4 panel — mirrors the production PdpFitGuarantee surface so the
     stacked state walk-through reads as a real PDP block, not an abstract
     wording mock. State separators + small state label at the top of each
     section make the progression legible. */
  .mcd-state + .mcd-state {
    border-top: 1px solid var(--hairline);
  }

.mcd-state-label {
    padding: 10px 16px 0;
    background: var(--white);
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.04em;
  }

.mcd-card-panel--full { padding: 14px 18px 16px; }

/* Active label as CTA — at low/medium, the active position renders a
     tappable underlined link in place of the static tier name. Black text
     (not green) so it reads as a neutral action affordance, not as "this
     tier is the destination." Underline carries the tappability signal. */
  button.mcd-meter-labels-item {
    border: 0;
    background: transparent;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.35;
    transition: opacity 0.15s ease;
    touch-action: manipulation;
  }

.mcd-meter-labels-item.is-cta {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }

.mcd-meter-labels-item.is-cta:hover,
  .mcd-meter-labels-item.is-cta:active { opacity: 0.65; }

.mcd-body {
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--muted);
  }

.mcd-vinmask {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 12px 5px 10px;
    background: var(--white);
    border: 1px solid #BBF7D0;
    border-radius: 999px;
    font-size: 11.5px;
    color: var(--text);
  }

/* Mismatch state — VIN check returned "this part doesn't fit, but here's
     what does." Status reads honestly, inline alternative card invites the
     swap, primary CTA drives the action. No red anywhere; the X icon sits
     in a neutral gray circle, not a warning. */
  .mcd-mismatch-status {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    letter-spacing: -0.005em;
  }

.mcd-mismatch-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6B7280;
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
  }

.mcd-alt-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: var(--white);
    border: 1px solid #BBF7D0;
    border-radius: 12px;
  }

.mcd-alt-thumb {
    width: 52px;
    height: 52px;
    background: var(--canvas-2);
    border-radius: 8px;
    flex-shrink: 0;
  }

.mcd-alt-body { flex: 1; min-width: 0; }

.mcd-alt-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
  }

.mcd-alt-price {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
  }

.mcd-alt-price svg { width: 0.72em !important; height: 0.8em !important; }

.mcd-alt-note {
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #15803D;
    font-weight: 600;
  }

.mcd-action-primary {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: var(--text);
    color: var(--white);
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    touch-action: manipulation;
  }

.mcd-action-primary:hover, .mcd-action-primary:active { background: #1a1c20; }

.mcd-vinmask-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #16A34A;
    color: var(--white);
    flex-shrink: 0;
  }

.mcd-vinmask-ico svg { width: 9px; height: 9px; }

.mcd-vinmask .mono { letter-spacing: 0.04em; margin-inline-start: 4px; }
