/* ConfigureX live pricing: topbar price button, price panel and per-part price tags. Uses the page's :root tokens. */

.px-wrap { position: static; }
.px-button { position: relative; display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.px-button svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--lime); }
.px-button-total { min-width: 6ch; color: #e9f0f9; font-family: var(--teko, "Teko", "Arial Narrow", sans-serif); font-size: 19px; font-weight: 600; letter-spacing: .02em; line-height: 1; text-align: left; }
.px-button:hover, .px-button[aria-expanded="true"] { border-color: #2a62a6; color: var(--lime); }
.px-button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
/* small amber dot when some parts on the build have no price yet */
.px-button.px-has-missing::after { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: #f0a63a; box-shadow: 0 0 6px #f0a63a99; content: ""; }

/* "+£985" that floats up from the button when the price changes */
.px-delta { position: absolute; top: calc(100% + 4px); left: 50%; z-index: 23; padding: 3px 8px; border-radius: 99px; background: #2e8bff; color: #fff; font-size: 11px; font-weight: 750; letter-spacing: .02em; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, -4px); }
.px-delta.px-delta-down { background: #23a46b; }
.px-delta-show { animation: px-delta 1.6s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes px-delta { 0% { opacity: 0; transform: translate(-50%, -6px) scale(.9); } 12% { opacity: 1; transform: translate(-50%, 2px) scale(1); } 75% { opacity: 1; transform: translate(-50%, 4px); } 100% { opacity: 0; transform: translate(-50%, 12px); } }

/* ---- panel ---- */
.px-panel { position: absolute; z-index: 22; top: calc(100% + 10px); right: 0; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 92px); display: flex; flex-direction: column; border: 1px solid #3d4248; border-radius: 14px; background: linear-gradient(145deg, #1f2225, #16181b 76%); box-shadow: 0 18px 54px #000a; overflow: hidden; transform-origin: top right; animation: px-in .16s cubic-bezier(.2,.8,.3,1); }
.px-panel[hidden] { display: none; }
@keyframes px-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.px-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 4px; }
.px-title { margin: 0; color: #eef2f6; font-size: 14px; font-weight: 750; letter-spacing: .04em; }
.px-sub { margin: 3px 0 0; color: #7f8893; font-size: 11px; }
.px-close { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid #35393f; border-radius: 7px; background: #1c1f22; color: #9aa3ad; cursor: pointer; }
.px-close svg { width: 14px; height: 14px; }
.px-close:hover { border-color: #2a62a6; color: var(--lime); }
.px-close:focus-visible, .px-currency select:focus-visible, .px-item a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.px-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 8px 16px 10px; }
.px-total-wrap { display: flex; flex-direction: column; min-width: 0; }
.px-total { color: #f2f6fb; font-family: var(--teko, "Teko", "Arial Narrow", sans-serif); font-size: 44px; font-weight: 600; line-height: .9; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.px-total.px-range { font-size: 30px; }
.px-plus { margin-top: 4px; color: #f0a63a; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.px-plus[hidden] { display: none; }
.px-currency select { height: 32px; max-width: 170px; padding: 0 28px 0 10px; border: 1px solid #3a3f45; border-radius: 8px; background: #1c1f22 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%239aa3ad' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center; color: #dfe5ec; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; appearance: none; }
.px-currency select:hover { border-color: #2a62a6; }
.px-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* bike vs upgrades share of the total */
.px-bar { display: flex; gap: 2px; height: 6px; margin: 0 16px; border-radius: 99px; overflow: hidden; background: #24272b; }
.px-bar span { flex: 0 1 0; min-width: 0; transition: flex-grow .5s cubic-bezier(.2,.8,.3,1); }
.px-bar-bike { background: #59626d; }
.px-bar-up { background: linear-gradient(90deg, #2a6fc4, var(--lime)); box-shadow: 0 0 10px #2e8bff66; }
.px-split { display: flex; justify-content: space-between; gap: 10px; padding: 7px 16px 10px; color: #858e99; font-size: 11px; }
.px-split b { margin-left: 4px; color: #dfe5ec; font-weight: 700; font-variant-numeric: tabular-nums; }
.px-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; vertical-align: 0; }
.px-dot-bike { background: #59626d; }
.px-dot-up { background: var(--lime); }

.px-list { flex: 1; min-height: 0; margin: 0; padding: 4px 8px 8px; overflow-y: auto; list-style: none; border-top: 1px solid #272a2f; }
.px-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 8px; border-bottom: 1px solid #23262a; animation: px-row .22s ease both; }
.px-item:last-child { border-bottom: 0; }
@keyframes px-row { from { opacity: 0; transform: translateY(3px); } }
.px-item-text { display: flex; flex-direction: column; min-width: 0; }
.px-item-name { overflow: hidden; color: #e1e5ea; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.px-item-meta { margin-top: 2px; overflow: hidden; color: #737d89; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.px-item-meta a { color: #6fa8ec; text-decoration: none; }
.px-item-meta a:hover { text-decoration: underline; }
.px-item-price { flex: 0 0 auto; color: #eef3f8; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.px-item-bike .px-item-name { color: #f2f5f8; }
.px-item-missing .px-item-meta { color: #c98b33; }
.px-item-missing .px-item-price { color: #6c7580; }
.px-empty { padding: 12px 8px; color: #7f8893; font-size: 11.5px; }
.px-foot { padding: 10px 16px 14px; border-top: 1px solid #272a2f; }
.px-foot p { margin: 0; color: #6f7883; font-size: 10.5px; line-height: 1.45; }
.px-missing { margin-bottom: 5px !important; color: #d39a4a !important; }
.px-missing[hidden] { display: none; }

/* ---- price tag on each part row ---- */
.px-tag { flex: 0 0 auto; padding: 3px 7px; border: 1px solid #2a3c55; border-radius: 6px; background: #2e8bff14; color: #8fc0ff; font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.px-tag-free { border-color: #2c3035; background: transparent; color: #6f7883; font-weight: 600; }
.px-tag-none { border-color: #4a3a22; border-style: dashed; background: transparent; color: #b98a45; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .px-panel, .px-item { animation: none; }
  .px-bar span { transition: none; }
  .px-delta-show { animation: px-delta-still 1.6s linear forwards; }
  @keyframes px-delta-still { 0%, 80% { opacity: 1; transform: translate(-50%, 4px); } 100% { opacity: 0; transform: translate(-50%, 4px); } }
}

@media (max-width: 700px) {
  .px-button { padding: 0 9px; }
  .px-button svg { display: none; }
  .px-button-total { min-width: 0; font-size: 17px; }
  .px-panel { position: fixed; top: 64px; right: 12px; left: 12px; width: auto; }
  .px-total { font-size: 38px; }
  .px-total.px-range { font-size: 26px; }
}

/* ---- light theme ---- */
html[data-theme="light"] .px-button-total { color: #16202c; }
html[data-theme="light"] .px-panel { border-color: #d2d6da; background: #ffffff; box-shadow: 0 18px 48px #0e21381f; }
html[data-theme="light"] .px-title, html[data-theme="light"] .px-total, html[data-theme="light"] .px-item-name, html[data-theme="light"] .px-item-price, html[data-theme="light"] .px-split b { color: #16202c; }
html[data-theme="light"] .px-close, html[data-theme="light"] .px-currency select { border-color: #d2d6da; background-color: #f4f6f8; color: #2b323a; }
html[data-theme="light"] .px-bar { background: #e6e9ed; }
html[data-theme="light"] .px-bar-bike, html[data-theme="light"] .px-dot-bike { background: #a9b1ba; }
html[data-theme="light"] .px-list, html[data-theme="light"] .px-foot { border-top-color: #e3e6ea; }
html[data-theme="light"] .px-item { border-bottom-color: #eceef1; }
html[data-theme="light"] .px-item-meta a { color: #0b5fcf; }
html[data-theme="light"] .px-tag { border-color: #b9d3f5; background: #0b66e40f; color: #0b4fae; }
html[data-theme="light"] .px-tag-free { border-color: #dde1e5; background: transparent; color: #7a838d; }
html[data-theme="light"] .px-tag-none { border-color: #e2c593; background: transparent; color: #a26a16; }
