/* Category pages only (loaded by views/partials/head.ejs when the page is a category): tabs, anatomy scheme,
   specs, price factors + their drawing, configurator, positions. Kept out of site.css so other pages stay light. */
/* page tabs */
.tabs{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--top-h));z-index:15;background:var(--bg);border-bottom:1px solid var(--line)}
.tabs .wrap{display:flex;gap:6px;overflow-x:auto;padding-top:8px;padding-bottom:8px;scrollbar-width:none}
.tabs a{flex:none;padding:8px 14px;border-radius:var(--r);text-decoration:none;font-weight:500;font-size:15px;color:var(--muted)}
.tabs a:hover{background:var(--surface);color:var(--ink)}
.tabs a.cta{margin-left:auto;background:var(--brand);color:var(--on-brand)}


/* anatomy */
.anatomy{background:var(--panel);color:var(--on-panel);border-radius:var(--r);padding:28px;display:grid;grid-template-columns:1fr 320px;gap:28px;margin-top:48px}
@media (max-width:400px){.anatomy{padding:18px}}
.anatomy svg{width:100%;height:auto;display:block}
.anatomy.tall svg{max-height:560px}
.anatomy .hint{font-size:14px;color:var(--on-panel);opacity:.8;margin-bottom:12px}
.hs{cursor:pointer}
.hs circle.ring{fill:var(--panel);stroke:var(--brand-text);stroke-width:2.5;transition:r .15s}
.hs path{stroke:var(--brand-text);stroke-width:2.5;stroke-linecap:round}
.hs:hover circle.ring,.hs:focus circle.ring{r:15}
.hs.on circle.ring{fill:var(--brand-text)}
.hs.on path{stroke:var(--brand-text)}
.hs:focus{outline:none}
.hs:focus-visible circle.ring{stroke:#fff;stroke-width:3}
.part{border-left:3px solid var(--brand);padding-left:18px;align-self:center}
.part .part-title{color:#fff;font-size:20px;font-family:var(--display);font-weight:500;line-height:1.15;margin:0}
.part p{margin-top:10px;font-size:15px}
.parts-nav{display:flex;flex-wrap:wrap;gap:6px;margin-top:20px;min-height:62px}
.parts-nav button{background:transparent;border:1px solid var(--panel-line);color:var(--on-panel);border-radius:var(--r);padding:5px 10px;font:500 13px var(--body);cursor:pointer}
.parts-nav button[aria-pressed="true"]{background:var(--brand);border-color:var(--brand);color:var(--on-brand)}
@media (max-width:900px){.anatomy{grid-template-columns:1fr}}


/* types + specs */
.specs{width:100%;border-collapse:collapse;font-size:15px}
.specs th,.specs td{text-align:left;padding:12px 0;border-top:1px solid var(--line);vertical-align:top}
.specs th{font-weight:500;color:var(--muted);padding-right:24px;width:55%}
.specs td.req{color:var(--muted);font-style:italic}

/* price factors */
.factors{display:grid;grid-template-columns:repeat(4,1fr);gap:0;border-top:1px solid var(--line);margin-top:40px}
.factors div{padding:24px 24px 24px 0;border-bottom:1px solid var(--line)}
.factors div:not(:nth-child(4n)){border-right:1px solid var(--line)}
.factors div:not(:nth-child(4n+1)){padding-left:24px}
.factors p{color:var(--muted);font-size:15px;margin-top:8px}
@media (max-width:900px){.factors{grid-template-columns:1fr 1fr}.factors div{padding:20px!important;border-right:0!important}.factors div:nth-child(odd){border-right:1px solid var(--line)!important}}
@media (max-width:520px){.factors{grid-template-columns:1fr}.factors div{border-right:0!important;padding:18px 0!important}}


/* configurator */
.config{background:var(--surface)}
.cfg{display:grid;grid-template-columns:1fr 360px;gap:32px;margin-top:40px;align-items:start}
.cfg form{display:grid;gap:26px}
fieldset{border:0;margin:0;padding:0;display:grid;gap:10px;min-width:0}
legend{font-weight:600;margin-bottom:10px;padding:0}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chips label{position:relative}
.chips input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.chips span{display:inline-block;padding:9px 14px;border-radius:var(--r);border:1.5px solid var(--line);background:var(--bg);font-weight:500;font-size:15px}
.chips input:checked + span{border-color:var(--brand);background:var(--brand);color:var(--on-brand)}
.chips input:focus-visible + span{outline:3px solid var(--grain);outline-offset:2px}
.nums{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
@media (max-width:640px){.nums{grid-template-columns:1fr}}
.field{display:grid;gap:6px;font-weight:500;font-size:15px}
.unit{position:relative}
.unit input{padding-right:58px}
.unit i{position:absolute;right:14px;top:50%;transform:translateY(-50%);font-style:normal;color:var(--muted);font-size:14px;pointer-events:none}
.cfg textarea{min-height:90px}
.note{font-size:13px;color:var(--muted)}
.contacts{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:640px){.contacts{grid-template-columns:1fr}}
.summary{position:sticky;top:150px;background:var(--paper);color:var(--ink);border:1.5px solid var(--ink);border-radius:var(--r);padding:24px}
.summary dl{margin:16px 0 0;display:grid;grid-template-columns:auto 1fr;gap:8px 14px;font-size:15px}
.summary dt{color:var(--muted)}
.summary dd{margin:0;color:var(--ink);font-weight:500;overflow-wrap:anywhere}
.summary dd.empty{color:var(--muted);font-weight:400}
.summary .btn{width:100%;margin-top:22px}
.summary .err{color:var(--err);margin-top:12px}
@media (max-width:900px){.cfg{grid-template-columns:1fr}.summary{position:static}}


/* category: positions */
.h1-sub{display:block;font-size:.45em;font-weight:500;color:var(--muted);margin-top:8px}
.filter{display:flex;flex-wrap:wrap;gap:8px;margin:-20px 0 28px}
.filter a{padding:8px 14px;border-radius:var(--r);border:1.5px solid var(--line);text-decoration:none;font-weight:500;font-size:15px}
.filter a[aria-current]{border-color:var(--brand);background:var(--brand);color:var(--on-brand)}
.positions{display:grid;gap:0;border-top:1px solid var(--line)}
.pos{display:grid;grid-template-columns:240px 1fr;gap:28px;padding:28px 0;border-bottom:1px solid var(--line);scroll-margin-top:calc(var(--top-h) + 62px)}
.pos-img{aspect-ratio:1;background:var(--surface);border-radius:var(--r);overflow:hidden}
.pos-img a,.pos-img img{display:block;width:100%;height:100%}
.pos-img img{object-fit:contain}
.pos-img .ph{display:grid;place-items:center;height:100%;color:var(--muted);font-size:14px}
.pos-body{display:grid;gap:12px;align-content:start;min-width:0}
.pos-body h3{font-size:20px}
.pos-body .muted{font-size:15px}
.pos-specs{display:grid;grid-template-columns:auto 1fr;gap:6px 18px;margin:0;font-size:15px}
.pos-specs dt{color:var(--muted)}
.pos-specs dd{margin:0;overflow-wrap:anywhere}
.req{color:var(--muted);font-style:italic}
.thumbs{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.thumbs a{display:block;width:72px;height:72px;border-radius:var(--r);overflow:hidden;background:var(--surface);border:1px solid var(--line)}
.thumbs a:hover{border-color:var(--brand-text)}
.thumbs img{width:100%;height:100%;object-fit:cover;display:block}
.pos-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-top:4px}
@media (max-width:700px){.pos{grid-template-columns:1fr;gap:16px}.pos-img{max-width:360px;aspect-ratio:4/3}.pos-specs{grid-template-columns:1fr;gap:0 0}.pos-specs dd{margin-bottom:8px}}
@media (max-width:400px){.thumbs a{width:60px;height:60px}}


/* ===== Анімації 1. «Що впливає на ціну»: креслення змінюється разом із фактором у центрі екрана ===== */
.fx{--fx-draw:var(--ink);--fx-grid:color-mix(in srgb,var(--line) 55%,transparent);--fx-paper:color-mix(in srgb,var(--bg) 55%,#fff);display:grid;grid-template-columns:1.1fr .9fr;gap:48px;margin-top:40px;align-items:start}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .fx{--fx-paper:color-mix(in srgb,var(--bg) 70%,var(--surface))}}
:root[data-theme="dark"] .fx{--fx-paper:color-mix(in srgb,var(--bg) 70%,var(--surface))}
/* below the site header and the category tabs bar (≈ 62 px) */
.fx-figure{position:sticky;top:calc(var(--top-h) + 78px)}
.fx-live .fx-list li{min-height:38vh}
.fx-live .fx-list li:last-child{min-height:0;margin-bottom:20vh}
.fx-svg{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:var(--r);background:var(--fx-paper)}
.fx-sheet{fill:var(--fx-paper)}
.fx-ln{fill:none;stroke:var(--fx-draw);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.fx-ln.thin{stroke-width:1}
.fx-ln.dim{stroke-width:1}
.fx-ln.dash{stroke-dasharray:4 4}
.fx-ln.belt{stroke-width:4}
.fx-lbl{font:500 14px var(--mono);fill:var(--fx-draw)}
.fx-lbl.small{font-size:11px;font-weight:500}
.fx-dot{fill:var(--fx-draw)}
.fx-belt{fill:var(--fx-draw)}
.fx-cargo,.fx-more{fill:var(--grain)}
.fx-sens{fill:var(--brand-text);stroke:var(--fx-paper);stroke-width:2}
.fx-list{list-style:none;margin:0;padding:0;counter-reset:fx}
.fx-list li{counter-increment:fx;padding:22px 0 22px 20px;border-top:1px solid var(--line);border-left:3px solid transparent}
.fx-list li::before{content:counter(fx,decimal-leading-zero);display:block;font:500 13px var(--mono);letter-spacing:.08em;color:var(--muted);margin-bottom:6px}
.fx-list p{color:var(--muted);font-size:15px;margin-top:8px}
.fx-list li.on{border-left-color:var(--brand-text)}

/* base drawing (no JS, reduced motion): everything optional hidden, conveyor straight */
.fx-leg,.fx-angle-dim,.fx-chev,.fx-more,.fx-cover,.fx-clean,.fx-sens,.fx-b{opacity:0}
.fx-cover{stroke-dasharray:1;stroke-dashoffset:1}
.fx-conv,.fx-stretch{transform-box:view-box;transform-origin:110px 290px}
.fx-belt,.fx-inset-belt{transform-box:fill-box;transform-origin:center}
.fx-sens{transform-box:fill-box;transform-origin:center;transform:scale(.3)}
.fx-clean{transform:translate(-10px,8px)}
/* transitions: 400 ms, reversible (states are set and unset as factors pass the middle) */
.fx-live .fx-conv,.fx-live .fx-stretch,.fx-live .fx-head,.fx-live .fx-len-txt,.fx-live .fx-belt,.fx-live .fx-inset-belt,.fx-live .fx-sens,.fx-live .fx-clean{transition:transform .4s var(--ease-out),opacity .4s var(--ease-out)}
.fx-live .fx-len-dim,.fx-live .fx-leg,.fx-live .fx-angle-dim,.fx-live .fx-chev,.fx-live .fx-more,.fx-live .fx-b{transition:opacity .4s var(--ease-out)}
.fx-live .fx-cover{transition:stroke-dashoffset .4s var(--ease-out),opacity .2s ease}
/* states */
.fx-svg[data-f="angle"] .fx-conv{transform:rotate(-12deg)}
.fx-svg[data-f="angle"] .fx-leg,.fx-svg[data-f="angle"] .fx-angle-dim{opacity:1}
.fx-svg[data-f="angle"] .fx-len-dim,.fx-svg[data-f="angle"] .fx-len-txt{opacity:0}
.fx-svg[data-f="length"] .fx-stretch{transform:scaleX(1.1)}
.fx-svg[data-f="length"] .fx-head{transform:translateX(40px)}
.fx-svg[data-f="length"] .fx-len-txt{transform:translateX(20px)}
.fx-svg[data-f="width"] .fx-belt{transform:scaleY(2)}
.fx-svg[data-f="width"] .fx-inset-belt{transform:scaleX(1.12)}
.fx-svg[data-f="width"] .fx-b{opacity:1}
.fx-svg[data-f="load"] .fx-more{opacity:1}
.fx-svg[data-f="chevron"] .fx-chev{opacity:1}
.fx-svg[data-f="cover"] .fx-cover{opacity:1;stroke-dashoffset:0}
.fx-svg[data-f="sensors"] .fx-sens{opacity:1;transform:none}
.fx-svg[data-f="cleaner"] .fx-clean{opacity:1;transform:none}

@media (max-width:860px){
  .fx{grid-template-columns:1fr;gap:20px}
  .fx-figure{position:static}
  .fx-live .fx-list li{min-height:0}
  .fx-live .fx-list li:last-child{margin-bottom:0}
}

