/* ==========================================================================
   MZF Store — Mega Menu (single button + grid dropdown)
   ========================================================================== */

/* ---------- Desktop mega menu ---------- */
.mzf-mega {
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.mzf-mega__bar {
  position: relative;
  display: flex;
  align-items: center;
}

/* "All Categories" button */
.mzf-mega__all-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--brand);
  color: #fff;
  font-size: .96rem;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  font-family: var(--font);
}
.mzf-mega__all-btn:hover { background: var(--brand-700); transform: translateY(-1px); }
.mzf-mega__all-btn svg:first-child { flex-shrink: 0; }
.mzf-mega__caret {
  flex-shrink: 0;
  transition: transform .22s ease;
}
.mzf-mega__all-btn[aria-expanded="true"] .mzf-mega__caret { transform: rotate(180deg); }

/* Desktop dropdown panel — appears below the button */
.mzf-mega__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .16);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height .32s ease, opacity .28s ease;
  pointer-events: none;
}
.mzf-mega__dropdown.is-open {
  max-height: 600px;
  opacity: 1;
  pointer-events: auto;
}

.mzf-mega__panel {
  padding: 28px 32px 32px;
  max-height: 580px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for the panel */
.mzf-mega__panel::-webkit-scrollbar {
  width: 8px;
}
.mzf-mega__panel::-webkit-scrollbar-track {
  background: var(--surface);
}
.mzf-mega__panel::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--r-pill);
}
.mzf-mega__panel::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* 4-column grid on desktop */
.mzf-mega__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 28px;
}

.mzf-mega__col {}

.mzf-mega__col-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r);
  background: rgba(190, 34, 46, .06);
  transition: background .18s ease, color .18s ease;
}
.mzf-mega__col-title:hover {
  background: var(--brand);
  color: #fff;
}
.mzf-mega__col-title .mzf-mega__count {
  margin-inline-start: auto;
  font-size: .78rem;
  color: inherit;
  font-weight: 600;
  background: rgba(255, 255, 255, .3);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

.mzf-mega__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mzf-mega__sub li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: .88rem;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: background .15s ease, color .15s ease, padding-inline-start .15s ease;
}
.mzf-mega__sub li a:hover {
  background: rgba(190, 34, 46, .08);
  color: var(--brand);
  padding-inline-start: 14px;
}
.mzf-mega__sub li a svg { flex-shrink: 0; opacity: .5; }
.mzf-mega__count {
  margin-inline-start: auto;
  font-size: .75rem;
  color: var(--ink-muted);
  font-weight: 600;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: var(--r-pill);
}

/* ---------- Mobile drawer ---------- */
.mzf-mega-mobile {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}
.mzf-mega-mobile.is-open {
  pointer-events: auto;
  opacity: 1;
}

.mzf-mega-mobile__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(4px);
}

.mzf-mega-mobile__drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 90vw);
  background: var(--bg);
  box-shadow: -8px 0 24px rgba(0, 0, 0, .28);
  display: flex;
  flex-direction: column;
  /* RTL: drawer slides from right, so hide it to the right (+100%) */
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.22, 1, .36, 1);
}
.mzf-mega-mobile.is-open .mzf-mega-mobile__drawer {
  transform: translateX(0);
}

.mzf-mega-mobile__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.mzf-mega-mobile__header h2 {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 800;
  color: #fff;
}
.mzf-mega-mobile__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.mzf-mega-mobile__close:hover { background: rgba(255, 255, 255, .2); transform: scale(1.08); }

.mzf-mega-mobile__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 0;
}

.mzf-mega-mobile__cat {
  border-bottom: 1px solid var(--line);
}
.mzf-mega-mobile__cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.mzf-mega-mobile__cat-link {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.mzf-mega-mobile__cat-link .mzf-mega__count { margin-inline-start: auto; }

.mzf-mega-mobile__toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  flex-shrink: 0;
}
.mzf-mega-mobile__toggle:hover { background: var(--surface-2); }
.mzf-mega-mobile__toggle svg {
  transition: transform .22s ease;
}
.mzf-mega-mobile__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.mzf-mega-mobile__sub {
  list-style: none;
  margin: 0;
  padding: 0 20px 14px 20px;
  display: none;
  background: rgba(190, 34, 46, .03);
}
.mzf-mega-mobile__sub.is-open { display: block; }
.mzf-mega-mobile__sub li a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: .9rem;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: background .15s ease, color .15s ease;
}
.mzf-mega-mobile__sub li a:hover {
  background: rgba(190, 34, 46, .14);
  color: var(--brand);
}
.mzf-mega-mobile__sub li a svg { flex-shrink: 0; opacity: .5; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .mzf-mega__grid { grid-template-columns: repeat(3, 1fr); gap: 20px 24px; }
}

@media (max-width: 768px) {
  /* Desktop dropdown hidden on tablet/mobile; only drawer works */
  .mzf-mega__dropdown { display: none !important; }
  
  /* Hide mega menu BAR on mobile (button), but keep mobile drawer visible */
  .mzf-mega__bar { display: none; }
}

@media (max-width: 600px) {
  .mzf-mega__all-btn { padding: 11px 18px; font-size: .88rem; gap: 8px; }
}
