/* Common upper strip only; page/search/catalog content remains native. */
#td316-global-header :where(*:not(svg):not(svg *):not([data-td316-search-slot]):not([data-td316-search-slot] *)) { all:revert; box-sizing:border-box; }
#td316-global-header {
  display:none; position:relative; top:0; z-index:500;
  color:#3b434a; font:400 16px/1.5 TD316HeaderRubik,Rubik,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  background:radial-gradient(ellipse 70% 115px at 50% 0%,#a9bbda 0%,#b5c4df 20%,#d6dfec 45%,#f2f4f7 72%,#f8fafb 100%);
}
html.td316-header-active #td316-global-header { display:block; }
html.td316-header-active .top-panel-wrapper:has(#js-top-panel) { display:none!important; }
body:has(#td316-pilot-card) #td316-global-header { display:none!important; }
#td316-global-header.is-scrolled { position:fixed; left:0; right:0; width:auto; background:rgba(244,247,250,.5); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); box-shadow:0 3px 14px rgba(36,73,112,.12); }
#td316-global-header [hidden] { display:none!important; }
#td316-global-header .gh-inner { max-width:1320px; min-height:86px; margin:auto; padding:7px 52px; display:flex; align-items:center; gap:12px; }
#td316-global-header .gh-brand { position:relative; display:block; flex:0 0 195px; width:195px; height:54px; padding:6px; }
#td316-global-header .gh-brand a,#td316-global-header .gh-brand img { display:block; width:100%; height:100%; }
#td316-global-header .gh-brand img { object-fit:contain; filter:contrast(.88) brightness(1.04); opacity:.92; border:0; }
#td316-global-header .header-nav { display:flex; align-items:center; flex:0 1 auto; font-size:13px; font-weight:500; line-height:1.3; text-transform:uppercase; white-space:nowrap; }
#td316-global-header .header-nav a { color:inherit; text-decoration:none; font:inherit; }
#td316-global-header .header-nav>a:hover { color:#007062; }
#td316-global-header .gh-phone { margin-left:auto; display:flex; flex:none; align-items:center; gap:7px; color:inherit; text-decoration:none; white-space:nowrap; font-size:13px; }
#td316-global-header .gh-phone svg { width:23px; height:23px; flex:none; }
#td316-global-header .gh-cart { display:flex; flex:none; align-items:center; gap:5px; color:inherit; text-decoration:none; }
#td316-global-header .gh-cart svg { width:26px; height:26px; }
#td316-global-header .gh-cart b { display:grid; place-items:center; min-width:20px; height:20px; border-radius:50%; background:#fff; font-size:10px; font-weight:400; }
#td316-global-header .gh-search-toggle { display:grid; place-items:center; flex:0 0 30px; width:30px; height:38px; margin-left:4px; padding:4px; border:0; border-radius:6px; background:transparent; color:inherit; cursor:pointer; }
#td316-global-header .gh-search-toggle svg { width:22px; height:22px; }
#td316-global-header .gh-search-drawer { position:absolute; right:52px; top:100%; z-index:30; width:440px; max-width:calc(100vw - 32px); padding:16px; border:1px solid #e3e9ed; border-radius:12px; background:#fff; box-shadow:0 17px 40px rgba(27,58,84,.16); }
#td316-global-header .gh-search-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; font-size:14px; }
#td316-global-header .gh-search-heading strong { font-weight:500; }
#td316-global-header .gh-search-close { display:grid; place-items:center; width:28px; height:28px; border:0; border-radius:5px; background:#f3f6f8; color:inherit; font:400 24px/1 Arial,sans-serif; cursor:pointer; }
#td316-global-header [data-td316-search-slot] { min-width:0; }
#td316-global-header .top-panel__search { display:block!important; width:100%!important; max-width:none!important; margin:0!important; padding:0!important; }
#td316-global-header [data-td316-search-slot] form { display:flex; gap:8px; margin:0; width:100%; }
#td316-global-header [data-td316-search-slot] input:not([type=submit]):not([type=hidden]) { display:block; width:100%; min-width:0; min-height:42px; padding:10px 40px; border:1px solid #b7c8d8; border-radius:6px; background:#fff; color:#3b434a; font-family:inherit; font-size:14px; line-height:1.4; font-weight:400; }
#td316-global-header .gh-search-fallback label { display:block; flex:1; font-size:12px; }
#td316-global-header .gh-search-fallback button { display:block; padding:8px 12px; border:1px solid #b7c8d8; border-radius:6px; background:#e8f0f8; color:#1d497c; font:inherit; cursor:pointer; }
#td316-global-header a:focus-visible,#td316-global-header button:focus-visible,#td316-global-header input:focus-visible { outline:2px solid #416da4; outline-offset:3px; }
@media(min-width:1101px) and (max-width:1250px) {
  #td316-global-header .gh-inner { gap:9px; }
  #td316-global-header .header-nav { font-size:11px; }
}
@media(max-width:850px) { #td316-global-header .gh-inner { min-height:72px; padding:10px 20px; gap:12px; } #td316-global-header .gh-brand { flex-basis:170px; width:170px; } }
@media(max-width:520px) {
  #td316-global-header .gh-inner { padding:9px 14px; gap:9px; }
  #td316-global-header .gh-brand { flex-basis:145px; width:145px; }
  #td316-global-header .gh-phone { margin-left:auto; }
  #td316-global-header .gh-phone span { display:none; }
  #td316-global-header .gh-cart svg { width:23px; height:23px; }
  #td316-global-header .gh-search-drawer { left:14px; right:14px; width:auto; max-width:none; }
}
@media print { #td316-global-header { display:none!important; } }

#td316-global-header .gh-inner { position:relative; }
#td316-global-header .header-nav { gap:12px; }
#td316-global-header .gh-nav-toggle { display:none; }
#td316-global-header .gh-nav-group { position:relative; flex:none; }
#td316-global-header .gh-nav-group > summary {
  display:flex; align-items:center; gap:7px; padding:14px 0;
  color:inherit; font:inherit; text-transform:inherit; white-space:nowrap;
  list-style:none; cursor:pointer;
}
#td316-global-header .gh-nav-group > summary::-webkit-details-marker { display:none; }
#td316-global-header .gh-nav-group > summary:hover { color:#007062; }
#td316-global-header .gh-nav-chevron { width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); margin-top:-3px; }
#td316-global-header .gh-nav-group[open] .gh-nav-chevron { transform:rotate(225deg); margin-top:3px; }
#td316-global-header .gh-nav-panel {
  display:block; position:absolute; top:100%; left:0; z-index:20;
  width:320px; max-width:calc(100vw - 32px); padding:8px;
  border:1px solid #e3e9ed; border-radius:12px; background:#fff;
  box-shadow:0 17px 40px rgba(27,58,84,.16); color:#253844;
  text-transform:none; white-space:normal; font-size:14px; font-weight:400;
}
#td316-global-header .gh-nav-group:not([open]) > .gh-nav-panel { display:none; }
#td316-global-header .gh-nav-delivery { left:auto; right:0; }
#td316-global-header .gh-nav-panel > a:not(.gh-nav-reference-card) {
  display:block; padding:9px 12px; border-radius:7px; color:#253844;
  font-size:14px; line-height:1.4; text-decoration:none;
}
#td316-global-header .gh-nav-panel > a:not(.gh-nav-reference-card):hover,
#td316-global-header .gh-nav-panel > a:not(.gh-nav-reference-card):focus-visible { background:#eaf4fb; color:#0b5a9e; }
#td316-global-header .gh-nav-disabled { display:block; padding:9px 12px; color:#71818c; font-size:13px; line-height:1.4; font-style:italic; }
#td316-global-header .gh-nav-caption { display:block; padding:7px 10px 12px; color:#626785; font-size:10px; letter-spacing:.08em; text-transform:uppercase; }
#td316-global-header a.gh-nav-reference-card {
  display:flex; align-items:center; gap:10px; padding:14px 10px;
  border:1px solid #626785; border-radius:12px; background:#eaf8fc;
  color:#28334a; text-decoration:none;
}
#td316-global-header a.gh-nav-reference-card:hover { background:#dff2fa; color:#28334a; }
#td316-global-header .gh-nav-reference-icon { display:grid; place-items:center; flex:0 0 36px; height:36px; background:#d9eef7; border-radius:9px; }
#td316-global-header .gh-nav-reference-icon svg { width:22px; height:22px; }
#td316-global-header .gh-nav-reference-card strong { display:block; color:#28334a; font-size:14px; font-weight:500; line-height:1.4; }
#td316-global-header .gh-nav-reference-card small { display:block; margin-top:3px; color:#626785; font-size:11px; line-height:1.4; }
#td316-global-header .gh-nav-group > summary:focus-visible,
#td316-global-header .gh-nav-panel a:focus-visible,
#td316-global-header .gh-nav-toggle:focus-visible { outline:2px solid #416da4; outline-offset:3px; }
@media(min-width:1101px) and (max-width:1250px) { #td316-global-header .header-nav { gap:9px; } }
@media(max-width:1100px) {
  #td316-global-header .gh-nav-toggle { display:grid; place-items:center; flex:0 0 34px; width:34px; height:38px; padding:5px; border:0; border-radius:6px; background:transparent; color:#3b434a; cursor:pointer; }
  #td316-global-header .gh-nav-toggle svg { display:block; width:24px; height:24px; }
  #td316-global-header #td316-main-nav {
    display:none; position:absolute; top:100%; left:14px; right:14px; z-index:25;
    flex-direction:column; align-items:stretch; gap:0; padding:8px;
    max-height:calc(100vh - 132px); max-height:calc(100dvh - 132px); overflow:auto;
    border:1px solid #e3e9ed; border-radius:12px; background:#fff;
    box-shadow:0 17px 40px rgba(27,58,84,.16); font-size:13px;
  }
  #td316-global-header #td316-main-nav.is-open { display:flex; }
  #td316-global-header #td316-main-nav > a,
  #td316-global-header .gh-nav-group > summary { display:flex; padding:11px 12px; }
  #td316-global-header .gh-nav-group > summary { justify-content:space-between; }
  #td316-global-header .gh-nav-panel { position:static; width:auto; max-width:none; margin:0 4px 8px; box-shadow:none; }
}

/* Keep the native suggestion renderer; only bound its popup to the drawer. */
#td316-global-header .top-panel__search { position:relative; }
#td316-global-header .title-search-result { position:absolute!important; top:100%!important; left:0!important; right:auto!important; width:100%!important; max-width:100%!important; min-width:0!important; margin:8px 0 0!important; border-radius:10px; background:#fff; box-shadow:0 10px 24px rgba(27,58,84,.14); box-sizing:border-box; }
#td316-global-header .title-search-result table { width:100%; }
#td316-global-header .title-search-result img { max-width:100%; object-fit:contain; }

/* Preserve the existing lower mobile Catalog/Search strip; replace only the upper row. */
@media(max-width:1042px) {
  html.td316-header-active .top-panel-wrapper:has(#js-top-panel) { display:block!important; height:0!important; min-height:0!important; margin:0!important; padding:0!important; overflow:visible!important; }
  html.td316-header-active #js-top-panel .top-panel__thead { display:none!important; }
}


/* Match the category logo's visible front size, without increasing the header. */
#td316-global-header .gh-brand.logo-3d-ready img { opacity:0; }
#td316-global-header .gh-brand canvas { position:absolute; inset:0; display:block; width:100%; height:100%; pointer-events:none; }
@media(max-width:340px) { #td316-global-header .gh-brand { flex-basis:132px; width:132px; } }
body:has(#td316-pilot-card) [data-td316-header-anchor] { height:0!important; }

/* Current category dimensions (custom.css compact-header rules), not obsolete 195px. */
#td316-global-header .gh-brand { flex-basis:160px; width:160px; height:40px; padding:2px; }
@media(min-width:768px) and (max-width:1199px) { #td316-global-header .gh-brand { flex-basis:150px; width:150px; } }
@media(min-width:768px) and (max-width:991px) { #td316-global-header .gh-brand { flex-basis:115px; width:115px; height:36px; } }
@media(max-width:767px) { #td316-global-header .gh-brand { flex-basis:140px; width:140px; height:40px; } }
@media(max-width:359px) { #td316-global-header .gh-brand { flex-basis:112px; width:112px; } }
