/* lift header above page content so dropdowns paint on top */
.elementor-location-header{position:relative;z-index:9999;}
.elementor-location-header .elementor-section,.elementor-location-header .e-con{overflow:visible !important;}

/* Neutralize the Max Mega Menu wrapper that still wraps our injected nav */
#mega-menu-wrap-primary .mega-menu-toggle,
#mega-menu-wrap-primary .mega-menu-toggle-block { display: none !important; }
#mega-menu-wrap-primary,
#mega-menu-wrap-primary > #mega-menu-primary,
ul#mega-menu-primary { display: contents !important; }

/* neutralize theme <button> styling inside our nav */
.bpnav-root .bpnav-burger, .bpnav-root .bpnav-toggle, .bpnav-root .bpnav-close {
  -webkit-appearance: none; appearance: none;
  background: transparent !important; background-image: none !important;
  border: 0 !important; box-shadow: none !important; outline: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none;
}
.bpnav-root .bpnav-burger span { background: #fff !important; }

/* ================= BluePeak custom nav ================= */
.bpnav-root { display: flex; align-items: center; font-family: inherit; }
.bpnav-root *, .bpnav-root *::before, .bpnav-root *::after { box-sizing: border-box; }

/* ---------- shared top list ---------- */
.bpnav-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0; }
.bpnav-item { position: relative; }
.bpnav-root .bpnav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 9px 7px; border-radius: 9px;
  font-size: 17px; font-weight: 500; line-height: 1;
  color: #fff !important; text-decoration: none; white-space: nowrap;
  transition: color .15s, background .15s;
}
.bpnav-root .bpnav-link:hover, .bpnav-root .bpnav-item.is-current > .bpnav-link { color: #fff !important; background: rgba(255,255,255,.09); }
.bpnav-caret { width: 15px; height: 15px; opacity: .7; transition: transform .2s; margin-top: 1px; }
.bpnav-item.has-sub:hover > .bpnav-link .bpnav-caret { transform: rotate(180deg); }
.bpnav-toggle { display: none; }

/* ---------- desktop dropdown / mega panel ---------- */
.bpnav-panel {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(6px);
  min-width: 300px;
  background: #fff; border: 1px solid #e7ebf1; border-radius: 16px;
  box-shadow: 0 24px 54px -16px rgba(12,20,36,.32);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 1000;
}
/* invisible hover-bridge covering the gap so the panel stays open while the cursor travels to it */
.bpnav-panel::before { content: ""; position: absolute; left: -12px; right: -12px; top: -18px; height: 20px; }
.bpnav-panel::after {
  content: ""; position: absolute; top: -6px; left: 50%; margin-left: -6px;
  width: 12px; height: 12px; background: #fff; border-left: 1px solid #e7ebf1; border-top: 1px solid #e7ebf1;
  transform: rotate(45deg); border-radius: 3px 0 0 0;
}
.bpnav-item.has-sub:hover > .bpnav-panel,
.bpnav-item.has-sub:focus-within > .bpnav-panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0);
}
.bpnav-panel-inner { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 12px; position: relative; }
.bpnav-panel.bpnav-mega { min-width: 350px; }
.bpnav-panel.bpnav-mega.bpnav-cols-2 { min-width: 620px; }
.bpnav-panel.bpnav-cols-2 .bpnav-panel-inner { grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.bpnav-panel.bpnav-cols-2 .bpnav-panel-inner::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 50%; width: 1px; background: #eef1f5; }

.bpnav-mega-item { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 12px; text-decoration: none; transition: background .13s; }
.bpnav-mega-item:hover { background: #f4f8fd; }
.bpnav-mega-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; background: #e7f1fd; display: flex; align-items: center; justify-content: center; color: #0b6fbc; transition: background .14s, color .14s; }
.bpnav-mega-item:hover .bpnav-mega-ic { background: #0b8bec; color: #fff; }
.bpnav-mega-ic svg { width: 21px; height: 21px; }
.bpnav-mega-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bpnav-mega-title { font-size: 14.5px; font-weight: 650; color: #17203a; line-height: 1.25; }
.bpnav-mega-desc { font-size: 12.5px; color: #7a869b; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bpnav-mega-all { display: block; padding: 13px 18px; border-top: 1px solid #eef1f5; border-radius: 0 0 16px 16px; font-size: 13.5px; font-weight: 650; color: #0b8bec; text-decoration: none; transition: background .13s, color .13s; }
.bpnav-mega-all:hover { background: #f7fafd; color: #0a6fbc; }

/* ---------- burger / drawer chrome (hidden on desktop) ---------- */
.bpnav-burger, .bpnav-backdrop, .bpnav-drawerhead, .bpnav-drawercta { display: none; }

/* ========================= MOBILE / TABLET (<=1024px): drawer ========================= */
@media (max-width: 1024px) {
  .bpnav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 10px; margin: 0; cursor: pointer; border-radius: 10px;
  }
  .bpnav-burger span { display: block; height: 2px; width: 24px; border-radius: 2px; transition: transform .25s, opacity .2s; }

  .bpnav {
    position: fixed; top: 0; right: 0; z-index: 100000;
    width: min(88vw, 400px); height: 100dvh; max-height: 100vh;
    background: #fff; box-shadow: -18px 0 50px -20px rgba(0,0,0,.4);
    display: flex; flex-direction: column;
    transform: translateX(105%); transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto; overscroll-behavior: contain;
  }
  body.bpnav-open .bpnav { transform: translateX(0); }

  .bpnav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 99999; pointer-events: none;
    background: rgba(12,20,36,.5); opacity: 0; transition: opacity .3s;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  }
  body.bpnav-open .bpnav-backdrop { opacity: 1; pointer-events: auto; }

  .bpnav-drawerhead { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 18px; border-bottom: 1px solid #f0f2f5; flex: 0 0 auto; }
  .bpnav-drawerlogo { height: 30px; width: auto; }
  .bpnav-drawerlogo-txt { font-size: 22px; font-weight: 800; letter-spacing: .14em; color: #131836; }
  .bpnav-close { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .bpnav-close .bpnav-x { font-size: 34px; line-height: 1; color: #9aa3b2; margin-top: -4px; transition: color .15s; }
  .bpnav-close:hover .bpnav-x { color: #17203a; }

  .bpnav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 6px 22px 12px; flex: 1 1 auto; }
  .bpnav-item { border-bottom: 1px solid #f0f2f5; }
  .bpnav-root .bpnav-link { color: #17203a !important; font-size: 17px; font-weight: 600; padding: 19px 2px; border-radius: 0; flex: 1 1 auto; justify-content: flex-start; background: transparent !important; }
  .bpnav-root .bpnav-item.is-current > .bpnav-link, .bpnav-root .bpnav-link:hover { color: #0b8bec !important; }
  .bpnav-link .bpnav-caret { display: none; }

  .bpnav-item.has-sub { display: flex; flex-wrap: wrap; align-items: center; }
  .bpnav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 60px; margin: 0; padding: 0; cursor: pointer; color: #b3bcca; }
  .bpnav-toggle .bpnav-caret { width: 20px; height: 20px; opacity: 1; transition: transform .25s ease; }
  .bpnav-toggle[aria-expanded="true"] .bpnav-caret { transform: rotate(180deg); color: #0b8bec; }

  /* accordion */
  .bpnav-panel {
    position: static; transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    min-width: 0 !important; width: 100%; flex-basis: 100%;
    background: #f7f9fc; border: 0; border-radius: 12px; box-shadow: none;
    max-height: 0; overflow: hidden; transition: max-height .3s ease; margin: 0 0 6px;
  }
  .bpnav-panel::before, .bpnav-panel::after { display: none; }
  .bpnav-item.is-open > .bpnav-panel { max-height: 900px; }
  .bpnav-panel.bpnav-cols-2 .bpnav-panel-inner { grid-template-columns: 1fr; }
  .bpnav-panel.bpnav-cols-2 .bpnav-panel-inner::before { display: none; }
  .bpnav-panel-inner { padding: 6px; gap: 0; }
  .bpnav-mega-item { padding: 10px 10px; }
  .bpnav-mega-ic { width: 38px; height: 38px; border-radius: 10px; background: #e7f1fd; }
  .bpnav-mega-ic svg { width: 19px; height: 19px; }
  .bpnav-mega-title { font-size: 15px; }
  .bpnav-mega-desc { font-size: 12.5px; }
  .bpnav-mega-all { padding: 12px 12px; border-top: 1px solid #e6ebf2; }

  .bpnav-drawercta { display: block; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid #eef1f5; flex: 0 0 auto; }
  .bpnav-cta { display: block; text-align: center; padding: 15px 20px; border-radius: 12px; background: #0b8bec; color: #fff; font-size: 16px; font-weight: 700; text-decoration: none; transition: background .15s; }
  .bpnav-cta:hover { background: #0a76c9; }

  body.bpnav-open { overflow: hidden; }
}

/* desktop-only nav offset */
@media (min-width: 1025px) {
  .bpnav-root { margin-top: 20px; margin-left: 15px; }
}
