/* ══════════════════════════════════════════════════════════
   Flux Labs — v2 header: mega-menu + global search + mobile nav
   Loaded on every page after styles.css. White minimal theme.
   ══════════════════════════════════════════════════════════ */

/* ── Products mega-dropdown ── */
.nav-item-products { position: relative; }
.nav-item-products > a::after {
  content: '▾'; font-size: 10px; margin-left: 5px; opacity: .6;
}
.mega-panel {
  position: absolute;
  top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 210px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 55px rgba(0,0,0,.14);
  padding: 8px;
  z-index: 998; /* below nav (1000) so the nav search dropdown always paints on top */
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.mega-panel.open {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mega-link {
  display: block;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14px; font-weight: 600;
  color: var(--text); text-decoration: none;
  transition: background .12s, color .12s;
}
.mega-link:hover { background: var(--bg3); color: var(--accent2); }
.mega-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.mega-col h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.mega-col h5 a { color: inherit; text-decoration: none; }
.mega-col h5 a:hover { color: var(--accent); }
.mega-col ul { list-style: none; margin: 0; padding: 0; }
.mega-col li { margin: 0; }
.mega-col li a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 8px; margin: 0 -8px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text); text-decoration: none;
  transition: background .12s, color .12s;
}
.mega-col li a:hover { background: var(--bg3); color: var(--text); }
.mega-price { font-size: 11.5px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.mega-soon  { font-size: 10px;  font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
.mega-goals {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.mega-goals span {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-muted); margin-right: 4px;
}
.mega-goals a {
  font-size: 12.5px; font-weight: 600;
  color: var(--text); text-decoration: none;
  border: 1px solid var(--border); border-radius: 100px;
  padding: 6px 14px;
  transition: border-color .15s, color .15s, background .15s;
}
.mega-goals a:hover { border-color: var(--accent); color: var(--accent); background: rgba(201,162,74,.06); }

/* ── Global header search ── */
.nav-search { position: relative; margin-left: auto; margin-right: 12px; }
.nav-search input {
  width: 190px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 14px 8px 34px;
  font-size: 13px; font-family: 'Inter', sans-serif;
  color: var(--text);
  outline: none;
  transition: width .25s ease, border-color .2s, background .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236f6f6f' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.nav-search input:focus { width: 250px; border-color: var(--accent); background-color: #fff; }
.nav-search input::placeholder { color: var(--text-muted); }
.search-drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 320px; max-height: 380px; overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.14);
  z-index: 1300;
  display: none;
}
.search-drop.open { display: block; }
.search-drop a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--bg3);
  transition: background .12s;
}
.search-drop a:last-child { border-bottom: none; }
.search-drop a:hover, .search-drop a.sel { background: var(--bg2); }
.search-drop img {
  width: 40px; height: 40px; object-fit: contain;
  background: var(--well); border-radius: 9px; padding: 4px; flex: 0 0 auto;
}
.search-drop .sd-name { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.25; }
.search-drop .sd-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.search-drop .sd-price { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.search-drop .sd-empty { padding: 16px 14px; font-size: 13px; color: var(--text-muted); text-align: center; }

/* ── Mobile: search inside the menu, sections ── */
.mobile-search { padding: 4px 20px 12px; }
.mobile-search .nav-search { margin: 0; width: 100%; }
.mobile-search .nav-search input, .mobile-search .nav-search input:focus { width: 100%; }
.mobile-search .search-drop { left: 0; right: 0; width: auto; position: relative; top: 8px; box-shadow: none; max-height: 300px; }
.mm-section {
  font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 28px 6px;
}
.mobile-menu a.mm-sub { padding: 10px 28px 10px 40px; font-size: 15px; }
.mobile-menu a .mm-price { float: right; font-size: 12px; font-weight: 600; color: var(--accent); }

/* hide desktop search under 900px (it moves into the mobile menu) */
@media (max-width: 900px) {
  nav > .nav-search { display: none; }
  .mega-panel { display: none; }
}
@media (min-width: 901px) {
  /* nav-links are absolutely centered in styles.css; search sits on the right
     before the cart button */
  .nav-search { z-index: 5; }
}

/* ── Partners nav pill — always visible, gold (2026-07-24) ── */
.nav-links .nav-partners {
  background: linear-gradient(135deg, rgba(201,162,74,.16), rgba(166,127,61,.16));
  border: 1px solid rgba(201,162,74,.45);
  color: #8a6d35 !important;
  border-radius: 100px;
  padding: 7px 14px !important;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.nav-links .nav-partners:hover {
  background: #bf9a4e;
  color: #0a0a0a !important;
  border-color: #bf9a4e;
}

/* ── Mobile search: always-visible magnifier button + drop-down bar (2026-07-24) ── */
.nav-search-toggle { display: none; }
@media (max-width: 900px) {
  .nav-search-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0;
    background: none; border: none; cursor: pointer;
    color: var(--text); border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-search-toggle:hover, .nav-search-toggle.active { color: var(--accent2); background: var(--bg3); }

  .mobile-search-bar {
    position: fixed; top: 72px; left: 0; right: 0; z-index: 997;
    background: #ffffff; border-bottom: 1px solid var(--border);
    box-shadow: 0 14px 30px rgba(0,0,0,.08);
    padding: 12px 5%;
    transform: translateY(-14px); opacity: 0; pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }
  .mobile-search-bar.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  nav.scrolled ~ .mobile-search-bar { top: 60px; }
  .mobile-search-bar .nav-search { margin: 0; width: 100%; position: relative; }
  .mobile-search-bar .nav-search input,
  .mobile-search-bar .nav-search input:focus { width: 100%; box-sizing: border-box; }
  .mobile-search-bar .search-drop {
    position: static; width: auto; margin-top: 8px; max-height: 60vh; box-shadow: none;
    border-radius: 12px;
  }
}
/* desktop: never show the mobile bar even if present in DOM */
@media (min-width: 901px) { .mobile-search-bar, .nav-search-toggle { display: none !important; } }
