/* WPSlash sticky header + Hyperzod-style mega menu */

.wps-header {
  position: sticky;
  top: 0;
  z-index: 10050; /* above promo banners */
  min-height: var(--wps-header-height, 72px);
  height: auto;
  overflow: visible;
  background: var(--wps-header-bg-solid, #fff);
  border-bottom: 1px solid var(--wps-header-border);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  font-family: var(--wps-font);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.wps-header.is-scrolled {
  box-shadow: var(--wps-shadow-sm);
}

.wps-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--wps-header-height, 72px);
  max-width: var(--wps-max-w, 1180px);
  margin: 0 auto;
  padding: 0 24px;
  overflow: visible;
}

.wps-header .navbar-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.wps-header .navbar-brand img {
  height: 32px;
  width: auto;
  display: block;
}

.wps-desktop-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

.wps-nav-list {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 2px;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible;
  min-height: var(--wps-header-height, 72px);
}

.wps-nav__item {
  position: relative;
  list-style: none !important;
  margin: 0 !important;
  display: flex;
  align-items: stretch;
}

.wps-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: var(--wps-radius, 10px);
  font-size: 14px;
  font-weight: 600;
  color: var(--wps-header-text) !important;
  text-decoration: none !important;
  transition: color .15s ease, background .15s ease;
  white-space: nowrap;
  background: transparent !important;
  /* Full header height — no hover gap between link and mega panel */
  min-height: var(--wps-header-height, 72px);
}

.wps-nav__link:hover,
.wps-nav__item.is-active > .wps-nav__link,
.wps-mega__item.is-open > .wps-nav__link,
.wps-mega__item:hover > .wps-nav__link {
  color: var(--wps-header-text-hover) !important;
  background: var(--wps-bg-hover) !important;
}

.wps-nav__chev {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  opacity: .7;
  flex-shrink: 0;
}

/* Kill legacy Tailwind / theme caret (▼) — we use .wps-nav__chev only */
.wps-header .menu-item-has-children > a::after,
.wps-header .menu-item-has-children > a::before,
.wps-desktop-nav .menu-item-has-children > a::after,
.wps-desktop-nav .menu-item-has-children > a::before,
.wps-mobile-drawer .menu-item-has-children > a::after,
.wps-mobile-drawer .menu-item-has-children > a::before {
  content: none !important;
  display: none !important;
  margin: 0 !important;
  border: 0 !important;
}

.wps-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.wps-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--wps-radius, 10px);
  background: var(--wps-accent);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background .15s ease;
}

.wps-header-cta:hover {
  background: var(--wps-accent-hover);
  color: #fff !important;
}

/* Full-width mega panel — positioned against sticky .wps-header */
.wps-mega__item {
  position: static;
}

.wps-mega__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  /* Bridge sits flush under header; no translateY gap that breaks hover */
  padding: 8px 24px 20px;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: none;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 10060;
}

.wps-mega__panel::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -8px;
  height: 16px;
}

.wps-mega__item:hover > .wps-mega__panel,
.wps-mega__item:focus-within > .wps-mega__panel,
.wps-mega__item.is-open > .wps-mega__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wps-mega__inner {
  max-width: var(--wps-max-w, 1180px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid var(--wps-dropdown-border);
  border-radius: var(--wps-radius-lg, 14px);
  box-shadow: var(--wps-dropdown-shadow);
}

.wps-mega__col {
  min-width: 0;
}

/* Leaf product cards (2-level menus like Plugins → FoodMaster) */
.wps-mega__col > .wps-mega__col-title {
  display: block;
  padding: 14px 16px;
  border-radius: var(--wps-radius, 10px);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--wps-ink) !important;
  text-decoration: none !important;
  background: var(--wps-bg-alt);
  border: 1px solid transparent;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  margin: 0;
  letter-spacing: 0;
}

.wps-mega__col > .wps-mega__col-title:hover {
  border-color: var(--wps-border-2);
  background: #fff;
  color: var(--wps-teal) !important;
}

.wps-mega__col-desc {
  margin: 6px 16px 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--wps-text-3);
}

/* Nested columns keep uppercase labels */
.wps-mega__col:has(.wps-mega__links) > .wps-mega__col-title {
  background: transparent;
  border: 0;
  padding: 4px 8px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wps-text-4) !important;
}

.wps-mega__links,
.wps-mega__sublinks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wps-mega__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--wps-radius, 10px);
  text-decoration: none;
  transition: background .15s ease;
}

.wps-mega__link:hover {
  background: var(--wps-dropdown-hover);
}

.wps-mega__link-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wps-text);
}

.wps-mega__link-desc {
  font-size: 12px;
  color: var(--wps-text-3);
  line-height: 1.4;
}

/* Hamburger */
.wps-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--wps-radius, 10px);
  cursor: pointer;
}

.wps-hamburger:hover { background: var(--wps-bg-hover); }

.wps-hamburger-bars {
  position: relative;
  width: 20px;
  height: 14px;
}

.wps-hamburger-bars span {
  position: absolute;
  left: 0;
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--wps-header-text);
  border-radius: 2px;
  transition: all .25s ease;
}

.wps-hamburger-bars span:nth-child(1) { top: 1px; }
.wps-hamburger-bars span:nth-child(2) { top: 6px; }
.wps-hamburger-bars span:nth-child(3) { top: 11px; }

.wps-hamburger.wps-active .wps-hamburger-bars span:nth-child(1) {
  top: 6px; transform: rotate(45deg);
}
.wps-hamburger.wps-active .wps-hamburger-bars span:nth-child(2) { opacity: 0; }
.wps-hamburger.wps-active .wps-hamburger-bars span:nth-child(3) {
  top: 6px; transform: rotate(-45deg);
}

/* Overlay + drawer */
.wps-overlay {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: var(--wps-drawer-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}

.wps-overlay.wps-active {
  opacity: 1;
  visibility: visible;
}

.wps-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  width: min(360px, 92vw);
  height: 100%;
  background: var(--wps-drawer-bg);
  border-left: 1px solid var(--wps-drawer-border);
  transform: translateX(105%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  font-family: var(--wps-font);
}

.wps-mobile-drawer.wps-active { transform: translateX(0); }

.wps-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--wps-drawer-border);
}

.wps-drawer-header img { height: 28px; width: auto; }

.wps-drawer-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--wps-radius);
  background: transparent;
  cursor: pointer;
  color: var(--wps-text-2);
}

.wps-drawer-close svg { width: 20px; height: 20px; }

.wps-drawer-nav {
  flex: 1;
  overflow: auto;
  padding: 12px 12px 24px;
}

.wps-mobile-menu,
.wps-drawer__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wps-drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--wps-radius);
  font-size: 15px;
  font-weight: 600;
  color: var(--wps-text);
  text-decoration: none;
}

.wps-drawer__link:hover { background: var(--wps-bg-hover); }

.wps-drawer__sub {
  max-height: 0;
  overflow: hidden;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1.5px solid var(--wps-border-2);
  transition: max-height .3s ease;
}

.wps-drawer__item.wps-sub-open > .wps-drawer__sub {
  max-height: 800px;
}

.wps-drawer__sub .wps-drawer__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--wps-text-3);
}

.wps-drawer__item.menu-item-has-children > .wps-drawer__link::after {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--wps-text-3);
  border-bottom: 1.5px solid var(--wps-text-3);
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.wps-drawer__item.wps-sub-open > .wps-drawer__link::after {
  transform: rotate(-135deg);
}

.wps-drawer-footer {
  padding: 16px;
  border-top: 1px solid var(--wps-drawer-border);
  text-align: center;
  font-size: 12px;
  color: var(--wps-text-4);
}

.wps-drawer-cta {
  display: block;
  margin: 8px 12px 16px;
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--wps-radius);
  background: var(--wps-accent);
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
}

body.wps-menu-locked { overflow: hidden; }

@media (max-width: 900px) {
  .wps-desktop-nav { display: none !important; }
  .wps-header-actions .wps-header-cta { display: none !important; }
  .wps-hamburger { display: flex; }
  .wps-header-inner { gap: 12px; }
}

/* Kill Tailwind / legacy interference inside header */
.wps-header ul.hidden,
.wps-header .dropdown-menu.hidden {
  display: block !important;
}
