/* cw-header.css — gated CarbonWrap header (Фаза2/П1). Active ONLY under body.cwnew.
   Namespaced .cwh-* / .cwm-* (no clash with legacy .cw-header / theme classes). UTF-8 без BOM, без !important. */

/* show new, hide legacy — only under gate */
body.cwnew header.cw-header[data-cw-header]{display:none;}
body.cwnew .cwnew-hdr[hidden]{display:block;}

/* ===== header shell ===== */
body.cwnew .cwnew-hdr{position:sticky;top:0;z-index:60;background:var(--paper);font-family:var(--font-sans);}
body.cwnew .cwh-in{max-width:1720px;margin:0 auto;padding:0 clamp(24px,5vw,80px);}
@media (min-width:1680px){body.cwnew .cwh-in{max-width:1860px;}}
/* top strip */
body.cwnew .cwh-top{border-bottom:1px solid var(--line);background:var(--paper);}
body.cwnew .cwh-top .cwh-in{display:flex;align-items:center;justify-content:space-between;gap:16px;height:36px;font-family:var(--font-mono);font-size:13px;color:var(--ink-40);}
body.cwnew .cwh-region{font-size:12px;color:var(--ink-40);}
body.cwnew .cwh-tc{display:flex;align-items:center;gap:14px;font-size:15px;}
body.cwnew .cwh-tc a{text-decoration:none;color:var(--ink);transition:color .15s ease;}
body.cwnew .cwh-tc a:hover{color:var(--violet);}
body.cwnew .cwh-tc .m{letter-spacing:.02em;}
/* main row */
body.cwnew .cwh-main{display:flex;align-items:center;gap:28px;height:64px;position:relative;}
body.cwnew .cwh-brand{display:flex;align-items:center;flex:0 0 auto;text-decoration:none;}
body.cwnew .cwh-brand img{height:34px;width:auto;display:block;}
/* nav */
body.cwnew .cwh-nav{display:flex;gap:30px;flex:1 1 auto;justify-content:center;flex-wrap:nowrap;}
body.cwnew .cwh-nav > a,body.cwnew .cwh-cat > a{font-size:15px;font-weight:var(--fw-med);letter-spacing:.01em;text-decoration:none;color:var(--ink);padding:21px 0;border-bottom:2px solid transparent;transition:border-color .18s ease,color .18s ease;white-space:nowrap;}
body.cwnew .cwh-nav > a:hover,body.cwnew .cwh-nav > a.active{color:var(--violet);border-color:var(--violet);}
/* catalog dropdown */
body.cwnew .cwh-cat{position:static;display:flex;align-items:stretch;}
body.cwnew .cwh-cat:hover > a,body.cwnew .cwh-cat:focus-within > a{color:var(--violet);border-color:var(--violet);}
body.cwnew .cwh-cat > a{display:inline-flex;align-items:center;gap:7px;}
body.cwnew .cwh-cat > a::after{content:"";width:11px;height:11px;flex:0 0 auto;background:no-repeat center/11px 11px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b1b1b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 9 12 16 19 9'/%3E%3C/svg%3E");transition:transform .25s ease;}
body.cwnew .cwh-cat:hover > a::after,body.cwnew .cwh-cat:focus-within > a::after{transform:rotate(180deg);}
body.cwnew .cwh-drop{position:absolute;top:100%;left:0;right:0;transform:translateY(10px);background:var(--paper);border:1px solid var(--line);border-top:2px solid var(--violet);box-shadow:0 18px 38px rgba(20,18,16,.14);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,transform .18s ease,visibility .18s ease;z-index:30;}
body.cwnew .cwh-cat:hover .cwh-drop,body.cwnew .cwh-cat:focus-within .cwh-drop{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0);}
body.cwnew .cwh-cat.kbd-closed .cwh-drop{opacity:0;visibility:hidden;pointer-events:none;}
body.cwnew .cwh-mega{display:grid;grid-template-columns:repeat(3,1fr);align-content:start;padding:12px;}
body.cwnew .cwh-mega a{display:flex;flex-direction:column;gap:4px;min-width:0;padding:13px 16px;background:var(--paper);text-decoration:none;border:0;white-space:normal;transition:background .12s ease;}
body.cwnew .cwh-mega a:not(:nth-child(3n)){border-right:1px solid var(--line);}
body.cwnew .cwh-mega a:hover,body.cwnew .cwh-mega a:focus{background:var(--violet-tint);outline:none;}
body.cwnew .cwh-mega .mc-name{font-family:var(--font-head);font-weight:var(--fw-bold);font-size:15px;letter-spacing:-.01em;color:var(--ink);}
body.cwnew .cwh-mega a:hover .mc-name,body.cwnew .cwh-mega a:focus .mc-name{color:var(--violet);}
body.cwnew .cwh-mega .mc-desc{font-size:12px;line-height:1.35;color:var(--ink-40);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
body.cwnew .cwh-mega .mc-go{margin-top:3px;font-family:var(--font-mono);font-size:11.5px;letter-spacing:.01em;color:var(--violet);}
body.cwnew .cwh-mega .mc-go::after{content:" \2192";}
body.cwnew .cwh-mega-all{display:block;text-align:center;padding:13px 16px;border-top:1px solid var(--line);font-size:13px;font-weight:var(--fw-semi);color:var(--violet);text-decoration:none;transition:background .12s ease;}
body.cwnew .cwh-mega-all:hover,body.cwnew .cwh-mega-all:focus{background:var(--violet-tint);outline:none;}
/* actions */
body.cwnew .cwh-actions{display:flex;align-items:center;gap:18px;flex:0 0 auto;}
body.cwnew .cwh-search{position:relative;display:flex;align-items:center;flex:0 0 auto;}
body.cwnew .cwh-search .mag{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--ink-40);pointer-events:none;display:flex;}
body.cwnew .cwh-search input{width:240px;max-width:38vw;height:40px;border:1px solid var(--line);background:#fff;color:var(--ink);font-family:var(--font-sans);font-size:15px;padding:0 14px 0 38px;transition:border-color .15s ease,box-shadow .15s ease;}
body.cwnew .cwh-search input::placeholder{color:var(--ink-40);}
body.cwnew .cwh-search input:focus{outline:none;border-color:var(--violet);box-shadow:0 0 0 3px rgba(92,74,158,.12);}
body.cwnew .cwh-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--font-head);font-weight:var(--fw-bold);font-size:14px;text-decoration:none;padding:10px 20px;border:1px solid var(--violet);background:var(--violet);color:#fff;white-space:nowrap;cursor:pointer;transition:background .15s ease,box-shadow .15s ease;box-shadow:0 1px 2px rgba(92,74,158,.16);}
body.cwnew .cwh-btn:hover{background:var(--violet-deep);border-color:var(--violet-deep);box-shadow:0 5px 16px rgba(92,74,158,.28);}
/* burger */
body.cwnew .cwh-burger{display:none;align-items:center;justify-content:center;width:42px;height:42px;border:1px solid var(--line);background:var(--paper);cursor:pointer;flex:0 0 auto;padding:0;position:relative;}
body.cwnew .cwh-burger span{position:absolute;left:50%;top:50%;width:18px;height:2px;background:var(--ink);transform:translate(-50%,-50%);transition:transform .25s ease,opacity .2s ease;}
body.cwnew .cwh-burger span:nth-child(1){transform:translate(-50%,-7px);}
body.cwnew .cwh-burger span:nth-child(3){transform:translate(-50%,5px);}
body.cwnew .cwh-burger.open span:nth-child(1){transform:translate(-50%,-50%) rotate(45deg);}
body.cwnew .cwh-burger.open span:nth-child(2){opacity:0;}
body.cwnew .cwh-burger.open span:nth-child(3){transform:translate(-50%,-50%) rotate(-45deg);}
/* mobile search row */
body.cwnew .cwh-msearch{display:none;position:relative;padding:6px clamp(24px,5vw,80px) 14px;}
body.cwnew .cwh-msearch input{width:100%;height:44px;border:1px solid var(--line);background:#fff;color:var(--ink);font-family:var(--font-sans);font-size:16px;padding:0 14px;box-sizing:border-box;}
body.cwnew .cwh-msearch input:focus{outline:none;border-color:var(--violet);box-shadow:0 0 0 3px rgba(92,74,158,.12);}

/* ===== mobile sheet ===== */
body.cwnew .cwnew-mnav{position:fixed;inset:0;z-index:70;background:var(--paper);opacity:0;visibility:hidden;transition:opacity .25s ease,visibility .25s ease;}
body.cwnew .cwnew-mnav.open{opacity:1;visibility:visible;}
body.cwnew .cwm-panel{position:absolute;inset:16px;border:1px solid var(--ink);display:flex;flex-direction:column;padding:clamp(20px,5vw,30px);overflow-y:auto;}
body.cwnew .cwm-head{display:flex;align-items:center;justify-content:space-between;height:44px;margin-bottom:10px;flex:0 0 auto;}
body.cwnew .cwm-head img{height:32px;}
body.cwnew .cwm-close{width:42px;height:42px;border:1px solid var(--line);background:var(--paper);cursor:pointer;position:relative;flex:0 0 auto;}
body.cwnew .cwm-close::before,body.cwnew .cwm-close::after{content:"";position:absolute;left:50%;top:50%;width:18px;height:2px;background:var(--ink);}
body.cwnew .cwm-close::before{transform:translate(-50%,-50%) rotate(45deg);}
body.cwnew .cwm-close::after{transform:translate(-50%,-50%) rotate(-45deg);}
body.cwnew .cwm-list{display:flex;flex-direction:column;border-top:1px solid var(--line);}
body.cwnew .cwm-list > a,body.cwnew .cwm-cat > summary{font-family:var(--font-head);font-weight:var(--fw-bold);font-size:21px;letter-spacing:-.01em;color:var(--ink);text-decoration:none;padding:13px 2px;border-bottom:1px solid var(--line);display:flex;align-items:center;min-height:52px;}
body.cwnew .cwm-list > a:hover{color:var(--violet);}
body.cwnew .cwm-cat > summary{justify-content:space-between;cursor:pointer;list-style:none;}
body.cwnew .cwm-cat > summary::-webkit-details-marker{display:none;}
body.cwnew .cwm-cat > summary::after{content:"";width:13px;height:13px;background:no-repeat center/13px 13px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235c4a9e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 9 12 16 19 9'/%3E%3C/svg%3E");transition:transform .2s ease;}
body.cwnew .cwm-cat[open] > summary::after{transform:rotate(180deg);}
body.cwnew .cwm-sub{display:flex;flex-direction:column;padding:0 2px 10px 14px;border-left:2px solid var(--violet-tint);margin-left:2px;}
body.cwnew .cwm-sub a{font-weight:var(--fw-med);font-size:16px;color:var(--ink-60);text-decoration:none;padding:11px 0;min-height:44px;display:flex;align-items:center;}
body.cwnew .cwm-sub a:hover{color:var(--violet);}
body.cwnew .cwm-foot{margin-top:auto;padding-top:22px;display:flex;flex-direction:column;gap:10px;flex:0 0 auto;}
body.cwnew .cwm-foot .tel{font-family:var(--font-mono);font-size:20px;color:var(--ink);text-decoration:none;}
body.cwnew .cwm-foot .mail{font-family:var(--font-mono);font-size:14px;color:var(--ink-60);text-decoration:none;}
body.cwnew .cwm-foot .cwh-btn{justify-content:center;padding:16px;font-size:16px;margin-top:6px;}

/* ===== responsive ===== */
@media (max-width:980px){
  body.cwnew .cwh-nav,body.cwnew .cwh-actions > .cwh-search,body.cwnew .cwh-actions > .cwh-btn{display:none;}
  body.cwnew .cwh-burger{display:flex;}
  body.cwnew .cwh-msearch{display:block;}
  body.cwnew .cwh-main{gap:14px;justify-content:space-between;}
  body.cwnew .cwh-actions{gap:0;}
}
@media (max-width:600px){body.cwnew .cwh-top{display:none;}}
@media (prefers-reduced-motion:reduce){
  body.cwnew .cwh-drop,body.cwnew .cwh-cat > a::after,body.cwnew .cwh-burger span,body.cwnew .cwnew-mnav,body.cwnew .cwh-nav > a,body.cwnew .cwh-search input,body.cwnew .cwh-btn{transition:none;}
}
