/* Everest header: collapsible nav at tablet and mobile widths (<= 1024px).
   The toggle button is injected by assets/js/header-nav.js. Hooks: global classes
   .ew-mainnav (row), .ew-navlinks (link pill), .ew-brand-mark (logo) on header site part 14. */

.ew-nav-toggle { display: none; }

/* Products dropdown (built by header-nav.js inside .ew-navlinks). */
.ew-dd { position: relative; display: flex; flex-wrap: wrap; align-items: center; }
.ew-dd-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 4px 0 -8px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ew-ink, #181322);
  cursor: pointer;
}
.ew-dd-toggle:hover,
.ew-dd-toggle:focus,
.ew-dd-toggle:active { background: var(--ew-plum-100, #F3EFF8); color: var(--ew-plum-900, #32174D); }
.ew-dd-toggle:focus-visible { outline: 2px solid var(--ew-plum-900, #32174D); outline-offset: 1px; }
.ew-dd-toggle svg { transition: transform 160ms ease; }
.ew-dd.is-open .ew-dd-toggle svg { transform: rotate(180deg); }

.ew-dd-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 130;
  min-width: 270px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--ew-border, #E5E7EB);
  border-radius: 13px;
  background: #FFFFFF;
  box-shadow: 0 24px 48px -16px rgba(26, 11, 43, 0.35);
}
.ew-dd.is-open .ew-dd-menu { display: block; }
/* Bridge the 10px gap so the pointer can travel from the link to the menu. */
.ew-dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.ew-dd-menu li { margin: 0; padding: 0; }
.ew-dd-menu a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ew-ink, #181322);
  font-family: var(--ew-font-display, 'Montserrat', sans-serif);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.ew-dd-menu a:hover,
.ew-dd-menu a:focus-visible { background: var(--ew-plum-050, #F8F5FC); color: var(--ew-plum-900, #32174D); }
.ew-dd-menu a:focus-visible { outline: 2px solid var(--ew-plum-900, #32174D); outline-offset: -2px; }
.ew-dd-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
.ew-dd-note { font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--ew-ink-muted, #524C61); }

@media (max-width: 1024px) {
  .ew-js-nav .elementor .ew-mainnav {
    position: relative;
    flex-wrap: nowrap;
  }

  .ew-nav-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 48px;
    height: 48px;
    margin-left: auto;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--ew-plum-900, #32174D);
    font-family: var(--ew-font-display, 'Montserrat', sans-serif);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 160ms ease;
  }
  /* Hello Elementor's reset turns button text white on hover/focus, which hid the bars. */
  .ew-nav-toggle:hover,
  .ew-nav-toggle:focus,
  .ew-nav-toggle:active { background: #FFFFFF; color: var(--ew-plum-900, #32174D); }
  .ew-nav-toggle-bars { position: relative; width: 18px; height: 12px; }
  .ew-nav-toggle-bars i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1), opacity 160ms ease;
  }
  .ew-nav-toggle-bars i:nth-child(1) { top: 0; }
  .ew-nav-toggle-bars i:nth-child(2) { top: 5px; }
  .ew-nav-toggle-bars i:nth-child(3) { top: 10px; }
  .ew-nav-open .ew-nav-toggle-bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .ew-nav-open .ew-nav-toggle-bars i:nth-child(2) { opacity: 0; }
  .ew-nav-open .ew-nav-toggle-bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

  /* Closed: the link pill is hidden. Open: it becomes a full-width panel under the header row. */
  .ew-js-nav .elementor .ew-navlinks { display: none !important; }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks {
    display: flex !important;
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    right: 12px;
    z-index: 120;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 24px 48px -16px rgba(26, 11, 43, 0.45);
  }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks > * { width: 100%; }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks p {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0 16px !important;
    font-size: 14px !important;
  }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks p a { flex: 1; align-self: stretch; display: flex; align-items: center; }
  /* Products dropdown inside the open mobile panel: the chevron expands the list inline. */
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks .ew-dd { flex-wrap: wrap; }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks .ew-dd > p { flex: 1 1 0; }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks .ew-dd-toggle { width: 44px; height: 44px; margin: 0; }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks .ew-dd-menu {
    position: static;
    flex: 1 0 100%;
    min-width: 0;
    margin: 0 0 6px;
    border: 0;
    box-shadow: none;
    background: var(--ew-plum-050, #F8F5FC);
  }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks .ew-dd-menu::before { display: none; }
  .ew-js-nav.ew-nav-open .elementor .ew-navlinks a.e-button-base {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 6px;
  }
}

/* Phones: icon-only toggle (label stays for screen readers) and a brand block that can shrink. */
@media (max-width: 480px) {
  .ew-nav-toggle { width: 48px; padding: 0; }
  .ew-nav-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .ew-js-nav .elementor .ew-mainnav > :first-child { flex: 0 1 auto; min-width: 0; }
  .ew-js-nav .elementor .ew-mainnav > :first-child p { font-size: 15px !important; }
}

@media (max-width: 1024px) and (prefers-reduced-motion: reduce) {
  .ew-nav-toggle-bars i { transition: none; }
}

/* Laptop widths (1025-1500px): the full link row plus the brand lockup is wider than the viewport,
   so the row tightens instead of overflowing. Below 1320px the wordmark beside the logo is dropped;
   the logo already carries the name. */
@media (min-width: 1025px) and (max-width: 1500px) {
  .elementor .ew-mainnav { padding-inline-start: 24px !important; padding-inline-end: 12px !important; gap: 16px !important; }
  .elementor .ew-navlinks > p,
  .elementor .ew-navlinks .ew-dd > p { padding-inline: 7px !important; letter-spacing: 0.02em !important; }
  .elementor .ew-navlinks a.e-button-base { padding-inline: 16px !important; }
}
@media (min-width: 1025px) and (max-width: 1319px) {
  .elementor .ew-mainnav > :first-child > :not(img):not(a) { display: none !important; }
  .elementor .ew-mainnav > :first-child img { width: 72px !important; height: 72px !important; }
}
