/* Madbax Chrome — menu handoff (design_handoff_madbax_menu)
 * Visual tokens from design_reference.dc.html. Behavior unchanged.
 */

.mbx-chrome {
  --mn-bg: #ffffff;
  --mn-ink: #101113;
  --mn-nav: #23242a;
  --mn-muted: #6b6c70;
  --mn-accent: #00e68a;
  --mn-accent-text: #067a4b;
  --mn-search-bg: #f6f7f6;
  --mn-border: rgba(0, 0, 0, 0.08);
  --mn-border-strong: rgba(0, 0, 0, 0.10);
  --mn-border-input: rgba(0, 0, 0, 0.12);
  --mn-radius: 8px;
  --mn-radius-dd: 10px;
  --mn-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mbx-tab-h: 52px;
  --mbx-ink: #101113;
  --mbx-cta: #101113;
  --mbx-cta-on: #ffffff;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200000;
  font-family: var(--mn-font);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}

.mbx-chrome.mbx-chrome--away {
  transform: none;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .mbx-chrome,
  body.mbx-chrome-on {
    transition: none;
  }
}

.mbx-chrome *,
.mbx-chrome *::before,
.mbx-chrome *::after {
  box-sizing: border-box;
}

body:has(.mbx-chrome) header.jlc-hmain-w,
body:has(.mbx-chrome) .jlc-hmain-w,
body:has(.mbx-chrome) .jlc-stick-main-w,
body:has(.mbx-chrome) .jlc-stick-main-in,
body:has(.mbx-chrome) .tp_head_off > header,
body:has(.mbx-chrome) .options_header,
body:has(.mbx-chrome) .jl_mobile_nav,
body:has(.mbx-chrome) .menu_mobile_large,
body:has(.mbx-chrome) #jl_mobile_nav,
body:has(.mbx-chrome) .mobile_menu_wrap,
body.mbx-chrome-on header.jlc-hmain-w,
body.mbx-chrome-on .jlc-hmain-w,
body.mbx-chrome-on .jlc-stick-main-w,
body.mbx-chrome-on .jlc-stick-main-in,
body.mbx-chrome-on .tp_head_off > header {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

body.mbx-chrome-on {
  padding-top: var(--mbx-chrome-offset, 52px) !important;
}

body.admin-bar .mbx-chrome {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar .mbx-chrome {
    top: 46px;
  }
}

/* —— Top bar —— */
.mbx-tab {
  background: var(--mn-bg) !important;
  border-bottom: 1px solid var(--mn-border);
  min-height: var(--mbx-tab-h);
}

.mbx-tab__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 20px;
  min-height: var(--mbx-tab-h);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  box-sizing: border-box;
}

.mbx-tab__brand {
  flex: 0 0 auto;
  font-family: var(--mn-font);
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1;
  letter-spacing: -0.02em !important;
  color: var(--mn-ink) !important;
  -webkit-text-fill-color: var(--mn-ink) !important;
  text-decoration: none !important;
  white-space: nowrap;
  padding: 14px 8px;
  margin-right: 8px;
}

.mbx-tab__brand:hover {
  color: var(--mn-ink) !important;
  -webkit-text-fill-color: var(--mn-ink) !important;
}

.mbx-tab__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
}

.mbx-tab__link {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  height: auto;
  padding: 1px 12px !important;
  border-radius: var(--mn-radius);
  border: none;
  position: relative;
  font-family: var(--mn-font) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1;
  letter-spacing: 0;
  color: var(--mn-nav) !important;
  -webkit-text-fill-color: var(--mn-nav) !important;
  text-decoration: none !important;
  white-space: nowrap;
  background: transparent !important;
  transition: color 0.15s;
}

.mbx-tab__link::after {
  display: none !important;
  content: none !important;
}

.mbx-tab__link:hover,
.mbx-tab__link:focus-visible,
.mbx-tab__item--dropdown:hover > .mbx-tab__link,
.mbx-tab__link--dropdown[aria-expanded="true"] {
  color: var(--mn-accent-text) !important;
  -webkit-text-fill-color: var(--mn-accent-text) !important;
  background: transparent !important;
}

.mbx-tab__link:focus-visible,
button.mbx-tab__link--dropdown:focus-visible,
.mbx-tab__cta:focus-visible,
.mbx-tab__menu-btn:focus-visible,
.mbx-tab__search:focus-within {
  outline: 2px solid var(--mn-accent);
  outline-offset: 2px;
}

.mbx-tab__link:focus,
button.mbx-tab__link--dropdown:focus {
  outline: none;
}

/* Editor Zone — outline current (not filled CTA) */
.mbx-tab__link--ez {
  align-self: center;
  height: auto !important;
  min-height: 44px !important;
  max-height: none !important;
  padding: 1px 12px !important;
  margin: 0 !important;
  border-radius: var(--mn-radius) !important;
  border: 1px solid var(--mn-accent) !important;
  background: transparent !important;
  color: var(--mn-accent-text) !important;
  -webkit-text-fill-color: var(--mn-accent-text) !important;
  font-weight: 600 !important;
  filter: none !important;
}

.mbx-tab__link--ez:hover,
.mbx-tab__link--ez:focus-visible {
  color: var(--mn-accent-text) !important;
  -webkit-text-fill-color: var(--mn-accent-text) !important;
  background: transparent !important;
  filter: none !important;
}

.mbx-tab__item--dropdown {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

button.mbx-tab__link--dropdown {
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  padding: 14px 10px !important;
}

.mbx-tab__chev {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: -4px;
  background: none !important;
  -webkit-mask: none !important;
  mask: none !important;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s;
}

.mbx-tab__link--dropdown[aria-expanded="true"] .mbx-tab__chev {
  transform: rotate(225deg);
  margin-top: 2px;
}

/* Search */
.mbx-tab__search {
  display: flex;
  align-items: center;
  width: 160px;
  min-height: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border-radius: var(--mn-radius);
  background: var(--mn-search-bg) !important;
  border: 1px solid var(--mn-border-input) !important;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  order: 3;
}

.mbx-tab__search:focus-within {
  border-color: var(--mn-accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 230, 138, 0.18);
  outline: none;
}

.mbx-tab__search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  order: -1;
  width: 34px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--mn-muted);
  flex: 0 0 34px;
}

.mbx-tab__search-submit:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mbx-tab__search-icon {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  background-color: var(--mn-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5Zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14Z'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5Zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14Z'/%3E%3C/svg%3E") center / 14px 14px no-repeat;
}

.mbx-tab__search-input {
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  padding: 0 14px 0 0 !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: var(--mn-font) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  color: var(--mn-nav) !important;
  -webkit-text-fill-color: var(--mn-nav) !important;
  opacity: 1;
  pointer-events: auto;
}

.mbx-tab__search-input::placeholder {
  color: var(--mn-muted);
  opacity: 1;
}

/* Actions */
.mbx-tab__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
  flex: 0 0 auto;
  order: 4;
  padding: 10px 0;
}

/* Hidden on desktop bar — still in mobile drawer (functionality kept) */
.mbx-tab__actions .mbx-tab__text-link {
  display: none !important;
}

.mbx-tab__cta {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: var(--mn-radius) !important;
  background: var(--mbx-cta) !important;
  color: var(--mbx-cta-on) !important;
  -webkit-text-fill-color: var(--mbx-cta-on) !important;
  font-family: var(--mn-font) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  transition: filter 0.15s;
}

.mbx-tab__cta:hover {
  filter: brightness(1.12);
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.mbx-tab__menu-btn {
  display: none;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--mn-radius);
  background: transparent;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  color: var(--mn-ink) !important;
  -webkit-text-fill-color: var(--mn-ink) !important;
  order: 5;
}

.mbx-tab__menu-btn:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.mbx-tab__menu-icon {
  width: 20px;
  height: 20px;
  background-color: var(--mn-ink) !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z'/%3E%3C/svg%3E") center / 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18v2H3V6zm0 5h18v2H3v-2zm0 5h18v2H3v-2z'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* Drawer / scrim — outside .mbx-chrome; literal colors */
.mbx-tab__scrim {
  position: fixed;
  inset: 0;
  background: transparent !important;
  z-index: 200010;
}

.mbx-tab__drawer {
  --mn-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  top: var(--mbx-chrome-offset, 52px);
  left: 0;
  right: 0;
  bottom: auto;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: 70vh;
  background: #ffffff !important;
  background-color: #ffffff !important;
  z-index: 200020;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px 16px;
  font-family: var(--mn-font);
}

body.admin-bar .mbx-tab__drawer {
  top: calc(var(--mbx-chrome-offset, 52px));
}

.mbx-tab__drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mbx-tab__drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--mn-font);
  font-size: 14px;
  font-weight: 600;
  color: #23242a !important;
  -webkit-text-fill-color: #23242a !important;
  text-decoration: none !important;
}

.mbx-tab__drawer-nav a:hover {
  background: rgba(0, 0, 0, 0.045);
  color: #067a4b !important;
  -webkit-text-fill-color: #067a4b !important;
}

.mbx-tab__drawer-ez {
  background: transparent !important;
  color: #067a4b !important;
  -webkit-text-fill-color: #067a4b !important;
  font-weight: 600 !important;
  border: 1px solid #00e68a !important;
  border-radius: 8px !important;
  justify-content: flex-start !important;
}

.mbx-tab__drawer-ez:hover {
  background: rgba(0, 0, 0, 0.045) !important;
  filter: none;
}

.mbx-tab__drawer-cta {
  margin-top: 12px !important;
  justify-content: center !important;
  background: #101113 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  border-radius: 8px !important;
  min-height: 44px !important;
  padding: 12px !important;
}

.mbx-tab__drawer-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.mbx-tab__drawer-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--mn-font);
  font-size: 14px;
  font-weight: 600;
  color: #23242a !important;
  cursor: pointer;
  list-style: none;
}

.mbx-tab__drawer-summary::-webkit-details-marker {
  display: none;
}

.mbx-tab__drawer-summary::after {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  background: none;
  -webkit-mask: none;
  mask: none;
  transition: transform 0.15s;
}

.mbx-tab__drawer-group[open] > .mbx-tab__drawer-summary::after {
  transform: rotate(225deg);
  margin-top: 2px;
}

.mbx-tab__drawer-summary:hover {
  background: rgba(0, 0, 0, 0.045);
  color: #067a4b !important;
}

.mbx-tab__drawer-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 8px 8px;
}

.mbx-tab__drawer-sub a {
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: #23242a !important;
  -webkit-text-fill-color: #23242a !important;
}

/* Dropdown menus (ported to body — literal colors) */
.mbx-tab__menu {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 20;
  min-width: 200px;
  max-height: 280px;
  overflow: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background-color: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12) !important;
}

.mbx-tab__menu-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  text-align: left !important;
  border: 0 !important;
  background: transparent !important;
  padding: 10px 12px !important;
  margin: 0 !important;
  min-height: 44px !important;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  color: #23242a !important;
  -webkit-text-fill-color: #23242a !important;
  text-decoration: none !important;
  cursor: pointer !important;
  text-transform: none !important;
  box-shadow: none !important;
  border-radius: 7px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.mbx-tab__menu-item span {
  color: #6b6c70 !important;
  -webkit-text-fill-color: #6b6c70 !important;
  font-weight: 400 !important;
}

.mbx-tab__menu-item:hover {
  color: #23242a !important;
  -webkit-text-fill-color: #23242a !important;
  background: rgba(0, 0, 0, 0.045) !important;
}

/* Mega panel — keep columns; restyle to handoff tokens */
.mbx-tab__menu--mega {
  width: min(920px, calc(100vw - 48px)) !important;
  max-width: min(920px, calc(100vw - 48px)) !important;
  min-width: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: 0 !important;
  border-radius: 10px !important;
}

.mbx-tab__menu--mega:not([hidden]) {
  display: block !important;
}

.mbx-tab__mega-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
  padding: 12px 16px;
  background: #f6f7f6 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mbx-tab__mega-intro > div {
  display: grid;
  gap: 4px;
}

.mbx-tab__mega-intro strong {
  color: #101113;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.mbx-tab__mega-intro span {
  color: #6b6c70;
  font-size: 13px;
  letter-spacing: 0;
}

.mbx-tab__mega-all {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 0 14px !important;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #23242a !important;
  -webkit-text-fill-color: #23242a !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.mbx-tab__mega-all:hover {
  background: rgba(0, 230, 138, 0.18) !important;
  border-color: #00e68a !important;
  color: #067a4b !important;
  -webkit-text-fill-color: #067a4b !important;
}

.mbx-tab__mega-all b {
  font-size: 13px;
  font-weight: 400;
}

.mbx-tab__mega-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mbx-tab__menu--cols-1 .mbx-tab__mega-groups {
  grid-template-columns: minmax(0, 1fr);
}

.mbx-tab__menu--cols-2 .mbx-tab__mega-groups {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mbx-tab__menu--cols-3 .mbx-tab__mega-groups {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mbx-tab__mega-group {
  min-width: 0;
  padding: 12px;
}

.mbx-tab__mega-group + .mbx-tab__mega-group {
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.mbx-tab__mega-group > strong {
  display: block;
  margin: 0 8px 8px;
  color: #6b6c70;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mbx-tab__mega-group > div {
  display: grid;
  gap: 2px;
}

.mbx-tab__item--mega:nth-of-type(1) .mbx-tab__menu--mega {
  left: -65px;
}

@media (max-width: 899px) {
  .mbx-tab__mega-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .mbx-tab__mega-groups {
    grid-template-columns: 1fr;
  }
  .mbx-tab__mega-group + .mbx-tab__mega-group {
    border-left: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
  }
}

/* Mobile ≤1180 — brand + hamburger; panel holds the rest */
@media (max-width: 1180px) {
  .mbx-tab__nav,
  .mbx-tab__search,
  .mbx-tab__actions {
    display: none !important;
  }

  .mbx-tab__inner {
    gap: 8px;
  }

  .mbx-tab__menu-btn {
    display: inline-flex;
  }
}

/* Search expand overlay — kept for JS is-open path if ever shown */
.mbx-tab__search.is-open {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: auto !important;
  min-width: 0;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0;
  padding: 0 12px;
  z-index: 6;
  display: flex !important;
  align-items: center;
  border-radius: 8px;
  background: #f6f7f6 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  overflow: visible;
}

.mbx-tab__search.is-open .mbx-tab__search-input {
  display: block !important;
  width: 100% !important;
  font-size: 15px !important;
}
