/* Shared Hydro Royal header/menu styles */
:root {
  --navy: #0b1f36;
  --navy-2: #102a47;
  --royal: #1f8fd6;
  --royal-dark: #1168a8;
  --royal-light: #dfeffa;
  --gold: #c8a25d;
  --gold-light: #e1c88f;
  --white: #ffffff;
  --off-white: #f8fbfe;
  --silver: #eef3f8;
  --text: #23384a;
  --muted: #65798a;
  --border: rgba(11, 31, 54, 0.10);
  --shadow: 0 18px 50px rgba(11, 31, 54, 0.12);
  --radius: 24px;
  --max: 1240px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: "Manrope", Arial, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.72;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.container {
  width: min(92%, var(--max));
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
}

.topbar {
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow-x: clip;
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
}

.topbar-left {
  justify-self: start;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.topbar-center {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
  min-width: 0;
}

.topbar-center span {
  font-size: 14px;
  font-weight: 700;
}

.pentair-logo {
  max-height: 30px;
  width: auto;
  background: rgba(255,255,255,0.95);
  border-radius: 4px;
  padding: 4px 8px;
}

.topbar-phone {
  justify-self: end;
  text-align: right;
  line-height: 1.1;
}

.topbar-phone small {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  margin-bottom: 4px;
}

.topbar-phone a {
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  white-space: nowrap;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  overflow: visible;
}

.header-inner {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 18px 0;
}

.logo img {
  max-height: 82px;
  width: auto;
}

.nav-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  overflow: visible;
}

.mobile-toggle {
  display: none;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 8px 20px rgba(11,31,54,0.06);
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
}

.main-nav {
  position: relative;
  width: 100%;
  overflow: visible;
}

.menu {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.menu > li {
  position: relative;
}

.menu > li > .menu-link-row {
  display: flex;
  align-items: center;
  position: relative;
}

.menu > li > .menu-link-row > a {
  display: inline-flex;
  align-items: center;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--navy);
  white-space: nowrap;
  position: relative;
}

.menu > li > .menu-link-row > a:after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: 4px;
  width: calc(100% - 20px);
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--royal));
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.25s ease;
}

.menu > li:hover > .menu-link-row > a:after,
.menu > li:focus-within > .menu-link-row > a:after {
  transform: scaleX(1);
}

.submenu-toggle {
  display: none;
  width: 34px;
  height: 34px;
  margin-right: 4px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
}

.submenu-toggle:hover {
  background: var(--silver);
}

.submenu,
.mega-menu {
  list-style: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(11,31,54,0.16);
  padding: 14px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.22s ease;
  z-index: 1200;
}

.submenu {
  min-width: 290px;
}

.mega-menu {
  width: min(980px, calc(100vw - 40px));
  padding: 20px;
}

.menu > li:hover > .submenu,
.menu > li:focus-within > .submenu,
.menu > li:hover > .mega-menu,
.menu > li:focus-within > .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.products-item {
  position: static;
}

.products-item .mega-menu {
  left: 50%;
  right: auto;
  top: calc(100% + 12px);
  transform: translateX(-50%) translateY(10px);
}

.menu > li.products-item:hover > .mega-menu,
.menu > li.products-item:focus-within > .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.submenu li a,
.mega-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  transition: 0.2s ease;
}

.submenu li a:hover,
.mega-menu a:hover {
  background: var(--silver);
  color: var(--royal-dark);
}

.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.mega-col h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--gold);
  margin-bottom: 8px;
  padding: 0 12px;
  font-weight: 800;
}

@media (max-width: 1240px) {
  .menu > li > .menu-link-row > a {
    padding: 12px 8px;
    font-size: 13px;
  }
}

@media (max-width: 1080px) {
  .topbar-inner {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
    gap: 10px;
  }

  .topbar-center {
    position: static;
    transform: none;
    white-space: normal;
  }

  .topbar-phone {
    text-align: center;
    justify-self: center;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    gap: 16px;
  }

  .logo img {
    max-height: 72px;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    display: none;
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(11,31,54,0.10);
    padding: 12px 0 18px;
  }

  .main-nav.active {
    display: block;
  }

  .menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .menu > li {
    width: 100%;
    border-bottom: 1px solid rgba(11,31,54,0.06);
  }

  .menu > li > .menu-link-row {
    width: 100%;
    justify-content: space-between;
  }

  .menu > li > .menu-link-row > a {
    flex: 1;
    padding: 16px 20px;
    font-size: 15px;
  }

  .menu > li > .menu-link-row > a:after {
    display: none;
  }

  .submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .submenu,
  .mega-menu,
  .products-item .mega-menu {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    min-width: 100%;
    margin: 0;
    padding: 0 12px 14px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    background: transparent;
  }

  .menu > li.open > .submenu,
  .menu > li.open > .mega-menu {
    display: block;
  }

  .mega-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    width: 94%;
  }

  .logo img {
    max-height: 64px;
  }

  .topbar-phone a {
    font-size: 22px;
  }
}
