/* ================================================================
   EffiQ Theme — Navigation
   Fixed header, dropdown menus, burger button, off-canvas mobile
   panel with accordion dropdowns, overlay backdrop, nav CTA button.
   Loaded on every page.
================================================================ */

/* ── FIXED HEADER ───────────────────────────────────────────────── */
#nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(6,13,31,.88); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid rgba(255,255,255,.07); transition: background .3s, border-color .3s, box-shadow .3s; }
#nav.light    { background: rgba(255,255,255,.97); border-bottom-color: var(--bd); }
#nav.scrolled { box-shadow: 0 4px 32px rgba(0,0,0,.2); }

/* ── NAV WRAPPER ────────────────────────────────────────────────── */
.nw { max-width: var(--mx); margin: 0 auto; padding: 0 52px; height: 68px; display: flex; align-items: center; gap: 8px; transition: height .3s; }
#nav.scrolled .nw { height: 54px; }

/* ── LOGO ───────────────────────────────────────────────────────── */
.logo { display: flex; align-items: center; margin-right: 24px; padding: 0; background: none; cursor: pointer; text-decoration: none; }
.logo img { height: 50px; width: auto; display: block; transition: filter .3s, height .3s; }
#nav:not(.scrolled) .logo img { filter: brightness(0) invert(1); }
#nav.scrolled .logo img { height: 36px; }

/* ── NAV LINKS LIST (desktop) ───────────────────────────────────── */
.nl { display: flex; align-items: center; gap: 2px; list-style: none; flex: 1; }
.nl > li > a { font-family: var(--fh); font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.7); padding: 7px 12px; border-radius: 8px; display: flex; align-items: center; gap: 4px; transition: color .2s, background .2s; white-space: nowrap; }
.nl > li > a:hover { color: #fff; background: rgba(255,255,255,.08); }
#nav.light .nl > li > a       { color: var(--mid); }
#nav.light .nl > li > a:hover { color: var(--ink); background: var(--gy); }

/* ── DROPDOWN ───────────────────────────────────────────────────── */
.hdd { position: relative; }
.arr { width: 10px; height: 6px; display: inline-block; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(255,255,255,.5)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; transition: transform .2s; }
#nav.light .arr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2397A8BB' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }
.hdd:hover .arr { transform: rotate(180deg); }

.dd { position: absolute; top: 100%; left: -14px; padding-top: 8px; z-index: 100; pointer-events: none; }
.dd-inner { background: var(--wh); border: 1px solid var(--bd); border-radius: 14px; padding: 8px; min-width: 250px; box-shadow: 0 20px 50px rgba(11,24,41,.15); opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.hdd:hover .dd-inner { opacity: 1; pointer-events: all; transform: translateY(0); }
.hdd > a { position: relative; }
.hdd > a::after { content: ""; position: absolute; left: -12px; right: -12px; bottom: -10px; height: 18px; }

.ddi { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 9px; transition: background .15s; cursor: pointer; }
.ddi:hover { background: var(--gy); }
.ddd { width: 6px; height: 6px; border-radius: 50%; background: var(--bl); flex-shrink: 0; margin-top: 6px; }
.ddn { font-family: var(--fh); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dds { font-size: 11px; color: var(--lt); margin-top: 2px; }
.dd-sep { height: 1px; background: var(--bd); margin: 4px 0; }

/* ── NAV CTA BUTTON ─────────────────────────────────────────────── */
.ncta { font-family: var(--fh); font-size: 13px; font-weight: 700; background: var(--grad-bl-pur); color: var(--wh); padding: 10px 22px; border-radius: 9px; white-space: nowrap; transition: padding .3s, font-size .3s, opacity .2s, transform .2s, box-shadow .2s; margin-left: 12px; border: none; cursor: pointer; }
.ncta:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(26,115,232,.35); }
#nav.scrolled .ncta { font-size: 12px; }

/* ── MOBILE CTA (inside off-canvas panel, hidden on desktop) ────── */
.nl-cta { display: none; }

/* ── BURGER BUTTON ──────────────────────────────────────────────── */
.burger { display: none; width: 40px; height: 40px; flex-direction: column; justify-content: center; align-items: center; gap: 5px; background: rgba(255,255,255,.08); border-radius: 8px; border: none; cursor: pointer; padding: 0; flex-shrink: 0; margin-left: auto; }
.burger span { display: block; width: 18px; height: 2px; background: rgba(255,255,255,.8); border-radius: 2px; transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .25s, width .25s; transform-origin: center; pointer-events: none; }
#nav.light .burger      { background: var(--gy2); }
#nav.light .burger span { background: var(--mid); }

/* hamburger → X */
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; width: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── NAV OVERLAY (dimmed backdrop) ─────────────────────────────── */
.nav-overlay { position: fixed; inset: 0; background: rgba(6,13,31,.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 998; opacity: 0; pointer-events: none; transition: opacity .35s; }
body.menu-open .nav-overlay { opacity: 1; pointer-events: all; }
body.menu-open              { overflow: hidden; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media(max-width:1024px) { .nw { padding: 0 36px; } }

/* ── OFF-CANVAS PANEL (≤ 900px) ────────────────────────────────── */
@media(max-width:900px) {

  /* show burger, hide desktop CTA */
  .burger { display: flex; }
  .ncta   { display: none; }

  /* ── off-canvas panel ── */
  .nl {
    position: fixed;
    top: 68px;
    right: 0;
    height: calc(100dvh - 68px); /* explicit height — inset bottom:0 unreliable inside fixed nav */
    width: min(320px, 82vw);
    flex-direction: column;
    align-items: stretch;
    list-style: none;
    background: #060D1F;
    border-left: 1px solid rgba(255,255,255,.1);
    z-index: 999;               /* below nav bar (1000), above overlay (998) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding-bottom: 32px;
    transform: translateX(110%);
    visibility: hidden;
    transition: transform .4s cubic-bezier(.22,1,.36,1), visibility .4s;
    box-shadow: -20px 0 60px rgba(0,0,0,.5);
  }
  .nl.open {
    transform: translateX(0);
    visibility: visible;
  }

  /* ── mobile link styles ── */
  .nl > li > a {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    padding: 15px 24px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    white-space: normal;
    background: transparent;
    justify-content: space-between;
  }
  .nl > li > a:hover,
  .nl > li > a:focus { background: rgba(255,255,255,.05); color: rgba(255,255,255,.9); }

  /* active accordion parent */
  .hdd.mob-open > a      { color: #fff; background: rgba(26,115,232,.08); }
  .hdd.mob-open > a .arr { transform: rotate(180deg); }
  .hdd:hover .arr        { transform: none; } /* disable hover rotation at mobile */

  /* ── dropdowns become inline accordions ── */
  .hdd          { position: static; }
  .hdd > a::after { display: none; }
  .dd           { position: static; padding: 0; }
  .dd-inner {
    /* reset desktop positioning */
    position: static;
    opacity: 1;
    pointer-events: all;
    transform: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: rgba(255,255,255,.03);
    padding: 0;
    min-width: 0;
    /* accordion animation */
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s cubic-bezier(.22,1,.36,1);
  }
  .hdd:hover .dd-inner    { max-height: 0; }    /* suppress touch-hover flicker */
  .hdd.mob-open .dd-inner { max-height: 600px; }

  /* indented dropdown items on mobile */
  .ddi       { padding: 11px 24px 11px 40px; border-radius: 0; }
  .ddi:hover { background: rgba(255,255,255,.05); }
  .ddn       { color: rgba(255,255,255,.65); font-size: 13px; }
  .dds       { color: rgba(255,255,255,.3); }

  /* separator lines inside accordion */
  .dd-sep { background: rgba(255,255,255,.08); margin: 2px 0; }

  /* ── mobile CTA at panel bottom ── */
  .nl-cta            { display: block; margin-top: auto; padding: 24px 24px 0; border-top: 1px solid rgba(255,255,255,.08); }
  .nl-cta a.btn-grad { display: block; text-align: center; background: #fff; border-radius: 8px; color: var(--ink); }
}

@media(max-width:640px) {
  .nw { padding: 0 20px; }
  .nl { width: min(300px, 88vw); }
}
