/* Под мотором — каталог запчастей Gladiator. Все стили внутри .pmz, чтобы не задевать тему. */
.pmz {
  --pmz-blue: #1458b0;
  --pmz-blue-dark: #0d3f80;
  --pmz-navy: #12233d;
  --pmz-water: #eaf2fc;
  --pmz-line: #d6e1ef;
  --pmz-muted: #5d6b80;
  --pmz-bg: #ffffff;
  --pmz-focus: #ffb000;
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--pmz-navy);
  background: var(--pmz-bg);
  font-variant-numeric: tabular-nums;
}
.pmz *, .pmz *::before, .pmz *::after { box-sizing: border-box; }
.pmz a { color: var(--pmz-blue); text-decoration: none; }
.pmz a:hover { color: var(--pmz-blue-dark); }
.pmz :focus-visible { outline: 3px solid var(--pmz-focus); outline-offset: 2px; }
.pmz button, .pmz input { font: inherit; }

.pmz-loading, .pmz-empty { padding: 32px 0; color: var(--pmz-muted); }
.pmz-empty p { margin: 0 0 16px; max-width: 60ch; }

.pmz-title { font-size: 26px; line-height: 1.2; font-weight: 700; margin: 8px 0 20px; color: var(--pmz-navy); letter-spacing: -0.01em; }
.pmz-group-title { font-size: 17px; font-weight: 600; margin: 0 0 12px; color: var(--pmz-navy); }
.pmz-muted { color: var(--pmz-muted); }

/* Кнопки */
.pmz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border: 0; border-radius: 6px;
  background: var(--pmz-blue); color: #fff !important; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.pmz-btn:hover { background: var(--pmz-blue-dark); }
.pmz-btn:disabled { opacity: .7; cursor: default; }
.pmz-btn.is-done { background: #1c8a4a; }
.pmz-btn-ghost { background: transparent; color: var(--pmz-blue) !important; box-shadow: inset 0 0 0 1.5px var(--pmz-blue); }
.pmz-btn-ghost:hover { background: var(--pmz-water); }

/* Поиск */
.pmz-search { display: flex; gap: 8px; margin: 0 0 16px; max-width: 720px; }
.pmz-search-input {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px;
  border: 1.5px solid var(--pmz-line); border-radius: 6px; background: #fff; color: var(--pmz-navy);
}
.pmz-search-input:focus { border-color: var(--pmz-blue); outline: none; box-shadow: 0 0 0 3px rgba(20, 88, 176, .15); }
.pmz-search .pmz-btn { min-height: 42px; }
.pmz form.pmz-search button.pmz-btn { background: var(--pmz-blue) !important; color: #fff !important; border: 0 !important; box-shadow: none !important; }
.pmz form.pmz-search button.pmz-btn:hover { background: var(--pmz-blue-dark) !important; }

/* Хлебные крошки */
.pmz-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--pmz-muted); margin: 4px 0 4px; }
.pmz-crumbs-sep { color: #9aa8bb; }

/* Модели */
.pmz-groups { display: grid; gap: 28px; }
.pmz-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pmz-model {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 14px;
  border: 1.5px solid var(--pmz-line); border-left: 4px solid var(--pmz-blue); border-radius: 6px;
  background: #fff; color: var(--pmz-navy) !important;
}
.pmz-model:hover { border-color: var(--pmz-blue); background: var(--pmz-water); }
.pmz-model.has-photo { border-left-width: 1.5px; padding: 10px 14px 14px; }
.pmz-model.has-photo:hover { background: #fff; }
.pmz-model-img { display: block; aspect-ratio: 1; margin-bottom: 6px; }
.pmz-model-img img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .2s; }
.pmz-model.has-photo:hover .pmz-model-img img { transform: scale(1.04); }
.pmz-model-name { font-size: 18px; font-weight: 700; }
.pmz-model-meta { font-size: 13px; color: var(--pmz-muted); }

/* Узлы */
.pmz-nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.pmz-node { display: flex; flex-direction: column; border: 1.5px solid var(--pmz-line); border-radius: 6px; overflow: hidden; background: #fff; color: var(--pmz-navy) !important; }
.pmz-node:hover { border-color: var(--pmz-blue); }
.pmz-node-img { display: block; aspect-ratio: 1; background: #fff; border-bottom: 1px solid var(--pmz-line); }
.pmz-node-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; display: block; }
.pmz-node-title { padding: 10px 12px 12px; font-weight: 600; font-size: 14px; }
.pmz-noimg { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 160px; color: var(--pmz-muted); font-size: 13px; background: var(--pmz-water); }

/* Страница узла: схема слева, таблица справа — как на портале */
.pmz-node-layout { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 20px; align-items: start; }
.pmz-scheme { position: sticky; top: 16px; border: 1.5px solid var(--pmz-line); border-radius: 6px; background: #fff; padding: 8px; }
.pmz-scheme-stage { position: relative; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; touch-action: pan-y; }
.pmz-scheme-stage.is-zoomed { cursor: grab; touch-action: none; }
.pmz-scheme-stage img { width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0; user-select: none; display: block; }
/* схема прилипает под фиксированной шапкой темы, а не под ней */
.pmz-scheme { top: calc(var(--header-sticky-height, 0px) + 16px); }
/* точки номеров на схеме (1.2.0) */
.pmz-scheme-layer { position: absolute; inset: 0; transform-origin: 0 0; }
.pmz-pins { position: absolute; }
.pmz-pin {
  position: absolute; width: 22px; height: 22px; margin: 0; padding: 0; border: 2px solid transparent; border-radius: 50%;
  background: transparent; transform: translate(-50%, -50%) scale(calc(1 / var(--pmz-s, 1))); cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.pmz-pin:hover, .pmz-pin:focus-visible, .pmz-pin.is-hl { border-color: var(--pmz-blue); background: rgba(26, 138, 250, .14); outline: none; }
.pmz-pin.is-pulse { border-color: #e00000; background: rgba(224, 0, 0, .12); animation: pmz-pulse .8s ease-out 3; }
@keyframes pmz-pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 0, 0, .55); } 100% { box-shadow: 0 0 0 14px rgba(224, 0, 0, 0); } }
.pmz-pos.is-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.pmz-tr.is-hl { background: #fff6dd; box-shadow: inset 4px 0 0 #e00000; transition: background-color .3s; }
@media (hover: none) { .pmz-pin { width: 28px; height: 28px; } }
.pmz-scheme-tools { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 4px; }
.pmz-scheme-tools button, .pmz-scheme-tools a {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--pmz-line); border-radius: 6px; background: #fff; color: var(--pmz-navy) !important; font-size: 18px; cursor: pointer;
}
.pmz-scheme-tools button:hover, .pmz-scheme-tools a:hover { border-color: var(--pmz-blue); color: var(--pmz-blue) !important; }
.pmz-scheme-hint { margin: 6px 4px 2px; font-size: 12px; color: var(--pmz-muted); }

/* Таблица */
.pmz-table { border: 1.5px solid var(--pmz-line); border-radius: 6px; background: #fff; }
.pmz-table > .pmz-tr:first-child { border-radius: 5px 5px 0 0; }
.pmz-table > .pmz-tr:last-child { border-radius: 0 0 5px 5px; }
.pmz-tr {
  display: grid; grid-template-columns: 34px 132px minmax(120px, 1fr) 92px 62px 116px;
  gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--pmz-line); color: var(--pmz-navy) !important;
}
.pmz-tr:first-child { border-top: 0; }
.pmz-th { background: var(--pmz-water); font-size: 13px; font-weight: 600; color: var(--pmz-muted) !important; padding-top: 10px; padding-bottom: 10px; }
.pmz-tr:not(.pmz-th):hover { background: #f6f9fe; }
.pmz-tr.is-focus { background: #fff6dd; box-shadow: inset 4px 0 0 var(--pmz-focus); }
.pmz-tr.is-noprice .pmz-price { color: var(--pmz-muted); font-weight: 500; }
.pmz-pos { font-weight: 700; color: var(--pmz-blue); text-align: center; }
.pmz-art { font-size: 13px; letter-spacing: .01em; overflow-wrap: anywhere; }
.pmz-name { font-weight: 500; }
.pmz-num { text-align: right; }
.pmz-price { font-weight: 700; white-space: nowrap; }
.pmz-qty { width: 56px; height: 34px; padding: 0 6px; border: 1.5px solid var(--pmz-line); border-radius: 6px; text-align: center; background: #fff; color: var(--pmz-navy); }
.pmz-qty:disabled { background: var(--pmz-water); color: var(--pmz-muted); }
.pmz-act .pmz-btn { width: 100%; min-height: 34px; padding: 0 10px; }
.pmz-ask { position: relative; display: block; }
.pmz-ask > .pmz-btn { width: 100%; min-height: 34px; padding: 0 10px; }
.pmz-ask-menu {
  position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); min-width: 150px;
  display: flex; flex-direction: column; padding: 4px; background: #fff;
  border: 1.5px solid var(--pmz-line); border-radius: 6px; box-shadow: 0 8px 24px rgba(18, 35, 61, .14);
}
.pmz-ask-menu[hidden] { display: none; }
.pmz-ask-menu a { padding: 8px 10px; border-radius: 4px; font-weight: 500; }
.pmz-ask-menu a:hover { background: var(--pmz-water); }
.pmz-note { font-size: 13px; color: var(--pmz-muted); margin: 10px 2px 0; }

.pmz-table-search .pmz-tr { grid-template-columns: 150px minmax(140px, 1fr) minmax(140px, 1fr) 100px; }

/* Другие узлы */
.pmz-others { margin-top: 32px; padding-top: 20px; border-top: 1.5px solid var(--pmz-line); }
.pmz-others-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pmz-others-list a, .pmz-others-current { padding: 6px 12px; border-radius: 6px; border: 1.5px solid var(--pmz-line); font-size: 14px; }
.pmz-others-list a:hover { border-color: var(--pmz-blue); }
.pmz-others-current { background: var(--pmz-blue); border-color: var(--pmz-blue); color: #fff; }

/* Уведомление о корзине */
.pmz-toast {
  position: fixed; z-index: 99999; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  padding: 12px 12px 12px 18px; border-radius: 8px; background: var(--pmz-navy); color: #fff;
  box-shadow: 0 8px 28px rgba(18, 35, 61, .3);
}
.pmz-toast.is-error { background: #a3261c; }
.pmz-toast-close { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; padding: 0 6px; }

/* Планшеты */
@media (max-width: 1100px) {
  .pmz-node-layout { grid-template-columns: 1fr; }
  .pmz-scheme { position: relative; top: auto; max-width: 640px; }
}

/* Телефоны: строки таблицы превращаются в карточки */
@media (max-width: 680px) {
  .pmz-title { font-size: 21px; }
  .pmz-th { display: none; }
  .pmz-tr {
    grid-template-columns: 30px 1fr auto;
    grid-template-areas: "pos name name" "pos art price" "pos qty act";
    row-gap: 6px; padding: 12px;
  }
  .pmz-tr > .pmz-pos { grid-area: pos; align-self: start; }
  .pmz-tr > .pmz-art { grid-area: art; color: var(--pmz-muted); }
  .pmz-tr > .pmz-name { grid-area: name; }
  .pmz-tr > .pmz-price { grid-area: price; }
  .pmz-tr > :nth-child(5) { grid-area: qty; text-align: left; }
  .pmz-tr > .pmz-act { grid-area: act; }
  .pmz-table-search .pmz-tr { grid-template-columns: 1fr auto; grid-template-areas: none; }
  .pmz-table-search .pmz-tr > * { grid-area: auto; }
  .pmz-search .pmz-btn { padding: 0 12px; }
  .pmz-toast { flex-wrap: wrap; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pmz * { transition: none !important; scroll-behavior: auto !important; }
}
.pmz-model-img { overflow: hidden; }
@media (max-width: 680px) {
  .pmz-models, .pmz-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pmz-model-name { font-size: 15px; }
  .pmz-model.has-photo { padding: 8px 10px 10px; }
}

/* v1.1: наличие */
.pmz .pmz-stock { display: block; font-size: 12px; font-weight: 500; line-height: 1.3; color: #b45309; white-space: nowrap; }
.pmz .pmz-stock.is-out { color: #b91c1c; }
