/* Mega Menu defaults (brand via CSS variables) */
:root {
  --mm-bg: #ffffff;
  --mm-text: #0f172a;
  --mm-muted: #64748b;
  --mm-accent: #2563eb;
  --mm-border: rgba(15, 23, 42, 0.10);
  --mm-shadow: 0 18px 60px rgba(15, 23, 42, 0.12);
  --mm-radius: 16px;
  --mm-font: inherit;
}

/* Desktop nav */
.mm-nav {
  position: relative;
  font-family: var(--mm-font);
}

.mm-inner {
  position: relative;
}

.mm-top {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mm-top-item { position: relative; }

.mm-link,
.mm-trigger {
  appearance: none;
  background: none;
  border: 0;
  color: var(--mm-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mm-top-item.is-current > .mm-link,
.mm-top-item.is-current > .mm-trigger {
  color: var(--mm-accent);
}

.mm-link:hover,
.mm-trigger:hover {
  background: rgba(15, 23, 42, 0.04);
}

.mm-trigger-icon {
  font-size: 12px;
  transform: translateY(1px);
  opacity: 0.7;
}

.mm-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 9999;
}

.mm-panel-inner {
  background: var(--mm-bg);
  border: 1px solid var(--mm-border);
  box-shadow: var(--mm-shadow);
  border-radius: var(--mm-radius);
  padding: 18px;
  overflow: hidden;
  transform-origin: top;
  animation: mmFadeIn 140ms ease-out;
}

/* Invisible hover buffer to prevent “death gap” */
.mm-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -14px;
  height: 14px;
}

.mm-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}

/* If featured column exists, use 4 columns; if not, compress to 3 columns */
.mm-grid.has-featured {
  grid-template-columns: 1.1fr 1.2fr 1.2fr 1fr;
}

.mm-grid.no-featured {
  grid-template-columns: 1.2fr 1.2fr 1fr;
}

.mm-col-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mm-muted);
  margin-bottom: 10px;
  font-weight: 800;
}

.mm-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mm-li { margin: 0; }

.mm-item {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--mm-text);
  transition: background 120ms ease, transform 120ms ease;
}

.mm-li.is-current .mm-item { outline: 2px solid rgba(37, 99, 235, 0.25); }

.mm-list.mm-depth-0 {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mm-list.mm-depth-1 {
  margin: 10px 0 0;
  padding: 0 0 0 18px; // indent grandkids
  list-style: none;
  border-left: 1px solid rgba(0,0,0,0.08);
}

.mm-li.mm-depth-0.has-kids > .mm-item {
  font-weight: 800;
}

.mm-li.mm-depth-1 .mm-item {
  font-size: 0.95em;
  opacity: 0.9;
}

.mm-li.mm-depth-1 .mm-item-label::before {
  content: "—";
  margin-right: 8px;
  opacity: 0.35;
}

.mm-item:hover {
  background: rgba(15, 23, 42, 0.04);
  transform: translateY(-1px);
}

.mm-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mm-desc {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--mm-muted);
  line-height: 1.35;
}

.mm-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--mm-accent);
  white-space: nowrap;
}

/* Promo image card: fixed height so image can COVER without dead space */
.mm-promo-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--mm-border);
  background: rgba(15, 23, 42, 0.02);
  height: 260px;
}

.mm-promo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mm-promo-empty .mm-promo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.03), rgba(15, 23, 42, 0.01));
}

@keyframes mmFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile toggle (you can move/replace with your existing hamburger) */
.mm-mobile-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: rgba(15, 23, 42, 0.05);
  color: var(--mm-text);
  font: inherit;
  font-weight: 900;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

/* Mobile off-canvas */
.mm-mobile {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
}

.mm-mobile.is-open { display: block; }

.mm-mobile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  animation: mmBackdrop 160ms ease-out;
}

@keyframes mmBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mm-mobile-sheet {
  position: absolute;
  top: 0;
  right: 0;
  width: min(92vw, 420px);
  height: 100%;
  background: var(--mm-bg);
  box-shadow: var(--mm-shadow);
  border-left: 1px solid var(--mm-border);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  animation: mmSheetIn 180ms ease-out;
}

@keyframes mmSheetIn {
  from { transform: translateX(18px); opacity: 0.7; }
  to   { transform: translateX(0); opacity: 1; }
}

.mm-mobile-topbar {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--mm-border);
}

.mm-mobile-close {
  appearance: none;
  border: 0;
  background: rgba(15, 23, 42, 0.06);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 900;
}

.mm-mobile-title {
  font-weight: 900;
  color: var(--mm-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-mobile-panels {
  flex: 1;
  overflow: auto;
}

.mm-mpanel { display: none; padding: 10px 14px 18px; }
.mm-mpanel.is-active { display: block; }

.mm-mpanel-header {
  position: sticky;
  top: 0;
  background: var(--mm-bg);
  padding: 8px 0 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  z-index: 2;
}

.mm-mpanel-heading {
  font-size: 22px;
  font-weight: 1000;
  letter-spacing: -0.02em;
  padding: 6px 0;
}

.mm-mback {
  appearance: none;
  border: 0;
  background: none;
  color: var(--mm-muted);
  font-weight: 800;
  cursor: pointer;
  padding: 6px 0;
}

.mm-mlist {
  margin: 0;
  padding: 10px 0 0;
  list-style: none;
}

.mm-mrow {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--mm-text);
  font-weight: 800;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(15, 23, 42, 0.02);
}

.mm-mrow:hover { background: rgba(15, 23, 42, 0.04); }

.mm-mchev { color: var(--mm-muted); font-size: 18px; }

/* Responsive behavior */
@media (max-width: 1024px) {
  .mm-nav .mm-panel { display: none !important; }
  .mm-mobile-toggle { display: inline-flex; }
  .mm-top { display: none; }
}