/* Конфигуратор набора — интерфейс для компьютера (от 1024px): шаги слева, сводка справа.
   Поведение — configurator-d.js. Исходная вёрстка (.cfg3-desk) остаётся скрытым движком расчёта.
   Оформление повторяет конфигуратор батарей (battery-configurator-d.css). */

.cfgd { display: none; }

@media (min-width: 1024px) {
  .cfgd-ready .cfg3-desk { display: none !important; }

  .cfgd {
    --c-ink: #1b1b1b; --c-muted: #6f6f6f; --c-line: #e4e4e4; --c-soft: #f8f8f6;
    --c-accent: #febd22; --c-accent-soft: #fffaeb; --c-orange: #c24d00; --c-err: #b3261e;
    display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; margin: 8px 0 40px;
    color: var(--c-ink); font-size: 16px; line-height: 1.4;
  }
  .cfgd *, .cfgd *::before, .cfgd *::after { box-sizing: border-box; }
  .cfgd button { font: inherit; color: inherit; cursor: pointer; margin: 0; }
  .cfgd h2 { margin: 0; font-size: 21px; line-height: 1.2; text-transform: none; letter-spacing: 0; }
  .cfgd [hidden] { display: none !important; }
  .cfgd b { font-weight: 700; }

  .cfgd-steps { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
  .cfgd-card { border: 1px solid var(--c-line); border-radius: 16px; padding: 20px 22px; background: #fff; }
  .cfgd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-width: 0; }
  .cfgd-num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--c-accent);
    font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
  .cfgd-picked { margin-left: auto; font-size: 14px; color: var(--c-muted); text-align: right; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cfgd-sub { margin: -8px 0 14px; font-size: 14px; color: var(--c-muted); }

  /* ---------- поездки ---------- */
  .cfgd-params { display: flex; flex-direction: column; gap: 10px; }
  .cfgd-param { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) 112px; gap: 16px; align-items: center;
    background: var(--c-soft); border-radius: 14px; padding: 12px 16px; }
  .cfgd-param-lbl { font-weight: 700; display: block; }
  .cfgd-param-hint { display: block; font-size: 13px; color: var(--c-muted); }
  .cfgd-param-ctl { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .cfgd-stepbtn { flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1.5px solid #dcdcdc;
    background: #fff; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
  .cfgd-stepbtn:hover:not(:disabled) { border-color: var(--c-accent); background: #fff6dc; }
  .cfgd-stepbtn:disabled { opacity: .4; cursor: default; }
  .cfgd-val { text-align: right; white-space: nowrap; color: var(--c-muted); font-size: 14px; }
  .cfgd-val b { font-size: 28px; line-height: 1; color: var(--c-ink); font-variant-numeric: tabular-nums; }

  .cfgd .cfgd-range { -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 0; height: 28px; margin: 0;
    background: transparent; border: 0; padding: 0; cursor: pointer; box-shadow: none; --p: 0%; }
  .cfgd-range:focus { outline: none; }
  .cfgd-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
    background: linear-gradient(to right, var(--c-accent) var(--p), #e4e4e4 var(--p)); }
  .cfgd-range::-moz-range-track { height: 6px; border-radius: 3px; background: #e4e4e4; }
  .cfgd-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--c-accent); }
  .cfgd-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
    background: #fff; border: 4px solid var(--c-accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
  .cfgd-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--c-accent); }
  .cfgd-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(254, 189, 34, .4); }

  .cfgd-segs { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 16px; }
  .cfgd-pills { flex-wrap: nowrap; }
  .cfgd-seg-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .cfgd-seg-lbl { font-weight: 700; flex: 0 0 auto; }
  .cfgd-pills { display: flex; gap: 8px; flex-wrap: wrap; }
  .cfgd-pill { border: 1.5px solid var(--c-line); border-radius: 999px; padding: 8px 16px; background: #fff; min-height: 42px; }
  .cfgd-pill:hover { border-color: #cfcfcf; }
  .cfgd-pill.is-on { border-color: var(--c-accent); background: var(--c-accent); font-weight: 700; }

  /* ---------- товары ---------- */
  .cfgd-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
  .cfgd-opt { position: relative; border: 2px solid var(--c-line); border-radius: 14px; background: #fff; padding: 10px 12px 12px;
    display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
  .cfgd-opt:hover { border-color: #cfcfcf; transform: translateY(-2px); }
  .cfgd-opt.is-on { border-color: var(--c-accent); background: #fffdf6; box-shadow: 0 6px 18px rgba(254, 189, 34, .28); }
  .cfgd-opt.is-off { opacity: .55; }
  .cfgd-opt.is-off:hover { transform: none; border-color: var(--c-line); }
  .cfgd-hit { position: absolute; inset: 0; z-index: 1; width: 100%; border: 0; padding: 0; background: transparent; border-radius: 12px; }
  .cfgd-hit:focus-visible { outline: 2px solid var(--c-orange); outline-offset: 2px; }
  .cfgd-opt.is-off .cfgd-hit { cursor: not-allowed; }
  .cfgd-img { height: 112px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
  .cfgd-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
  .cfgd-img:empty { background: var(--c-soft); }
  .cfgd-tag { align-self: flex-start; font-size: 12px; font-weight: 600; line-height: 1.2; padding: 3px 9px; border-radius: 999px;
    background: #f0f0ee; color: #444; }
  .cfgd-opt.is-on .cfgd-tag { background: var(--c-accent); color: var(--c-ink); }
  .cfgd-name { font-weight: 700; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
  .cfgd-desc { font-size: 13px; color: var(--c-muted); }
  .cfgd-params-list { font-size: 13px; color: var(--c-muted); }
  .cfgd-params-list div { display: flex; justify-content: space-between; gap: 6px; padding: 1px 0; }
  .cfgd-params-list b { color: var(--c-ink); white-space: nowrap; }
  .cfgd-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
    border-top: 1px dashed var(--c-line); padding-top: 8px; }
  .cfgd-price { font-size: 17px; font-weight: 700; white-space: nowrap; }
  .cfgd-price.is-na { color: var(--c-err); font-size: 14px; font-weight: 600; }
  .cfgd-more { position: relative; z-index: 2; font-size: 13px; color: var(--c-muted) !important; text-decoration: underline;
    text-underline-offset: 2px; white-space: nowrap; }
  .cfgd-more:hover { color: var(--c-orange) !important; }
  .cfgd-mark { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #c9c9c9; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
  .cfgd-opt.is-multi .cfgd-mark { border-radius: 6px; }
  .cfgd-opt.is-on .cfgd-mark { border-color: var(--c-accent); }
  .cfgd-opt.is-on:not(.is-multi) .cfgd-mark::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--c-accent); }
  .cfgd-opt.is-on.is-multi .cfgd-mark { background: var(--c-accent); }
  .cfgd-opt.is-on.is-multi .cfgd-mark::after { content: ''; width: 9px; height: 5px; margin-top: -3px;
    border-left: 2px solid var(--c-ink); border-bottom: 2px solid var(--c-ink); transform: rotate(-45deg); }

  .cfgd-note { margin-top: 14px; background: var(--c-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #3a3a3a; line-height: 1.45; }
  .cfgd-note:empty { display: none; }
  .cfgd abbr[title] { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
  .cfgd-err { margin-top: 12px; background: #fff1eb; color: #8f3000; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

  /* ---------- сводка ---------- */
  .cfgd-sum { flex: 1 1 290px; max-width: 320px; position: sticky; top: 16px;
    max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; border-radius: 18px; }
  .cfgd-sum-card { border-radius: 18px; background: #f5f5f3; border-top: 4px solid var(--c-accent); padding: 18px 20px 16px; }
  .cfgd-sum-k { font-size: 13px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .6px; }
  .cfgd-sum-code { font-size: 19px; font-weight: 700; margin: 2px 0 14px; line-height: 1.25; }
  .cfgd-big { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .cfgd-big div { background: #fff; border-radius: 12px; padding: 10px 4px; text-align: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
  .cfgd-big b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .cfgd-big span { font-size: 12px; color: var(--c-muted); }
  .cfgd-rows { font-size: 14px; border-top: 1px solid #e4e4e0; }
  .cfgd-rows div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #e4e4e0; }
  .cfgd-rows span { color: var(--c-muted); }
  .cfgd-rows b { text-align: right; }
  .cfgd-note-s { font-size: 11px; color: var(--c-muted); line-height: 1.3; margin-top: 10px; }

  .cfgd-price-card { background: #fff; border: 1px solid var(--c-line); border-radius: 18px; padding: 18px 20px; margin-top: 12px; }
  .cfgd-items { list-style: none; margin: 0; padding: 0; }
  .cfgd-items li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; margin: 0; }
  .cfgd-items li::before { display: none; }
  .cfgd-items li > span:first-child { color: var(--c-muted); flex: 0 0 auto; }
  .cfgd-items li > span:last-child { text-align: right; min-width: 0; overflow-wrap: anywhere; }
  .cfgd-items a { color: var(--c-ink) !important; text-decoration: none; }
  .cfgd-items a:hover { text-decoration: underline; }
  .cfgd-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--c-line); margin-top: 8px; padding-top: 10px; }
  .cfgd-total b { font-size: 28px; white-space: nowrap; }
  .cfgd-buy { width: 100%; margin-top: 12px !important; height: 50px; border: 0; border-radius: 12px; background: var(--c-accent);
    font-weight: 700; font-size: 17px; }
  .cfgd-buy:hover:not(:disabled) { background: #f5b000; }
  .cfgd-buy:disabled { opacity: .6; cursor: progress; font-size: 15px; }
  .cfgd-contact { font-size: 12px; color: var(--c-muted); margin-top: 10px; }

  @keyframes cfgd-bump { 0% { transform: scale(1); } 35% { transform: scale(1.06); color: var(--c-orange); } 100% { transform: scale(1); } }
  .cfgd-bump { display: inline-block; animation: cfgd-bump .35s ease-out; }

  @media (prefers-reduced-motion: reduce) {
    .cfgd-opt { transition: none; } .cfgd-opt:hover { transform: none; } .cfgd-bump { animation: none; }
  }
}
