/* Configurator */

.cfg-head { padding: 56px 0 36px; max-width: 680px; }
.cfg-head h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); }
.cfg-head p { color: var(--text-dim); font-size: 16.5px; margin-top: 14px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--line); border-left: 3px solid var(--text);
  background: var(--bg-panel); padding: 13px 16px; font-size: 14.5px; margin-bottom: 24px;
}
.notice.warn { border-left-color: var(--warn); }
.notice.err { border-left-color: var(--err); }
.notice p { flex: 1; }
.notice button { background: none; border: 0; color: var(--text-dim); cursor: pointer; font-size: 14px; padding: 0 2px; }
.notice button:hover { color: var(--text); }

.cfg { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 48px; align-items: start; padding-bottom: 96px; }
@media (max-width: 980px) { .cfg { grid-template-columns: 1fr; gap: 32px; } }

/* Part rows */
.parts { border-top: 1px solid var(--line); }
.part { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 24px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 640px) { .part { grid-template-columns: 1fr; gap: 9px; padding: 16px 0; } }
.part-label { font-weight: 600; font-size: 15.5px; }
.part-label small { display: block; font-weight: 400; font-size: 13px; color: var(--text-dim); margin-top: 1px; }
@media (max-width: 640px) { .part-label small { display: inline; margin-left: 6px; } }
.part select { width: 100%; min-height: 50px; background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 42px 12px 14px; font-size: 15px; color: var(--text); }
.part select:focus { border-color: var(--text); outline: none; }
.part select:focus-visible { box-shadow: 0 0 0 1px var(--text); }
.part select:disabled { opacity: .55; cursor: not-allowed; }
.part.has-issue select { border-color: var(--err); }
.part-meta { font-size: 13px; color: var(--text-dim); margin-top: 6px; min-height: 0; }
.part-meta:empty { display: none; }

.parts-foot { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 14px; }

/* Summary */
.summary { position: sticky; top: calc(var(--header-h) + 20px); background: var(--bg-panel); border: 1px solid var(--line); }
@media (max-width: 980px) { .summary { position: static; } }
.summary-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.summary-head h2 { font-size: 18px; }
.summary-head span { font-size: 13px; color: var(--text-dim); }
.lines { list-style: none; padding: 6px 22px; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.lines li:last-child { border-bottom: 0; }
.lines .cat { color: var(--text-dim); font-size: 12.5px; grid-column: 1 / -1; }
.lines .model { overflow-wrap: anywhere; }
.lines .price { font-family: var(--font-mono); font-size: 13.5px; text-align: right; white-space: nowrap; }
.lines li.empty .model { color: var(--text-dimmer); }

.checks { padding: 0 22px; }
.check { font-size: 13.5px; padding: 10px 12px; margin-bottom: 8px; border-radius: var(--radius); display: grid; grid-template-columns: 16px 1fr; gap: 9px; }
.check svg { width: 16px; height: 16px; margin-top: 2px; }
.check.err { background: var(--err-bg); color: var(--err-ink); }
.check.err svg { color: var(--err); }
.check.warn { background: var(--warn-bg); color: var(--warn-ink); }
.check.warn svg { color: var(--warn); }
.check.ok { background: var(--ok-bg); color: var(--ok-ink); }
.check.ok svg { color: var(--ok); }

.totals { padding: 16px 22px 22px; border-top: 1px solid var(--line-soft); }
.totals .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text-dim); padding: 3px 0; }
.totals .row span:last-child { font-family: var(--font-mono); color: var(--text); }
.totals .grand { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft); align-items: baseline; }
.totals .grand span:first-child { color: var(--text); font-weight: 600; font-size: 15px; }
.totals .grand span:last-child { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text); }
.pay-note { margin: 16px 0 18px; font-size: 13.5px; color: var(--text-dim); }
.summary-foot { font-size: 12.5px; color: var(--text-dim); margin-top: 12px; text-align: center; }

/* Mobile total bar */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-panel); border-top: 1px solid var(--line);
}
.mbar .lbl { font-size: 12.5px; color: var(--text-dim); }
.mbar .val { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
@media (max-width: 980px) {
  .mbar { display: flex; }
  .mbar.away { display: none; }
  body.cfg-page { padding-bottom: 76px; }
}

/* Dialog */
.dialog {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px);
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-panel); color: var(--text); overflow: auto;
}
.dialog::backdrop { background: var(--backdrop); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 0; }
.dialog-head h2 { font-size: 22px; }
.dialog-head p { color: var(--text-dim); font-size: 14.5px; margin-top: 6px; }
.dialog-close { background: none; border: 0; color: var(--text-dim); cursor: pointer; width: 36px; height: 36px; margin: -6px -10px 0 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dialog-close:hover { color: var(--text); }
.dialog-close svg { width: 20px; height: 20px; }
.dialog-body { padding: 20px 24px 24px; }
@media (max-width: 480px) { .dialog-head { padding: 18px 18px 0; } .dialog-body { padding: 16px 18px 20px; } }

.mini-total { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line-soft); font-size: 14px; margin-bottom: 20px; }
.mini-total { align-items: baseline; }
.mini-total span { color: var(--text-dim); }
.mini-total strong { font-family: var(--font-display); font-size: 20px; font-weight: 700; }

.methods { display: grid; gap: 10px; }
.field .method { display: grid; margin: 0; color: var(--text); grid-template-columns: 18px 1fr; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; cursor: pointer; }
.field .method input { accent-color: var(--text); width: 16px; height: 16px; min-height: 0; margin-top: 3px; }
.method strong { display: block; font-size: 15px; font-weight: 600; }
.method small { display: block; font-size: 13.5px; color: var(--text-dim); margin-top: 2px; }
.method:has(input:checked) { border-color: var(--text); background: var(--tint); }

.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.result-actions .btn { flex: 1 1 200px; }
.result-actions:empty { display: none; }
#rDetails:empty { display: none; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.pay-amount { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--text); background: var(--tint); margin-bottom: 20px; }
.pay-amount span { font-size: 14px; color: var(--text-dim); }
.pay-amount strong { font-family: var(--font-display); font-size: 26px; }

.pay-grid:has(> #qrWrap[hidden]) { grid-template-columns: 1fr; }
.pay-grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
@media (max-width: 480px) { .pay-grid { grid-template-columns: 1fr; } }
.qr { background: #fff; padding: 10px; width: 184px; height: 184px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); }
.qr img, .qr canvas { width: 164px !important; height: 164px !important; image-rendering: pixelated; }
@media (max-width: 480px) { .qr { margin: 0 auto; } .qr-cap { margin-left: auto; margin-right: auto; } }
.qr-cap { font-size: 12.5px; color: var(--text-dim); text-align: center; margin-top: 8px; max-width: 184px; }

.kv { list-style: none; border-top: 1px solid var(--line-soft); }
.kv li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.kv .k { color: var(--text-dim); }
.kv .v { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13.5px; text-align: right; overflow-wrap: anywhere; }
.copy { background: none; border: 1px solid var(--line); color: var(--text-dim); font-size: 12px; padding: 3px 8px; cursor: pointer; border-radius: var(--radius); font-family: var(--font-body); flex-shrink: 0; }
.copy:hover { color: var(--text); border-color: var(--text-dim); }

.after-pay { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.after-pay h3 { font-size: 16px; margin-bottom: 6px; }
.after-pay p { font-size: 14px; color: var(--text-dim); margin-bottom: 14px; }
.after-pay .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.after-pay .btns .btn { flex: 1 1 200px; }
.fineprint { font-size: 12.5px; color: var(--text-dim); margin-top: 16px; }
