/* Auto Upgrade – version 2 (vehicle model pages, brand pages, shop). Loaded only on those pages, on top of styles.css. */

/* ── Car selector in the hero (replaces the quick check: make → model → prices) ── */
@media (min-width: 700px) { .quickcheck.carselect .btn { grid-column: 1 / -1; } }
@media (min-width: 1000px) {
  .quickcheck.carselect { grid-template-columns: 1.3fr 1fr 1.35fr auto; }
  .quickcheck.carselect .btn { grid-column: auto; }
}
.carselect select:disabled { opacity: 0.55; cursor: not-allowed; }
.carselect-foot { grid-column: 1 / -1; margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; font-size: 0.92rem; color: var(--muted); }
.carselect-foot strong { color: var(--accent-ink); font-size: 1rem; }
.carselect-foot a { color: var(--ink); font-weight: 700; }
.carselect-car { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; }
.carselect-car[hidden] { display: none; }
.carselect-car .logo-chip { position: static; padding: 8px 12px; box-shadow: none; border: 1px solid var(--line); }
.carselect-car .logo-chip .brand-logo { height: 34px; width: 64px; }
.carselect-car .car-photo { width: 168px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; background: var(--soft); }
.carselect-logos { grid-column: 1 / -1; list-style: none; margin: 2px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px; }
.carselect-logos a { display: grid; place-items: center; width: 54px; height: 40px; border-radius: 10px; opacity: 0.72; transition: opacity 0.15s, background-color 0.15s; }
.carselect-logos a:hover, .carselect-logos a:focus-visible { opacity: 1; background: var(--soft); }
.carselect-logos .brand-logo { height: 24px; width: 44px; object-position: center; }
@media (max-width: 699px) {
  .carselect-logos { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  .carselect-logos a { width: 100%; height: 44px; }
  .carselect-logos .brand-logo { width: 42px; }
}

/* ── Finder (/shop/) ──────────────────────────────────────────────────── */
.shop-finder { max-width: 720px; margin-bottom: 36px; position: relative; }
.shop-search input { width: 100%; min-height: 56px; padding: 0 18px; font: inherit; font-size: 1.1rem; border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fff; }
.shop-search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px rgb(255 106 19 / 0.18); }
.shop-results { list-style: none; margin: 8px 0 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); max-height: 420px; overflow: auto; }
.shop-results a { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; padding: 8px 12px; border-radius: 10px; text-decoration: none; }
.shop-results .car-photo { grid-row: 1 / span 2; grid-column: 1; width: 78px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.shop-results a:hover, .shop-results a:focus-visible { background: var(--soft); }
.shop-results strong { grid-column: 2; color: var(--ink); align-self: end; }
.shop-results small { grid-column: 2; color: var(--muted); align-self: start; }
.shop-results span { grid-row: 1 / span 2; grid-column: 3; align-self: center; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
@media (max-width: 560px) { .shop-results a { grid-template-columns: 78px minmax(0, 1fr); } .shop-results span { grid-row: auto; grid-column: 2; white-space: normal; font-size: 0.9rem; } .shop-results .car-photo { grid-row: 1 / span 3; } }
.shop-results-empty { margin: 10px 0 0; color: var(--muted); }
.shop-brands-label { margin-bottom: 12px; }
.shop-brand h3 { font-size: 1.45rem; }
.shop-brand .brand-logo { height: 40px; width: 100px; margin-bottom: 10px; }
.shop-brand p { color: var(--muted); margin: 0; }
.shop-brand-parts { background: var(--soft); }

/* ── Model cards ──────────────────────────────────────────────────────── */
.shop-model { padding: 18px; }
/* photos sit absolutely inside a fixed-ratio frame, so a large photo can never widen its column */
.shop-model-img { position: relative; aspect-ratio: 3 / 2; margin: -2px -2px 14px; border-radius: 12px; background: var(--soft); overflow: hidden; }
.shop-model-img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shop-model-img > img.is-unit { object-fit: contain; }
.shop-model.is-compact { padding: 12px; }
.shop-model.is-compact .shop-model-img { margin: 0 0 10px; }
.shop-model.is-compact .logo-chip { left: 7px; top: 7px; padding: 4px 7px; }
.shop-model.is-compact .logo-chip .brand-logo { height: 18px; width: 34px; }
.shop-model h3 { margin: 0 0 2px; }
.shop-model-years { margin: 0 0 10px; color: var(--muted); font-size: 0.95rem; }
.shop-model-price { margin: auto 0 0; padding-top: 8px; color: var(--muted); }
.shop-model-price strong { color: var(--ink); font-size: 1.15rem; }
.shop-model.is-compact h3 { font-size: 1.05rem; }
.shop-tags { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.shop-tags li { padding: 2px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 0.8rem; font-weight: 650; color: var(--ink); }
.shop-noimg { display: grid; place-items: center; gap: 6px; width: 100%; height: 100%; min-height: 110px; color: var(--line-strong); background: var(--soft); border-radius: 12px; }
.shop-noimg .icon { width: 44px; height: 44px; }
.shop-noimg span { color: var(--muted); font-size: 0.85rem; font-weight: 650; }

/* ── Product page: finder for the right display ─────────────────────── */
.shop-product { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1000px) { .shop-product { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 44px; } .shop-media { position: sticky; top: calc(var(--header-h) + 20px); } }
.shop-media { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.shop-media figure { margin: 0; }
.shop-unit { position: relative; aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.shop-unit img, .shop-unit .shop-noimg { position: absolute; inset: 18px; width: calc(100% - 36px); height: calc(100% - 36px); min-height: 0; object-fit: contain; }
.shop-original { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.shop-original img { width: 150px; height: 100px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.shop-original figcaption { color: var(--muted); font-size: 0.9rem; }
.shop-options { display: grid; gap: 22px; }
.shop-step { margin: 0; padding: 0; border: 0; min-width: 0; }
.shop-step legend { padding: 0; margin-bottom: 10px; font-weight: 800; color: var(--ink); display: flex; gap: 10px; align-items: center; }
.shop-step legend .form-step { width: 26px; height: 26px; font-size: 0.85rem; }
.shop-opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.shop-opts.is-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.shop-opt { position: relative; cursor: pointer; }
.shop-opt input { position: absolute; opacity: 0; pointer-events: none; }
.shop-opt-body { display: grid; gap: 4px; height: 100%; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: #fff; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.shop-opt:hover .shop-opt-body { border-color: var(--ink); }
.shop-opt input:checked + .shop-opt-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgb(255 106 19 / 0.2); }
.shop-opt input:focus-visible + .shop-opt-body { outline: 3px solid var(--accent); outline-offset: 2px; }
.shop-opt-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; background: var(--soft); margin-bottom: 4px; }
.shop-opt-name { font-weight: 800; color: var(--ink); line-height: 1.3; }
.shop-opt-text { color: var(--muted); font-size: 0.85rem; line-height: 1.35; }
.shop-opt-price { font-weight: 750; color: var(--accent-ink); font-size: 0.92rem; }
.shop-opt-tip { justify-self: start; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.02em; }
.shop-buy { margin-top: 26px; padding: clamp(20px, 3vw, 28px); background: #fff; border: 1.5px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); }
.shop-choice { margin: 0 0 4px; color: var(--muted); font-weight: 650; }
.shop-price { margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.shop-price strong { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.6rem); color: var(--ink); letter-spacing: -0.02em; }
.shop-price span { color: var(--muted); }
.shop-specs { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.shop-specs li, .shop-meta, .shop-note { display: flex; gap: 10px; align-items: flex-start; }
.shop-specs .icon { color: var(--ok); margin-top: 0.2em; }
.shop-meta { margin: 0 0 6px; color: var(--muted); font-size: 0.95rem; }
.shop-meta .icon, .shop-note .icon { margin-top: 0.15em; color: var(--muted); }
.shop-meta code, .shop-part-sku code, .shop-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: var(--soft); padding: 1px 6px; border-radius: 6px; color: var(--ink); }
.shop-actions { display: grid; gap: 10px; margin: 18px 0 14px; }
.shop-note { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.shop-price-note { margin: -8px 0 14px; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.shop-specs li.is-caveat { color: var(--ink); }
.shop-specs li.is-caveat .icon { color: var(--warn, #b45309); }
.shop-step-hint { margin: -4px 0 10px; color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.shop-help { margin: 14px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.shop-help summary { cursor: pointer; font-weight: 800; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.shop-help summary .icon { color: var(--accent-ink); }
.shop-help-body { margin-top: 8px; font-size: 0.95rem; line-height: 1.5; }
.shop-help-body p { margin: 0 0 8px; }
.shop-help-body ul { margin: 0 0 8px; padding-left: 1.1em; display: grid; gap: 4px; }
.js .shop-config > .shop-help { display: none; } /* the script moves it into the series step */
.shop-noscript { margin-top: 20px; color: var(--muted); font-size: 0.9rem; }
.shop-actions .btn span { font-weight: 800; }

/* ── Model page: hero photo and options ──────────────────────────────── */
.hero-unit { position: relative; display: grid; place-items: center; padding: 18px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-unit img { width: 100%; max-height: 340px; object-fit: contain; }
.model-options { align-items: stretch; }
.model-option { display: flex; flex-direction: column; gap: 6px; padding: 20px; }
.model-option h3 { margin: 0; font-size: 1.15rem; }
.model-option p { margin: 0; color: var(--muted); }
.model-option .btn { align-self: flex-start; margin-top: auto; }
.model-option-price { margin: 4px 0 10px !important; color: var(--ink) !important; }
.model-option-price strong { font-size: 1.4rem; }
.model-option.is-main { border: 1.5px solid var(--accent); box-shadow: 0 0 0 3px rgb(255 106 19 / 0.12); }
.model-option-badge { display: inline-flex; align-self: flex-start; gap: 6px; align-items: center; padding: 2px 10px; border-radius: 999px; background: #dcfce7; color: #166534 !important; font-size: 0.8rem; font-weight: 800; }
.model-option-badge .icon { width: 14px; height: 14px; }
.model-note { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--soft); color: var(--ink); }
.model-note .icon { margin-top: 0.2em; color: var(--accent-ink); flex: none; }

/* ── Accessories ─────────────────────────────────────────────────────── */
.shop-parts-note { color: var(--muted); max-width: 780px; }
.shop-group { margin: 36px 0 16px; font-size: 1.3rem; }
.shop-part { display: flex; flex-direction: column; padding: 18px; }
.shop-part-img { position: relative; aspect-ratio: 4 / 3; margin-bottom: 14px; background: #fff; border-radius: 10px; overflow: hidden; }
.shop-part-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.shop-part h3 { font-size: 1.05rem; }
.shop-part p { font-size: 0.95rem; }
.shop-part-price { margin: auto 0 4px; }
.shop-part-price strong { font-size: 1.3rem; color: var(--ink); }
.shop-part-price span { color: var(--muted); font-size: 0.85rem; }
.shop-part-sku { color: var(--muted); font-size: 0.85rem; }
.shop-part .btn { align-self: flex-start; }

/* ── Order request form ──────────────────────────────────────────────── */
.order-product { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; padding: 14px; border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: 16px; }
.order-product img, .order-product .shop-noimg { width: 120px; height: 70px; object-fit: contain; background: #fff; border-radius: 10px; min-height: 0; }
.order-product-name { margin: 0; font-weight: 800; color: var(--ink); line-height: 1.35; }
.order-product-meta { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.order-product-meta strong { color: var(--ink); }
.order-product a { font-size: 0.9rem; font-weight: 700; }
.order-product .car-photo { height: 80px; object-fit: cover; }
.order-product.has-car { grid-template-columns: 120px 120px minmax(0, 1fr); }
@media (max-width: 640px) { .order-product.has-car { grid-template-columns: repeat(2, minmax(0, 1fr)); } .order-product.has-car > img { width: 100%; } .order-product.has-car > div { grid-column: 1 / -1; } }
@media (min-width: 640px) { .choice-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
