/* ================= HEADER ================= */
/* not sticky: the header scrolls away with the page. It stays positioned so the mega panels
   (position:absolute; top:100%) still hang from it and sit above the page content. */
.header{
  position:relative;
  width:100%;
  z-index:200;
  border-bottom:1px solid var(--navy);
}

.header-inner{
  display:flex;
  align-items:stretch;
  width:100%;
}
.logo-panel{
  background:var(--white);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 36px;
  flex-shrink:0;
  border-right:1px solid rgba(28,63,93,.3);
}
.logo-panel img{height:60px;width:auto;}
.logo-fallback{
  display:none;
  align-items:center;
  gap:14px;
}
.logo-mark{width:40px;height:40px;flex-shrink:0;}
.logo-fallback-text{
  font-family:var(--font-head);
  font-weight:800;
  font-size:29px;
  color:var(--navy);
  letter-spacing:-0.01em;
  line-height:1;
}
.logo-fallback-text small{
  display:block;
  font-family:var(--font-body);
  font-weight:500;
  font-size:12px;
  color:var(--navy);
  letter-spacing:.02em;
  margin-top:4px;
}

.nav-stack{
  flex:1 1 auto;
  display:grid;
  grid-template-columns:minmax(0,1fr); /* let the rows shrink to the header width instead of growing to their content */
  grid-template-rows:56px 56px;
  min-width:0;
  width:100%;
}

.top-bar{
  background:var(--navy);
  display:flex;
  align-items:stretch;
  width:100%;
  height:56px;
}
.primary-nav{
  display:flex;
  align-items:stretch;
  margin-right:auto;
  overflow-x:auto;
  scrollbar-width:none;
}
.primary-nav a{
  display:flex;
  align-items:center;
  padding:0 28px;
  font-size:14px;
  font-weight:600;
  color:var(--ink-70);
  white-space:nowrap;
  border-right:1px solid rgba(255,255,255,.14);
  transition:background .15s ease, color .15s ease;
}
.primary-nav a:hover{color:var(--white);}
.primary-nav a.active{
  background:var(--navy-2);
  color:var(--white);
}

.top-bar-actions{
  display:flex;
  align-items:center;
  gap:24px;
  padding:0 32px;
  flex-shrink:0;
}
.contact-detail{
  display:flex;
  align-items:center;
  gap:8px;
  font-family:var(--font-secondary);
  font-size:13px;
  font-weight:500;
  color:var(--ink-70);
  white-space:nowrap;
  transition:color .15s ease;
}
.contact-detail svg{width:14px;height:14px;flex-shrink:0;}
.contact-detail:hover{color:var(--white);}
.contact-divider{
  width:1px;
  height:16px;
  background:rgba(255,255,255,.2);
  flex-shrink:0;
}
.icon-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  color:var(--white);
}
.icon-btn svg{width:18px;height:18px;}

/* no bottom border: the active underline must sit flush against the banner */
.divisions-bar{
  background:var(--white);
  width:100%;
  height:56px;
}
.divisions-bar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:0 28px;
  height:100%;
}
.divisions-nav{
  display:flex;
  align-items:center;
  gap:34px;
  overflow-x:auto;
  height:100%;
  scrollbar-width:none; /* still scrollable on narrow widths, without the bar */
}
.divisions-nav::-webkit-scrollbar,
.primary-nav::-webkit-scrollbar{display:none;}
/* only the top-level links; anchors inside the mega panels have their own styles */
.divisions-nav > a{
  font-size:14px;
  font-weight:500;
  color:var(--navy);
  white-space:nowrap;
}
.divisions-nav > a,
.division-link{transition:opacity .15s ease;}
.divisions-nav > a:hover,
.division-link:hover{opacity:.65;}

/* ---- mega panels (Industrial + Diamond divisions) ---- */
.division-item{
  display:flex;
  align-items:center;
  height:100%;
}
.division-link{
  display:flex;
  align-items:center;
  height:100%;
  font-size:14px;
  font-weight:500;
  color:var(--navy);
  white-space:nowrap;
  position:relative;
}
.division-link.active{font-weight:700;}
/* underline: only while the menu is open, drawn flush with the bottom of the
   header so it meets the panel/banner with no gap */
.division-link::after{
  content:"";
  position:absolute;
  left:0;right:0;
  bottom:0;
  height:2px;
  background:var(--navy);
  transform:scaleX(0);
  transform-origin:left center;
  transition:transform .6s cubic-bezier(.65,0,.35,1);
}
.division-item.open .division-link::after{
  transform:scaleX(1);
  transition-duration:.9s;
}

/*
  Open/close animation: the panel unfolds from its top edge downward with a
  clip-path (slow ease-in-out), its content fades and settles in slightly
  behind it, and it retracts upward on close. clip-path is compositor-friendly
  (no layout per frame). `visibility` is delayed on close so the panel stays
  painted until the retract finishes, then drops out of the tab order.
*/
.mega-panel{
  position:absolute;
  top:100%;
  left:0;
  width:100%;
  background:var(--white);
  border-top:1px solid var(--navy-08);
  border-bottom:1px solid var(--navy-14);
  z-index:180;
  visibility:hidden;
  clip-path:inset(0 0 100% 0);
  transition:
    clip-path .75s cubic-bezier(.65,0,.35,1),
    visibility 0s linear .75s;
}
.division-item.open .mega-panel{
  visibility:visible;
  clip-path:inset(0 0 0 0);
  transition:
    clip-path 1.1s cubic-bezier(.65,0,.35,1),
    visibility 0s linear 0s;
}
.mega-panel-inner{
  display:flex;
  gap:44px;
  max-width:1360px;
  margin:0 auto;
  padding:40px;
  opacity:0;
  transform:translateY(-18px);
  transition:opacity .35s ease, transform .35s ease;
}
.division-item.open .mega-panel-inner{
  opacity:1;
  transform:translateY(0);
  transition:opacity .8s ease .3s, transform 1s cubic-bezier(.22,1,.36,1) .3s;
}
.mega-left{
  flex-shrink:0;
  width:320px;
  padding-right:36px;
  position:relative;
}
.mega-left::after{
  content:"";
  position:absolute;
  top:0; right:0; bottom:0;
  width:1px;
  background:rgba(28,63,93,.2);
}
.mega-left .mega-title{
  font-family:var(--font-head);
  font-weight:700;
  font-size:23px;
  color:var(--navy);
  margin-bottom:18px;
}
.mega-categories{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.mega-categories a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 12px;
  font-size:14px;
  font-weight:600;
  color:var(--navy);
  transition:background .15s ease, color .15s ease;
}
.mega-categories a svg{width:14px;height:14px;opacity:.55;flex-shrink:0;}
.mega-categories a:hover{background:rgba(28,63,93,.08);}
.mega-categories a.active{background:var(--navy);color:var(--white);}
.mega-categories a.active svg{opacity:1;}

/* fixed height so the panel doesn't jump between categories with few / many products */
.mega-right{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  height:460px;
}
/* category name + link to the category page */
.mega-head{
  flex-shrink:0;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:20px;
  padding-bottom:16px;
  margin-bottom:22px;
  border-bottom:1px solid rgba(28,63,93,.14);
  font-family:var(--font-head);
  color:var(--navy);
  margin-right:6px;
}
.mega-head-name{
  font-size:20px;
  font-weight:700;
  letter-spacing:-0.01em;
}
.mega-head-cta{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13.5px;
  font-weight:600;
  white-space:nowrap;
}
.mega-head-cta svg{width:14px;height:14px;transition:transform .2s ease;}
.mega-head:hover .mega-head-cta{text-decoration:underline;}
.mega-head:hover .mega-head-cta svg{transform:translateX(4px);}
.mega-grid{
  flex:1;
  min-height:0;
  display:flex;
  gap:24px;
  flex-wrap:wrap;
  align-content:flex-start;
  overflow-y:auto;
  padding-right:6px;
  scrollbar-width:thin;
  scrollbar-color:rgba(28,63,93,.35) transparent;
}
.mega-grid::-webkit-scrollbar{width:6px;}
.mega-grid::-webkit-scrollbar-track{background:transparent;}
.mega-grid::-webkit-scrollbar-thumb{
  background:rgba(28,63,93,.35);
}
.mega-grid::-webkit-scrollbar-thumb:hover{background:rgba(28,63,93,.55);}
.mega-card{
  display:block;
  width:calc((100% - 48px) / 3);
}

/*
  Category switch: the current cards ease out (.is-leaving), then the new
  category's heading and cards rise in one after another. --base is set by
  header.js (longer when the whole panel is unfolding) and --i is the card index.
*/
.mega-head,
.mega-card{
  animation:megaRise .85s cubic-bezier(.22,1,.36,1) both;
  animation-delay:calc(var(--base, 0s) + var(--i, 0) * 90ms);
}
@keyframes megaRise{
  from{opacity:0;transform:translateY(22px);}
  to{opacity:1;transform:translateY(0);}
}
.mega-right.is-leaving .mega-head,
.mega-right.is-leaving .mega-card{
  animation:none;
  opacity:0;
  transform:translateY(-10px);
  transition:opacity .28s ease, transform .28s ease;
}
.mega-card-thumb{
  display:block;
  background:var(--white);
  border:1px solid rgba(28,63,93,.12);
  overflow:hidden;
  aspect-ratio:4/3;
}
.mega-card-thumb img{
  width:100%;
  height:100%;
  object-fit:contain;
}
.mega-card-fallback{
  display:none;
  align-items:center;
  justify-content:center;
  height:100%;
  font-family:var(--font-head);
  font-weight:700;
  font-size:15px;
  color:var(--navy);
}
.mega-card-title{
  display:block;
  margin-top:16px;
  font-size:16px;
  font-weight:700;
  color:var(--navy);
}
.mega-card-usp{
  display:block;
  margin-top:5px;
  font-family:var(--font-secondary);
  font-size:12px;
  font-weight:600;
  letter-spacing:.02em;
  color:rgba(28,63,93,.6);
}
.mega-card-desc{
  display:block;
  margin-top:8px;
  font-family:var(--font-secondary);
  font-size:13.5px;
  line-height:1.5;
  color:rgba(28,63,93,.65);
}
.mega-view{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:16px;
  font-size:13.5px;
  font-weight:600;
  color:var(--navy);
}
.mega-view svg{width:13px;height:13px;transition:transform .15s ease;}
.mega-card:hover .mega-view{text-decoration:underline;}
.mega-card:hover .mega-view svg{transform:translateX(3px);}
.contact-btn{
  font-size:13px;
  font-weight:600;
  color:var(--white);
  background:var(--navy);
  padding:9px 20px;
  white-space:nowrap;
  flex-shrink:0;
  transition:opacity .15s ease;
}
.contact-btn:hover{opacity:.85;}

.menu-toggle{
  display:none;
  flex-direction:column;
  justify-content:center;
  gap:5px;
  width:28px;
  height:28px;
  flex-shrink:0;
}
.menu-toggle span{
  display:block;
  width:100%;
  height:2px;
  background:var(--white);
  transition:transform .2s ease, opacity .2s ease;
}
.menu-toggle.open span:nth-child(1){transform:translateY(7px) rotate(45deg);}
.menu-toggle.open span:nth-child(2){opacity:0;}
.menu-toggle.open span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

/* ================= HEADER RESPONSIVE ================= */
/* smaller laptops / tablets landscape: keep the icons, drop the phone + email text so nothing overflows */
@media (max-width:1180px){
  .contact-detail span,
  .contact-divider{display:none;}
  .top-bar-actions{gap:20px;padding:0 24px;}
  .primary-nav a{padding:0 20px;}
  .divisions-nav{gap:26px;}
  .divisions-bar-inner{gap:16px;padding:0 20px;}
}

@media (max-width:820px){
  .logo-panel{padding:0 20px;}
  .logo-panel img{height:34px;}
  .top-bar-actions{padding:0 20px;gap:14px;}
  .contact-detail span{display:none;}
  .contact-divider{display:none;}
  .divisions-bar-inner{padding:0 20px;flex-wrap:wrap;gap:12px;row-gap:10px;}
  .mega-panel-inner{padding:26px 22px;}
  .mega-panel-inner{flex-direction:column;gap:24px;}
  .mega-left{width:100%;padding-right:0;}
  .mega-left::after{display:none;}
  .mega-right{height:auto;}
  .mega-grid{gap:16px;overflow-y:visible;}
  .mega-head{margin-right:0;}
  .mega-card{width:calc((100% - 16px) / 2);}
  .primary-nav{
    position:fixed;
    top:0;
    right:0;
    height:100vh;
    width:min(300px,80vw);
    background:var(--navy);
    flex-direction:column;
    align-items:stretch;
    padding:88px 0 28px;
    transform:translateX(100%);
    transition:transform .25s ease;
    z-index:150;
    overflow-x:visible;
    overflow-y:auto;
    margin-right:0;
  }
  .primary-nav.open{transform:translateX(0);}
  .primary-nav a{padding:16px 28px;font-size:16px;border-right:none;border-bottom:1px solid rgba(255,255,255,.1);}
  .divisions-nav{gap:24px;padding:0 20px;}
  .menu-toggle{display:flex;}
}

@media (prefers-reduced-motion: reduce){
  .mega-panel,
  .division-item.open .mega-panel,
  .mega-panel-inner,
  .division-item.open .mega-panel-inner,
  .division-link::after,
  .division-item.open .division-link::after{transition:none;}
  .mega-head,
  .mega-card{animation:none;}
  .mega-right.is-leaving .mega-head,
  .mega-right.is-leaving .mega-card{transition:none;}
}
