/**
 * Thunder EV — Mobile nav (hamburger @ ≤1024px)
 */

:root {
  --tev-mobile-nav-break: 1024px;
  --tev-nav-menu-btn-size: 40px;
  --tev-floating-safe-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

/* —— Hamburger button —— */
.tev-nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tev-nav-menu-btn-size);
  height: var(--tev-nav-menu-btn-size);
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #1e3a8a;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.tev-nav-menu-btn:hover,
.tev-nav-menu-btn:focus-visible {
  background: #eff6ff;
  border-color: #bfdbfe;
  outline: none;
}

.tev-nav-menu-btn[aria-expanded="true"] {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* Mobile nav backdrop */
.tev-mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: rgba(15, 23, 42, 0.45);
}

.tev-mobile-nav-backdrop.is-open {
  display: block;
}

/* Hero CTA sheet (homepage login buttons) */
.tev-mobile-cta-sheet {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10045;
  width: min(280px, 88vw);
  max-width: 100%;
  padding: 1rem;
  padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  background: #fff;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.tev-mobile-cta-sheet.is-open {
  transform: translateX(0);
}

.tev-mobile-cta-sheet .cta-small {
  display: block;
  width: 100%;
  text-align: center;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
}

body.tev-home-page .tev-mobile-nav-ctas {
  display: none;
}

@media (max-width: 1024px) {
  .tev-nav-menu-btn {
    display: inline-flex;
  }

  body.tev-home-page .nav-ctas-right {
    display: none;
  }

  body.tev-home-page .tev-mobile-nav-ctas {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.75rem 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
  }

  body.tev-home-page .tev-mobile-nav-ctas .cta-small {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* Homepage category sidebar → off-canvas drawer */
  body.tev-home-page #sidebar-nav {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10050;
    width: min(300px, 88vw);
    max-width: 100%;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(37, 99, 235, 0.18);
    box-shadow: 4px 0 28px rgba(15, 23, 42, 0.14);
    padding: 1rem 0.75rem 2rem;
  }

  body.tev-home-page.tev-mobile-sidebar-open #sidebar-nav {
    transform: translateX(0);
  }

  body.tev-home-page .marketplace-layout {
    grid-template-columns: 1fr;
  }

  /* Pinned marketplace / customer sidebar */
  body.tev-sidebar-pinned #sidebar-nav,
  body.tev-sidebar-pinned .tev-edge-sidebar-panel {
    transform: translateX(-100%) !important;
    z-index: 10050;
  }

  body.tev-sidebar-pinned.tev-mobile-sidebar-open #sidebar-nav,
  body.tev-sidebar-pinned.tev-mobile-sidebar-open .tev-edge-sidebar-panel.tev-open,
  body.tev-sidebar-pinned.tev-mobile-sidebar-open #sidebar-nav.tev-open {
    transform: translateX(0) !important;
  }

  body.tev-sidebar-pinned .tev-mp-header,
  body.tev-sidebar-pinned .tev-mp-main,
  body.tev-sidebar-pinned #tev-shared-footer,
  body.tev-sidebar-pinned .tev-mp-search-dock,
  body.tev-sidebar-pinned .tev-cpo-demo-banner,
  body.tev-sidebar-pinned .tev-cpo-loading {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.tev-sidebar-pinned .tev-edge-sidebar-zone,
  body.tev-sidebar-pinned .tev-edge-sidebar-hint {
    display: none !important;
  }

  /* Product list: show menu btn in nav */
  body.tev-marketplace-page .tev-mp-nav {
    gap: 0.5rem;
  }

  body.tev-marketplace-page .tev-mp-nav__titles {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  body.tev-home-page .hero .nav {
    gap: 0.5rem;
  }
}
