/* ChargeWiseHub unified navigation — added 29 Oct 2026
   Replaces two broken header implementations:
   - pages whose menu buttons had no dropdown and did nothing on click
   - pages whose nav links were hidden by a stray CSS rule
   Works with no JavaScript. Old headers are hidden. */

/* hide the old, broken navigation on every template */
header.sticky,
header[class*="sticky"],
nav:not(#cwh-nav):not(.breadcrumb):not([aria-label="Breadcrumb"]){display:none !important}
/* hide every old site header variant, but never an article header that holds the headline */
header[class*="sticky"]:not(:has(h1)),
header.nav-wrap:not(:has(h1)),
header.site-header:not(:has(h1)),
header:has(.nav-inner):not(:has(h1)),
header:has(.header-inner):not(:has(h1)),
header:has(nav):not(:has(h1)){display:none !important}

#cwh-nav{
  position:sticky;top:0;z-index:9999;
  display:flex;align-items:center;gap:2px;
  height:58px;padding:0 14px;
  background:#02080f;border-bottom:1px solid #14323f;
  overflow:visible;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}
#cwh-nav::-webkit-scrollbar{display:none}
#cwh-nav .cwh-logo{
  font-family:'Rajdhani',system-ui,sans-serif;font-size:19px;font-weight:700;
  color:#00d4ff;text-decoration:none;white-space:nowrap;margin-right:10px;letter-spacing:.5px;
}
#cwh-nav .cwh-logo span{color:#eaf7ff}
#cwh-nav .cwh-item{position:relative;display:inline-block;flex:0 0 auto}
#cwh-nav a.cwh-link,
#cwh-nav .cwh-trigger{
  display:inline-flex;align-items:center;gap:5px;height:36px;padding:0 11px;
  font-size:14px;font-weight:500;line-height:1;color:#a8bccb;text-decoration:none;
  white-space:nowrap;border:0;background:transparent;cursor:pointer;border-radius:8px;
  font-family:inherit;
}
#cwh-nav a.cwh-link:hover,
#cwh-nav .cwh-item:hover .cwh-trigger,
#cwh-nav .cwh-item:focus-within .cwh-trigger{color:#04141c;background:#00d4ff}
#cwh-nav a.cwh-link.cwh-amazon{color:#04141c;background:#ffb703;font-weight:700;margin-left:6px}
#cwh-nav a.cwh-link.cwh-amazon:hover{background:#ffc93c}
#cwh-nav .cwh-car{font-size:8px;opacity:.75;transform:translateY(-1px)}
#cwh-nav .cwh-sub{
  position:absolute;top:calc(100% - 2px);left:0;min-width:252px;
  background:#061520;border:1px solid #14323f;border-radius:12px;padding:8px;
  box-shadow:0 18px 44px rgba(0,0,0,.6);
  display:none;flex-direction:column;gap:1px;
}
#cwh-nav .cwh-item:hover .cwh-sub,
#cwh-nav .cwh-item:focus-within .cwh-sub,
#cwh-nav .cwh-item.cwh-open .cwh-sub{display:flex}
#cwh-nav .cwh-sub a{
  display:block;padding:9px 11px;border-radius:8px;
  font-size:13.5px;line-height:1.35;font-weight:500;
  color:#c6d8e4;text-decoration:none;white-space:normal;
}
#cwh-nav .cwh-sub a:hover{background:#0e2b3c;color:#00d4ff}

/* touch and small screens: no hover, so flatten to a scrollable row of top-level links */
@media (max-width:1279px){
  #cwh-nav{height:54px;padding:0 10px;overflow-x:auto;overflow-y:hidden}
  #cwh-nav .cwh-item.cwh-open .cwh-sub{display:flex;position:fixed;left:8px;right:8px;top:56px;min-width:0;max-height:72vh;overflow-y:auto}
  #cwh-nav a.cwh-link,#cwh-nav .cwh-trigger{height:34px;padding:0 9px;font-size:13px}
  #cwh-nav .cwh-logo{font-size:17px;margin-right:6px}
}
@media print{#cwh-nav{display:none}}

#cwh-nav .cwh-bolt{width:17px;height:17px;fill:#00d4ff;vertical-align:-3px;margin-right:2px}

/* comfortable size for the header call to action (appended, wins by order) */
#cwh-nav a.cwh-amazon,#cwh-nav .cwh-amazon{min-height:42px!important;padding:0 18px!important;font-size:.95rem!important;font-weight:600!important;display:inline-flex!important;align-items:center!important;border-radius:10px!important}
#cwh-nav a.cwh-link{min-height:40px;display:inline-flex;align-items:center}
@media(max-width:640px){#cwh-nav a.cwh-amazon,#cwh-nav .cwh-amazon{min-height:40px!important;font-size:.9rem!important;padding:0 14px!important}}

/* ---------- phone menu (added 29 Oct 2026) ---------- */
#cwh-nav .cwh-logo{font-family:'Inter',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;font-weight:800;letter-spacing:-.02em}
.cwh-burger{display:none}
@media (max-width:1279px){
  #cwh-nav{overflow:visible;gap:6px}
  #cwh-nav .cwh-item,#cwh-nav>a.cwh-link{display:none!important}
  #cwh-nav a.cwh-amazon{order:2;margin-left:auto;margin-right:0}
  #cwh-nav .cwh-burger{
    display:inline-flex;order:3;flex-direction:column;align-items:center;justify-content:center;gap:4px;
    width:44px;height:40px;flex:0 0 auto;background:#0a1a26;border:1px solid #14323f;border-radius:10px;cursor:pointer;padding:0;
  }
  #cwh-nav .cwh-burger span{display:block;width:18px;height:2px;background:#cfe6f2;border-radius:2px;transition:transform .2s ease,opacity .2s ease}
  #cwh-nav .cwh-burger[aria-expanded="true"] span:nth-child(1){transform:translateY(6px) rotate(45deg)}
  #cwh-nav .cwh-burger[aria-expanded="true"] span:nth-child(2){opacity:0}
  #cwh-nav .cwh-burger[aria-expanded="true"] span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}
  .cwh-mpanel{display:none;position:fixed;left:0;right:0;top:54px;bottom:0;z-index:9998;
    background:#02080f;border-top:1px solid #14323f;overflow-y:auto;-webkit-overflow-scrolling:touch;
    padding:8px 16px 120px}
  .cwh-mpanel.cwh-open{display:block}
  .cwh-mpanel .cwh-mgroup>a,.cwh-mpanel>a{
    display:block;padding:13px 6px;border-bottom:1px solid rgba(255,255,255,.06);
    color:#e8eef7;text-decoration:none;font-size:16.5px;font-weight:600;line-height:1.3}
  .cwh-mpanel .cwh-mgroup>a{color:#00d4ff}
  .cwh-mpanel .cwh-msub{display:flex;flex-direction:column;padding:2px 0 8px 10px}
  .cwh-mpanel .cwh-msub a{display:block;padding:10px 6px;color:#b9cfe0;text-decoration:none;font-size:15px;line-height:1.35;border-radius:8px}
  .cwh-mpanel .cwh-msub a:active,.cwh-mpanel a:active{background:#0e2b3c}
  .cwh-mpanel .cwh-mamazon{margin:16px 0 8px;display:flex!important;align-items:center;justify-content:center;
    min-height:50px;background:#ffb703;color:#04141c!important;border-radius:12px;font-weight:800;border:0}
  body.cwh-menu-open{overflow:hidden}
}
