/*
 * Ring Used Parts design system (redesign phase 1): tokens, type, header, footer.
 * Loaded after bootstrap.min.css. Legacy Content/StyleSheet1.css was removed in 15.7; some !important rules below
 * were needed to beat it and can be simplified later. Mockup: _design/mockup/index.html.
 */

/* ---------- Fonts (self-hosted, SIL OFL: lib/fonts/OFL.txt) ---------- */
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("../lib/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("../lib/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("../lib/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-style: normal; font-display: swap; src: url("../lib/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url("../lib/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url("../lib/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
    --rp-yellow: #FFCD11;
    --rp-black: #000000;
    --rp-steel: #4A5057;
    --rp-concrete: #EEEEEC;
    --rp-white: #FFFFFF;
    --rp-signal: #C8102E;
    --rp-line: #D6D6D2;
    --rp-ink: #1C1C1C;
    --rp-link: #1D4F7C;
    --rp-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --rp-body: "Barlow", "Segoe UI", Arial, sans-serif;
    --rp-wrap: 1240px;

    /* Bootstrap 5 variables mapped to the brand */
    --bs-body-font-family: var(--rp-body);
    --bs-body-color: var(--rp-ink);
    --bs-link-color: var(--rp-link);
    --bs-link-color-rgb: 29, 79, 124;
    --bs-link-hover-color: #143a5c;
    --bs-border-color: var(--rp-line);
    --bs-border-radius: 4px;
    --bs-primary: var(--rp-black);
    --bs-primary-rgb: 0, 0, 0;
}

/* ---------- Base (overrides legacy html/body/#bodyDiv globals) ---------- */
/* In-page links (/#partGroups, /#how) land 16px below the sticky header. Values = .site-header height + 16 at each
   breakpoint (122 / 177 / 169px, measured 2026-09-24); update them if the header layout changes. CSS only, so the
   browser jumps once (a script that corrected the offset after load caused a visible second scroll). */
html { background: var(--rp-white); scroll-padding-top: 138px; }
@media (max-width: 980px) { html { scroll-padding-top: 193px; } }
@media (max-width: 560px) { html { scroll-padding-top: 185px; } }
body { font: 400 1rem/1.55 var(--rp-body); color: var(--rp-ink); background: var(--rp-white); margin: 0; }
h1, h2, h3, .h1, .h2, .h3 { font-family: var(--rp-display); font-weight: 700; line-height: 1.08; color: var(--rp-ink); }
h4, h5, h6, .h4, .h5, .h6 { font-family: var(--rp-display); font-weight: 600; line-height: 1.15; }
.rp-wrap { max-width: var(--rp-wrap); margin: 0 auto; padding: 0 24px; }
#bodyDiv { max-width: var(--rp-wrap) !important; margin: 0 auto; background: transparent; padding: 24px 24px 48px; }
.pn { font-family: var(--rp-display); font-weight: 600; letter-spacing: .01em; font-variant-numeric: tabular-nums; }

/* Buttons: legacy StyleSheet1 forces every button/submit yellow with !important. New components opt out via .rp-btn. */
.rp-btn { white-space: nowrap; font: 600 1rem var(--rp-body) !important; border-radius: 4px !important; padding: 9px 14px !important; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none !important; border: 1px solid var(--rp-black) !important; background-color: var(--rp-white) !important; color: var(--rp-black) !important; box-shadow: none !important; }
.rp-btn:hover { background-color: #F4F4F2 !important; }
.rp-btn-primary { background-color: var(--rp-yellow) !important; border-color: var(--rp-yellow) !important; color: var(--rp-black) !important; }
.rp-btn-primary:hover { background-color: #F2C200 !important; }
.rp-btn-dark { background-color: var(--rp-black) !important; color: var(--rp-white) !important; }

/* ---------- Header ---------- */
.site-header { background: var(--rp-black); color: var(--rp-white); position: sticky; top: 0; z-index: 1020; }
.site-header .rp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; min-height: 76px; }
.site-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.site-brand img.rup { height: 54px; width: auto; }
.site-brand img.dealer { height: 30px; width: auto; border-left: 1px solid #444; padding-left: 14px; box-sizing: content-box; }
.site-search { display: flex; max-width: 640px; width: 100%; justify-self: center; margin: 0; }
.site-search input { flex: 1; min-width: 0; font: 1rem var(--rp-body); padding: 11px 14px; border: 0; border-radius: 4px 0 0 4px; color: var(--rp-ink) !important; }
.site-search button { font: 600 1rem var(--rp-body) !important; border: 0 !important; background-color: var(--rp-yellow) !important; color: var(--rp-black) !important; padding: 0 18px !important; border-radius: 0 4px 4px 0; box-shadow: none !important; }
.site-actions { display: flex; gap: 18px; align-items: center; }
.site-actions .phone { color: var(--rp-white); text-decoration: none; font-weight: 600; white-space: nowrap; }
.site-actions .phone:hover { color: var(--rp-yellow); }
.order-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--rp-white); border: 1px solid #555; border-radius: 4px; padding: 8px 14px; text-decoration: none; white-space: nowrap; }
.order-link:hover { border-color: var(--rp-yellow); color: var(--rp-white); }
.order-link .count { background: var(--rp-yellow); color: var(--rp-black); border-radius: 999px; min-width: 24px; height: 24px; padding: 0 6px; display: inline-grid; place-items: center; font-size: .875rem; }
.order-link .count:empty::before { content: "0"; }

.site-nav { background: #161616; border-top: 1px solid #262626; }
/* .site-menu is a Bootstrap .collapse: shown inline above 560px (see Responsive), a drop-down panel behind .site-menu-toggle below. */
.site-nav .rp-wrap { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; }
.site-menu { align-items: center; gap: 8px; flex: 1; min-width: 0; }
@media (min-width: 561px) { .site-nav .site-menu { display: flex; } }
.site-menu-toggle { display: none; align-items: center; gap: 8px; background: transparent !important; color: #DDD !important; border: 0 !important; font: 500 1rem var(--rp-body) !important; padding: 10px 0 !important; box-shadow: none !important; }
.site-menu-toggle:hover, .site-menu-toggle[aria-expanded="true"] { color: var(--rp-yellow) !important; }
/* Direct child only: a plain ".site-nav ul" also matched the Staff tools .dropdown-menu and beat Bootstrap's display:none,
   leaving the menu permanently open as a row that overflowed the page (horizontal scroll). */
.site-menu > ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.site-menu > ul::-webkit-scrollbar { display: none; }
.site-menu > ul a, .site-nav a.staff, .site-nav .dropdown-toggle { display: block; color: #DDD; text-decoration: none; padding: 10px 14px; white-space: nowrap; font-weight: 500; }
.site-menu > ul a:hover, .site-menu > ul a[aria-current="page"], .site-nav a.staff:hover { color: var(--rp-yellow); }
.site-nav a.specials { color: #FF9A9A; }
.site-nav .staff { margin-left: auto; flex-shrink: 0; }
.site-nav .staff .dropdown-toggle { background: transparent !important; color: #DDD !important; border: 0 !important; font: 500 1rem var(--rp-body) !important; padding: 10px 14px !important; box-shadow: none !important; }
/* max-height set by a11y.js on open: the header is sticky, so page scroll cannot reach items below the viewport. */
.site-nav .dropdown-menu { --bs-dropdown-link-active-bg: var(--rp-black); border-radius: 4px; overflow-y: auto; overscroll-behavior: contain; }
.site-nav .dropdown-menu a { color: var(--rp-ink); padding: 6px 16px; }
.site-nav .dropdown-menu a:hover { color: var(--rp-black); background: #FFF6CC; }

/* ---------- Footer ---------- */
.site-footer { background: var(--rp-black); color: #CCC; padding: 44px 0 28px; font-size: .875rem; border: 0; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font-family: var(--rp-display); color: var(--rp-white); font-size: 1.25rem; margin: 0 0 10px; font-weight: 600; }
.site-footer a { color: #CCC; }
.site-footer a:hover { color: var(--rp-yellow); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer .dealer { height: 34px; width: auto; margin-bottom: 14px; }
.site-footer .legal { border-top: 1px solid #262626; margin-top: 32px; padding-top: 18px; display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- Shared helpers (were Bootstrap 3 / legacy StyleSheet1, removed in 15.7) ---------- */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
legend { float: none; font-size: 1.25rem; font-family: var(--rp-display); font-weight: 600; }
a:not([href]) { cursor: pointer; }
.rp-muted { color: var(--rp-steel); }
.input-validation-error { border-color: var(--rp-signal) !important; }
.field-validation-error { display: block; color: var(--rp-signal); font-size: .875rem; font-weight: 500; margin-top: 4px; }
.validation-summary-valid { display: none; }
.text-danger { color: var(--rp-signal) !important; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--rp-black); }
/* Loading overlay: rup.js / hist.js add .loading to .parts-container while AJAX runs. */
.parts-container { position: relative; }
.modalLoading { display: none; }
/* Fades in after 300ms so quick background calls (cart count, order list, pager) do not flash it. */
.parts-container.loading .modalLoading { display: block; position: absolute; inset: 0; min-height: 120px; z-index: 5; background: rgba(255, 255, 255, .75); opacity: 0; animation: rp-fade-in .2s ease .3s forwards; }
@keyframes rp-fade-in { to { opacity: 1; } }
.parts-container.loading .modalLoading::after { content: ""; position: absolute; left: 50%; top: 60px; width: 36px; height: 36px; margin-left: -18px; border: 4px solid var(--rp-line); border-top-color: var(--rp-black); border-radius: 50%; animation: rp-spin .8s linear infinite; }
@keyframes rp-spin { to { transform: rotate(360deg); } }
/* rup.js imagePreview() hover popup */
#preview { position: absolute; z-index: 1100; padding: 4px; background: var(--rp-white); border: 1px solid var(--rp-line); box-shadow: 0 8px 24px rgba(0,0,0,.2); display: none; }
#preview img { max-width: 320px; display: block; }
.ui-autocomplete-loading { background: url("../img/ajax-loader-sm.gif") no-repeat right 10px center !important; }
/* Plain content pages (cookie policy, accessibility, opt-out) */
.rp-prose { max-width: 75ch; padding: 8px 0 24px; }
.rp-prose h1 { font-size: 2.441rem; margin: 0 0 12px; }
.rp-prose h2 { font-size: 1.5625rem; margin: 28px 0 8px; }
.rp-prose table { margin: 8px 0 16px; }
.rp-inline-form { margin-top: 20px; }
.rp-inline-row { display: flex; gap: 8px; max-width: 520px; }
.rp-inline-form .form-control { border: 1px solid #8A8F94; border-radius: 4px; padding: 10px 12px; }
.rp-inline-form .form-label { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .site-header .rp-head { grid-template-columns: auto auto; }
    .site-search { grid-column: 1 / -1; order: 3; max-width: none; padding-bottom: 12px; }
    .site-actions .phone { display: none; }
    .site-footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .site-brand img.dealer { display: none; }
    /* Nav links + Staff sign in stack in one drop-down panel on its own row under the bar; Staff tools (signed in)
       is a separate drop-down at the right of the bar. Panel capped to the viewport so it scrolls inside the sticky header. */
    .site-menu-toggle { display: inline-flex; }
    .site-menu { order: 3; flex-basis: 100%; max-height: calc(100vh - 170px); overflow-y: auto; padding-bottom: 8px; }
    .site-menu > ul { flex-direction: column; gap: 0; overflow-x: visible; border-top: 1px solid #262626; }
    .site-menu > ul a, .site-nav a.staff { padding: 12px 0; width: 100%; border-bottom: 1px solid #262626; }
    .site-nav a.staff { margin-left: 0; }
    .site-nav .staff .dropdown-toggle { padding: 10px 0 !important; }
    .site-brand img.rup { height: 46px; }
    .rp-wrap, #bodyDiv { padding-left: 16px; padding-right: 16px; }
    .site-footer .cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Home (phase 2) ---------- */
.home-hero { position: relative; min-height: 560px; display: flex; align-items: flex-end; color: var(--rp-white); background: #222 url("../img/Hero/1.jpg") center / cover no-repeat; } /* image set per request in Views/Home/Index.cshtml */
.home-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.05) 80%); }
.home-hero .rp-wrap { position: relative; width: 100%; padding-top: 72px; padding-bottom: 64px; }
.home-hero h1 { color: var(--rp-white); font-size: clamp(2.4rem, 5.2vw, 3.815rem); line-height: 1.02; margin: 0 0 14px; max-width: 20ch; }
.home-hero .lede { font-size: 1.25rem; max-width: 46ch; margin: 0 0 28px; color: #EEE; }
.big-search { background: var(--rp-white); color: var(--rp-ink); border-radius: 6px; padding: 8px; max-width: 720px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.big-search .modes { display: flex; gap: 4px; padding: 4px 4px 8px; margin: 0; border: 0; }
.big-search .modes label { cursor: pointer; position: relative; }
.big-search .modes input { position: absolute; opacity: 0; }
.big-search .modes span { display: inline-block; padding: 6px 12px; border-radius: 4px; font-weight: 600; font-size: .875rem; color: var(--rp-steel); }
.big-search .modes input:checked + span { background: var(--rp-black); color: var(--rp-white); }
.big-search .modes input:focus-visible + span { outline: 3px solid var(--rp-link); outline-offset: 2px; }
.big-search .row-search { display: flex; gap: 8px; }
.big-search input[type="search"] { flex: 1; min-width: 0; font: 500 1.5625rem var(--rp-display); letter-spacing: .02em; padding: 14px 16px; border: 2px solid var(--rp-line); border-radius: 4px; color: var(--rp-ink); }
.big-search input[type="search"]:focus { border-color: var(--rp-black); outline: none; }
.big-search button { font: 700 1.25rem var(--rp-display) !important; letter-spacing: .02em; background-color: var(--rp-yellow) !important; color: var(--rp-black) !important; border: 0 !important; border-radius: 4px; padding: 0 28px !important; box-shadow: none !important; }
.popular { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #DDD; }
.popular a { color: var(--rp-white); border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 3px 12px; text-decoration: none; font-weight: 500; }
.popular a:hover { background: var(--rp-yellow); color: var(--rp-black); border-color: var(--rp-yellow); }
.home-facts { background: var(--rp-yellow); }
.home-facts ul { list-style: none; margin: 0; padding: 18px 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.home-facts li { font-weight: 500; color: var(--rp-black); }
.home-facts strong { display: block; font-family: var(--rp-display); font-size: 1.5625rem; font-weight: 700; line-height: 1.1; }
.home-band { padding: 40px 0 24px; }
.home-band.alt { background: var(--rp-concrete); margin: 24px -24px 0; padding: 40px 24px; border-radius: 4px; }
.home-h2 { font-size: 2.441rem; margin: 0 0 8px; }
.home-lede { color: var(--rp-steel); margin: 0 0 28px; max-width: 60ch; }
.home-split { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; align-items: start; }
.directory { columns: 2; column-gap: 40px; margin: 0; padding: 0; list-style: none; }
.directory li { break-inside: avoid; border-bottom: 1px solid var(--rp-line); }
.directory a { display: flex !important; justify-content: space-between; gap: 12px; padding: 11px 2px; text-decoration: none; color: var(--rp-ink); font-weight: 500; width: 100%; }
.directory .n { margin-left: auto; }
.directory a:hover { color: var(--rp-black); background: #FFF6CC; }
.directory a.special { color: var(--rp-signal); font-weight: 600; }
.directory .n { color: var(--rp-steel); font-variant-numeric: tabular-nums; }
.directory-note { margin-top: 18px; color: var(--rp-steel); font-size: .875rem; }
.ways { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 28px; }
.way { border: 1px solid var(--rp-line); border-radius: 4px; padding: 16px 18px; background: var(--rp-white); }
.way.buy-now { border-color: var(--rp-black); box-shadow: inset 4px 0 0 var(--rp-yellow); }
.way h3, .steps h3 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 600; }
.way p, .steps p { margin: 0; color: var(--rp-steel); font-size: .875rem; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.steps li::before { content: counter(step); width: 44px; height: 44px; display: grid; place-items: center; background: var(--rp-black); color: var(--rp-yellow); font: 700 1.25rem var(--rp-display); border-radius: 4px; }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.part-card { background: var(--rp-white); text-decoration: none; color: var(--rp-ink); display: flex; flex-direction: column; border: 1px solid var(--rp-line); border-radius: 4px; overflow: hidden; }
.part-card:hover { border-color: var(--rp-black); color: var(--rp-ink); }
.part-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--rp-concrete); }
.part-card .body { padding: 12px 14px 14px; display: grid; gap: 2px; }
.part-card .pn { font-size: 1.25rem; }
.part-card .meta { color: var(--rp-steel); font-size: .875rem; }
.part-card .price { font-weight: 600; margin-top: 6px; }
.home-about { padding: 40px 0 8px; max-width: 75ch; }
.home-about p { color: var(--rp-steel); }
@media (max-width: 980px) {
    .home-split { grid-template-columns: 1fr; gap: 40px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .home-facts ul { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .home-hero { min-height: 520px; }
    .big-search .row-search { flex-direction: column; }
    .big-search button { padding: 14px !important; }
    .directory { columns: 1; }
    .ways { grid-template-columns: 1fr; }
    .card-grid { grid-template-columns: 1fr; }
    .home-band.alt { margin-left: -16px; margin-right: -16px; }
}

/* ---------- Results pages (phase 3): Search, ByPartGroup, ByModel, Specials ---------- */
.rp-page-head { margin: 0 0 18px; }
.rp-crumbs { font-size: .875rem; color: var(--rp-steel); margin-bottom: 6px; }
.rp-crumbs a { color: var(--rp-steel); }
.rp-page-head h1 { font-size: 2.441rem; margin: 0; }
.rp-count { color: var(--rp-steel); margin: 4px 0 0; }
.rp-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; padding: 14px 0; border-top: 1px solid var(--rp-line); border-bottom: 1px solid var(--rp-line); margin-bottom: 4px; }
.rp-toolbar label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: 4px; }
.rp-filter { flex: 1 1 280px; max-width: 420px; }
.rp-filter-box { position: relative; display: block; }
.rp-filter-box .form-control { padding-right: 36px; }
.rp-filter-box .fa-times-circle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--rp-steel); cursor: pointer; }
.rp-sort .form-select { min-width: 220px; }
.rp-toolbar .selectAll { margin-left: auto; }

/* Rows (legacy .parts-row / .parts-container rules neutralised) */
.parts-container.rp-list { display: block !important; border: 0 !important; width: 100% !important; background: none !important; margin: 0; }
.parts-row.rp-row { display: grid !important; grid-template-columns: 112px minmax(0, 1.6fr) minmax(0, 1fr) 120px 170px; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rp-line); background: none !important; width: auto !important; font-size: 1rem; }
.parts-row.rp-row:nth-child(even) { background: none !important; }
.rp-thumb { display: block; width: 112px; aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden; background: var(--rp-concrete); }
.rp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-nophoto { display: grid; place-items: center; height: 100%; color: var(--rp-steel); font-size: .8125rem; text-align: center; padding: 6px; }
.rp-pn { font-size: 1.25rem; color: var(--rp-ink); text-decoration: none; }
.rp-pn:hover { text-decoration: underline; }
.rp-desc { color: var(--rp-steel); font-size: .875rem; }
.rp-special { display: inline-block; margin-top: 4px; background: var(--rp-signal); color: #fff; font-weight: 600; font-size: .75rem; padding: 1px 8px; border-radius: 3px; }
.rp-fits { font-size: .875rem; display: grid; }
.rp-fits a { color: var(--rp-ink); text-decoration: none; }
.rp-fits a:hover { text-decoration: underline; }
.rp-fits strong { font-weight: 600; font-size: 1rem; }
.rp-price { font-weight: 600; font-size: 1.25rem; text-align: right; }
.rp-stock { display: block; font-weight: 400; font-size: .875rem; color: var(--rp-steel); }
.rp-actions { display: grid; gap: 6px; }
.rp-actions .rp-btn { font-size: .875rem !important; padding: 7px 10px !important; }
.rp-ext { flex: none; }
.rp-add { position: relative; display: block; margin: 0; cursor: pointer; }
.rp-add input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rp-add > span { display: flex; justify-content: center; align-items: center; gap: 6px; border: 1px solid var(--rp-black); border-radius: 4px; padding: 6px 10px; font-weight: 600; font-size: .875rem; background: var(--rp-white); }
.rp-add input:checked + span { background: var(--rp-black); color: var(--rp-yellow); }
.rp-add input:checked + span::before { content: "\2713"; }
.rp-add input:focus-visible + span { outline: 3px solid var(--rp-link); outline-offset: 2px; }
.rp-empty { padding: 32px 0; color: var(--rp-steel); text-align: left !important; }

/* Quote bar: sticks to the bottom of the viewport once something is selected */
.parts-footer.rp-quote-bar { display: flex !important; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; margin: 0; border-top: 1px solid var(--rp-line); background: var(--rp-white); width: auto !important; }
.parts-footer.rp-quote-bar.has-selection { position: sticky; bottom: 0; z-index: 5; padding: 12px 16px; background: #FFF6CC; border: 1px solid var(--rp-yellow); border-radius: 4px; box-shadow: 0 -6px 18px rgba(0,0,0,.08); }
.rp-quote-bar [data-quote-submit]:disabled { opacity: .5; cursor: not-allowed; }

/* Pager (server-rendered for specials, /AJAX/RUP.asmx/makePager elsewhere) */
.rp-pager { margin: 20px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rp-pager p { width: 100%; margin: 8px 0 0; color: var(--rp-steel); }
.rp-pager a.pager, .rp-pager span.pager, .rp-pager b a.pager { display: inline-block; min-width: 40px; text-align: center; padding: 7px 10px; border: 1px solid var(--rp-line); border-radius: 4px; text-decoration: none; color: var(--rp-ink); margin: 0; }
.rp-pager b a.pager, .rp-pager .pager.current { background: var(--rp-black); color: var(--rp-white) !important; border-color: var(--rp-black); }
.rp-pager span { display: inline-block; }
.rp-pager #txtPager { width: 60px !important; padding: 6px 8px; border: 1px solid var(--rp-line); border-radius: 4px; margin: 0 4px; }

/* Models directory */
.rp-models { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 16px; }
.rp-models .dvOneModel { margin: 0 !important; width: auto !important; float: none !important; background: none !important; padding: 0 !important; }
.rp-models .dvOneModel a { display: block; padding: 8px 10px; border: 1px solid var(--rp-line); border-radius: 4px; text-decoration: none; color: var(--rp-ink) !important; font-family: var(--rp-display); font-weight: 600; font-size: 1.0625rem; background: var(--rp-white) !important; text-align: center; }
.rp-models .dvOneModel a:hover { border-color: var(--rp-black); background: #FFF6CC !important; }
.rp-loading { color: var(--rp-steel); padding: 24px 0; }

@media (max-width: 980px) {
    .parts-row.rp-row { grid-template-columns: 96px minmax(0, 1fr) auto; }
    .rp-thumb { width: 96px; grid-row: span 2; }
    .rp-fits { grid-column: 2; }
    .rp-price { grid-column: 3; grid-row: 1; }
    .rp-actions { grid-column: 3; grid-row: 2; }
}
@media (max-width: 560px) {
    .parts-row.rp-row { grid-template-columns: 88px minmax(0, 1fr); gap: 6px 14px; align-items: start; }
    .rp-thumb { width: 88px; grid-row: span 3; }
    .rp-fits, .rp-price, .rp-actions { grid-column: 2; grid-row: auto; text-align: left; }
    .rp-fits { display: flex; gap: 8px; flex-wrap: wrap; }
    .rp-price { font-size: 1rem; }
    .rp-stock { display: inline; margin-left: 6px; }
    .rp-actions { grid-template-columns: 1fr 1fr; }
    .rp-toolbar .selectAll { margin-left: 0; }
    .rp-page-head h1 { font-size: 1.953rem; }
}
.rp-toolbar .form-control, .rp-toolbar .form-select { border: 1px solid var(--rp-line) !important; border-radius: 4px !important; box-shadow: none; height: auto; padding: 8px 12px; font: 1rem var(--rp-body); }
.rp-toolbar .form-control:focus, .rp-toolbar .form-select:focus { border-color: var(--rp-black) !important; }
.rp-thumb, .rp-thumb:hover { text-decoration: none !important; }
/* legacy StyleSheet1 boxes each .parts-row in yellow on small screens */
.parts-row.rp-row { border: 0 !important; border-bottom: 1px solid var(--rp-line) !important; border-radius: 0 !important; margin: 0 !important; box-shadow: none !important; }

/* ---------- Part details (phase 4) ---------- */
.pd-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pd-step { display: flex; gap: 18px; font-size: .875rem; }
.pd { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-areas: "gallery buy" "specs buy"; column-gap: 44px; align-items: start; }
.pd-gallery { grid-area: gallery; }
.pd-buy { grid-area: buy; position: sticky; top: 140px; }
.pd-specs { grid-area: specs; }
.pd-main { display: block; width: 100%; padding: 0 !important; border: 0 !important; background: var(--rp-concrete) !important; border-radius: 4px; overflow: hidden; cursor: zoom-in; box-shadow: none !important; }
.pd-main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pd-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pd-thumbs button { padding: 0 !important; width: 96px; border: 2px solid transparent !important; border-radius: 4px; background: none !important; box-shadow: none !important; }
.pd-thumbs button[aria-current="true"] { border-color: var(--rp-black) !important; }
.pd-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 2px; }
.pd-hint { color: var(--rp-steel); font-size: .875rem; margin: 8px 0 0; }
.pd-nophoto { aspect-ratio: 4 / 3; background: var(--rp-concrete); border-radius: 4px; display: grid; place-content: center; text-align: center; gap: 6px; padding: 24px; color: var(--rp-steel); }
.pd-nophoto p { margin: 0; }
.pd-buy h1 { font-size: 2.441rem; line-height: 1; margin: 0; }
.pd-what { font-size: 1.25rem; color: var(--rp-steel); margin: 6px 0 14px; }
.pd-special { margin: 0 0 6px; font-weight: 600; color: var(--rp-signal); }
.pd-price { font-family: var(--rp-display); font-weight: 700; font-size: 2.441rem; margin: 0; }
.pd-was { font-size: 1.25rem; color: var(--rp-steel); font-weight: 500; margin-left: 8px; }
.pd-avail { margin: 2px 0 18px; }
.pd-avail::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2E7D32; margin-right: 8px; vertical-align: 1px; }
.pd-buynow { width: 100%; padding: 14px !important; font-size: 1.25rem !important; }
.pd-note { margin: 8px 0 14px; color: var(--rp-steel); font-size: .875rem; }
.pd-quote { width: 100%; padding: 11px !important; }
.pd-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.pd-actions .rp-btn { font-size: .875rem !important; padding: 8px 6px !important; }
.pd-help { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rp-line); color: var(--rp-steel); font-size: .875rem; }
.pd-staff { margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--rp-steel); border-radius: 4px; background: #FAFAF8; }
.pd-staff h2 { font-size: 1.25rem; margin: 0 0 8px; }
.pd-staff dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 8px; }
.pd-staff dt { font-weight: 600; }
.pd-staff dd { margin: 0; }
.pd-staff .form-label { margin: 10px 0 2px; font-weight: 600; font-size: .875rem; }
.pd-staff #btnUpdateMTCats { margin-top: 10px; }
.pd-table { width: 100%; border-collapse: collapse; margin-top: 28px; }
.pd-table th, .pd-table td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--rp-line); vertical-align: top; }
.pd-table th { width: 38%; color: var(--rp-steel); font-weight: 500; }
.pd-notes { margin: 0; padding-left: 18px; }
.pd-more { margin-top: 48px; }
.pd-more-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pd-more-head h2 { font-size: 1.953rem; margin: 0 0 6px; }

/* Lightbox */
.pd-lightbox { width: min(1100px, 96vw); max-height: 94vh; padding: 16px; border: 0; border-radius: 6px; background: #111; color: #fff; }
.pd-lightbox::backdrop { background: rgba(0, 0, 0, .8); }
.pd-lightbox figure { margin: 0; text-align: center; }
.pd-lightbox img { max-width: 100%; max-height: 78vh; margin: 0 auto; }
.pd-lightbox figcaption { margin-top: 8px; color: #ccc; }
.pd-lb-close { text-align: right; margin-bottom: 8px; }
.pd-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; font-size: 2rem !important; line-height: 1; background: rgba(0,0,0,.55) !important; color: #fff !important; border: 1px solid #555 !important; border-radius: 4px; }
.pd-lb-nav.prev { left: 12px; }
.pd-lb-nav.next { right: 12px; }

/* jQuery UI dialog ("Email this part") in brand style */
.ui-dialog { font-family: var(--rp-body) !important; border-radius: 6px !important; border: 1px solid var(--rp-line) !important; box-shadow: 0 18px 40px rgba(0,0,0,.25); padding: 0 !important; }
.ui-dialog .ui-dialog-titlebar { background: var(--rp-black) !important; color: var(--rp-white) !important; border: 0 !important; border-radius: 6px 6px 0 0 !important; font-family: var(--rp-display); font-size: 1.25rem; padding: 10px 14px !important; }
.ui-dialog .ui-dialog-content { padding: 16px !important; }
.ui-dialog .ui-dialog-titlebar-close { background: var(--rp-white) !important; border-radius: 4px !important; }
.ui-dialog, .ui-dialog .ui-dialog-content { background: var(--rp-white) !important; color: var(--rp-ink) !important; }
.ui-dialog .ui-dialog-titlebar-close { width: 28px !important; height: 28px !important; margin-top: -14px !important; border: 0 !important; }
.ui-dialog .ui-dialog-titlebar-close { background-image: none !important; font-size: 0 !important; overflow: hidden; padding: 0 !important; }
.ui-dialog .ui-dialog-titlebar-close > * { display: none !important; }
.ui-dialog .ui-dialog-titlebar-close::after { content: "×"; font-size: 1.5rem; line-height: 28px; color: var(--rp-black); position: absolute; inset: 0; text-align: center; }
.ui-widget-overlay { background: #000 !important; opacity: .55 !important; }
#emailFormDiv label { font-weight: 600; margin-top: 8px; }
#emailFormDiv .btnCancelSendEmail, #emailSentDiv .btnCancelSendEmail { background: var(--rp-white) !important; color: var(--rp-black) !important; border: 1px solid var(--rp-black) !important; border-radius: 4px; padding: 8px 16px !important; font-weight: 600; }
#smtSendEmail { background: var(--rp-black) !important; color: var(--rp-white) !important; border: 1px solid var(--rp-black) !important; border-radius: 4px; padding: 8px 16px !important; font-weight: 600; margin-left: 6px; }
#smtSendEmail:hover { background: var(--rp-steel) !important; }

@media (max-width: 980px) {
    .pd { grid-template-columns: 1fr; grid-template-areas: "gallery" "buy" "specs"; row-gap: 24px; }
    .pd-buy { position: static; }
}
@media (max-width: 560px) {
    .pd-actions { grid-template-columns: 1fr; }
    .pd-buy h1, .pd-price { font-size: 1.953rem; }
}

/* ---------- Order list drawer + toast (phase 5) ---------- */
.rp-link-btn { background: none !important; border: 0 !important; box-shadow: none !important; padding: 2px 0 !important; color: var(--rp-link) !important; font: 500 .875rem var(--rp-body) !important; text-decoration: underline; cursor: pointer; }
.rp-link-btn:hover { color: #143a5c !important; }
.rp-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(420px, 100%); max-width: 100%; height: 100%; max-height: 100%; padding: 0; border: 0; background: var(--rp-white); color: var(--rp-ink); box-shadow: -12px 0 40px rgba(0,0,0,.25); flex-direction: column; }
.rp-drawer[open] { display: flex; animation: rp-drawer-in .22s ease-out; }
.rp-drawer::backdrop { background: rgba(0,0,0,.45); }
@keyframes rp-drawer-in { from { transform: translateX(100%); } to { transform: none; } }
.rp-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--rp-line); }
.rp-drawer-head h2 { margin: 0; font-size: 1.953rem; }
.rp-drawer-list, .ct-parts { list-style: none; margin: 0; padding: 8px 20px; }
.rp-drawer-list { overflow: auto; flex: 1; }
.rp-drawer-list li, .ct-parts li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rp-line); }
.rp-drawer-list li img, .ct-parts li img, .rp-drawer-noimg { width: 64px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; background: var(--rp-concrete); display: block; }
.rp-drawer-list .pn, .ct-parts .pn { display: block; font-size: 1.125rem; color: var(--rp-ink); text-decoration: none; }
.rp-drawer-list .pn:hover, .ct-parts .pn:hover { text-decoration: underline; }
.rp-drawer-list small, .ct-parts small { display: block; color: var(--rp-steel); font-size: .875rem; }
li.rp-drawer-empty { display: block; color: var(--rp-steel); border: 0; padding: 16px 0; }
.rp-drawer-foot { padding: 18px 20px; border-top: 1px solid var(--rp-line); display: grid; gap: 10px; }
.rp-drawer-foot p { margin: 0; color: var(--rp-steel); font-size: .875rem; }
.rp-drawer-foot .rp-btn { padding: 12px !important; }
.rp-drawer-foot .rp-btn.disabled { opacity: .5; cursor: not-allowed; }
.rp-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--rp-black); color: var(--rp-white); padding: 10px 18px; border-radius: 4px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1100; max-width: calc(100% - 32px); }
.rp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.rp-toast:empty { display: none; }

/* ---------- Contact / quote form (phase 5) ---------- */
.ct { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 44px; align-items: start; }
.ct-form fieldset { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.ct-form legend { font-size: 1.5625rem; font-weight: 700; margin: 0 0 12px; padding: 0; border: 0; width: auto; }
.ct-legend-note { font: 400 1rem var(--rp-body); color: var(--rp-steel); }
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.ct-wide { grid-column: 1 / -1; }
.ct-form .form-label { font-weight: 600; margin-bottom: 4px; }
.ct-form .form-control, .ct-form .form-select { border: 1px solid #8A8F94 !important; border-radius: 4px !important; padding: 10px 12px; font: 1rem var(--rp-body); box-shadow: none; height: auto; width: 100%; color: var(--rp-ink); background-color: var(--rp-white); }
.ct-form .form-control:focus, .ct-form .form-select:focus { border-color: var(--rp-black) !important; box-shadow: 0 0 0 3px rgba(29, 79, 124, .35); }
.ct-form .input-validation-error { border-color: var(--rp-signal) !important; }
.ct-req { color: var(--rp-signal); font-weight: 700; }
.ct-required-note { color: var(--rp-steel); font-size: .875rem; }
.ct-error, .ct-form .field-validation-error { display: block; color: var(--rp-signal); font-size: .875rem; font-weight: 500; margin-top: 4px; }
.ct-summary.validation-summary-errors { border: 1px solid var(--rp-signal); border-left-width: 4px; border-radius: 4px; padding: 10px 14px; margin-bottom: 16px; color: var(--rp-signal); font-weight: 500; }
.ct-summary.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.ct-summary.validation-summary-valid { display: none; }
.ct-captcha { margin: 0 0 18px; }
.ct-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.ct-submit .rp-btn { padding: 13px 28px !important; font-size: 1.125rem !important; }
.ct-submit p { margin: 0; color: var(--rp-steel); font-size: .875rem; }
.ct-side { display: grid; gap: 20px; position: sticky; top: 140px; }
.ct-card { border: 1px solid var(--rp-line); border-radius: 4px; padding: 18px 20px; background: var(--rp-white); }
.ct-card h2 { font-size: 1.5625rem; margin: 0 0 8px; }
.ct-card h2:focus { outline: none; }
.ct-order { box-shadow: inset 4px 0 0 var(--rp-yellow); }
.ct-parts { padding: 0; margin-bottom: 12px; }
.ct-empty { color: var(--rp-steel); margin: 0 0 12px; }
.ct-more { font-weight: 600; }
.ct-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 12px; }
.ct-dl dt { font-weight: 600; }
.ct-dl dd { margin: 0; }
.ct-card address { margin: 0; color: var(--rp-steel); }
.ct-done { max-width: 640px; padding: 24px 0; }
.ct-done h1 { font-size: 2.441rem; margin: 0 0 10px; }
.ct-done-lede { font-size: 1.25rem; }
.ct-done-search { margin: 28px 0 10px; }
.ct-done-search .form-label { font-weight: 600; }
.ct-done-search div { display: flex; gap: 8px; }
.ct-done-search .form-control { border: 1px solid #8A8F94 !important; border-radius: 4px !important; padding: 10px 12px; height: auto; }
.ct-done-links { display: flex; gap: 18px; flex-wrap: wrap; }
@media (max-width: 980px) {
    .ct { grid-template-columns: 1fr; gap: 28px; }
    .ct-side { position: static; order: -1; }
}
@media (max-width: 560px) {
    .ct-grid { grid-template-columns: 1fr; }
    .ct-done h1 { font-size: 1.953rem; }
}
.site-nav .dropdown-menu a.has-new { color: var(--rp-signal); font-weight: 600; }

/* ---------- Analytics consent banner (Scripts/RPC/analytics.js; only when GoogleAnalytics:MeasurementId is set) ---------- */
.rp-consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1090; background: var(--rp-black); color: var(--rp-white); padding: 16px 0; box-shadow: 0 -8px 24px rgba(0,0,0,.25); }
.rp-consent[hidden] { display: none; }
.rp-consent .rp-wrap { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.rp-consent p { margin: 0; flex: 1 1 420px; font-size: .9375rem; }
.rp-consent a { color: var(--rp-yellow); }
.rp-consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-consent .rp-btn:focus-visible { outline: 3px solid var(--rp-white); outline-offset: 2px; }
.rp-footer-link { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; color: #CCC !important; font: inherit !important; text-decoration: underline; cursor: pointer; }
.rp-footer-link:hover { color: var(--rp-yellow) !important; }
