/* ===================================================================
   LEVERAGE STUDIO — theme.css
   1. Light theme (opt-in via the toggle in the nav; dark stays default)
   2. Nav: theme toggle, hamburger and the slide-down mobile menu
   Load AFTER style.css / i18n.css / catalog.css on every page.
   =================================================================== */

/* ---------- 1. LIGHT THEME ---------- */
:root { color-scheme: dark; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg:           #f7f6f2;
  --bg-2:         #efede7;
  --bg-3:         #e6e3db;
  --bg-card:      #ffffff;
  --border:       #dcd8cd;
  --border-light: #c9c4b6;
  --text:         #1a1a17;
  --text-dim:     #5c5850;
  --text-muted:   #7d786d;
  /* the neon lime is unreadable as text on a light page, so the accent
     becomes a deep olive that still reads as "the lime colour" */
  --accent-lime:  #4f7a00;
  --accent-amber: #b86e00;
  --accent-red:   #d32f2f;
  --accent-blue:  #1d6fd6;
  --accent-purple:#7e35c9;
  --shadow: 0 4px 24px rgba(40, 35, 20, 0.12);
}

:root[data-theme="light"] .nav              { background: rgba(247, 246, 242, 0.88); }
:root[data-theme="light"] .nav.scrolled     { background: rgba(247, 246, 242, 0.98); }
:root[data-theme="light"] .search-overlay   { background: rgba(247, 246, 242, 0.97); }
:root[data-theme="light"] .hero-grid-lines  {
  background-image:
    linear-gradient(rgba(79, 122, 0, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 122, 0, 0.07) 1px, transparent 1px);
}
:root[data-theme="light"] .pareto-bg-text   { color: rgba(79, 122, 0, 0.06); }

/* smooth swap when the user flips the toggle (not on first paint) */
html.theme-anim body,
html.theme-anim .nav,
html.theme-anim .product-card,
html.theme-anim .cat-card,
html.theme-anim .filter-sidebar { transition: background-color .25s ease, color .25s ease, border-color .25s ease; }

/* ---------- 2. NAV ---------- */
.nav-inner { gap: 32px; }
.nav-links a, .nav-actions .btn-ghost, .nav-actions .btn-primary, .sub-nav-widget a { white-space: nowrap; }
@media (max-width: 1320px) {
  .nav-inner { gap: 24px; }
  .nav-links { gap: 20px; }
}

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0; padding: 0;
  background: none; color: var(--text-dim);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  cursor: pointer; transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-dim); }
.theme-toggle svg { width: 18px; height: 18px; display: block; }
:root[data-theme="light"] .ti-sun          { display: none; }
:root:not([data-theme="light"]) .ti-moon   { display: none; }

/* hamburger */
.hamburger {
  display: none; position: relative;
  width: 40px; height: 40px; padding: 0; flex-shrink: 0;
  margin: 0; margin-inline-start: auto;
  background: none; color: var(--text);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  cursor: pointer; font-size: 0;            /* hides the old ☰ glyph if a page still has it */
  align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.hb-bar {
  position: absolute; left: 11px; right: 11px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.hb-bar:nth-child(1) { top: 13px; }
.hb-bar:nth-child(2) { top: 19px; }
.hb-bar:nth-child(3) { top: 25px; }
.hamburger.is-open .hb-bar:nth-child(1) { top: 19px; transform: rotate(45deg); }
.hamburger.is-open .hb-bar:nth-child(2) { opacity: 0; }
.hamburger.is-open .hb-bar:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* mobile menu panel */
.mobile-menu {
  display: none; flex-direction: column; gap: 0;
  padding: 4px 24px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}
.mobile-menu.open { display: flex; }

.mobile-menu .mm-link {
  font-family: var(--font-mono); font-size: 14px; color: var(--text-dim);
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.mobile-menu .mm-link:hover { color: var(--text); }

.mobile-menu .mm-actions { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 6px; }
.mobile-menu .mm-actions > * { width: 100%; }
.mobile-menu .mm-actions .btn-ghost,
.mobile-menu .mm-actions .btn-primary { display: block; text-align: center; padding: 12px 16px; }
/* style.css has a generic ".mobile-menu a { color: dim }" that would otherwise
   grey-out the coloured buttons inside the menu */
.mobile-menu .mm-actions a.btn-primary,
.mobile-menu .mm-actions a.sub-nav-join { color: var(--bg); font-weight: 700; }
.mobile-menu .mm-actions a.sub-nav-account { color: var(--text-dim); }
.mobile-menu .mm-actions .sub-nav-widget { margin: 0; }
.mobile-menu .mm-actions .sub-nav-widget a { display: flex; justify-content: center; width: 100%; padding: 12px 16px; }

.mobile-menu .mm-theme {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 8px; padding: 14px 0 4px;
  background: none; border: 0; border-top: 1px solid var(--border);
  color: var(--text-dim); font-family: var(--font-mono); font-size: 13px; cursor: pointer; text-align: start;
}
.mobile-menu .mm-theme svg { width: 18px; height: 18px; }

/* collapse the nav to the hamburger on phones AND tablets (incl. portrait
   iPads at 768/810/820/834px — the old breakpoint stopped at 768) */
@media (max-width: 1180px) {
  .nav-inner { gap: 12px; padding: 0 16px; }
  .nav-links, .nav-actions { display: none; }
  .hamburger { display: inline-flex; }
  .theme-toggle { margin-inline-start: auto; }
  .hamburger    { margin-inline-start: 0; }
}
@media (min-width: 1181px) {
  .mobile-menu { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-bar, html.theme-anim body, html.theme-anim .nav { transition: none !important; }
}
