/* ==========================================================================
   Products mega menu (views/partials/header.ejs, .mm). Images sit in fixed boxes with
   object-fit: contain, so no device is ever stretched.
   ========================================================================== */
.mm__grid { display: grid; gap: 10px; }
.mm__card { position: relative; display: flex !important; flex-direction: column !important; gap: 10px; padding: 10px !important; border-radius: 18px !important; border: 1px solid var(--line); background: rgb(var(--ink-rgb) / .03); text-decoration: none; color: inherit; overflow: hidden; transition: border-color .3s, background .3s, translate .4s var(--ease); }
.mm__card:hover, .mm__card:focus-visible, .mm__card[aria-current="page"] { border-color: color-mix(in srgb, var(--pc) 55%, transparent); background: color-mix(in srgb, var(--pc) 10%, transparent) !important; }
.mm__img { position: relative; display: grid; place-items: center; height: 96px; border-radius: 12px; background: radial-gradient(60% 70% at 50% 60%, color-mix(in srgb, var(--pc) 38%, transparent), transparent 75%), rgb(var(--ink-rgb) / .04); overflow: hidden; }
.mm__img img { max-width: 86%; max-height: 86%; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 10px 12px rgb(0 0 0 / .35)); transition: transform .5s var(--ease); }
.mm__card:hover .mm__img img { transform: translateY(-4px) rotate(-3deg) scale(1.04); }
.mm__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mm__txt small { font-size: 10px !important; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--pc) 70%, var(--text)) !important; }
.mm__txt b { font-size: 15px; font-weight: 700; }
.mm__txt > span { font-size: 12.5px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm__card--new .mm__txt small { color: #c9a2ff !important; }
.mm__all { display: flex !important; flex-direction: row !important; align-items: center; justify-content: space-between; padding: 12px 14px !important; border-radius: 14px !important; font-weight: 700; font-size: 14px; text-decoration: none; background: rgb(var(--ink-rgb) / .05); }
.mm__all small { font-weight: 500; color: var(--muted); font-size: 13px; }
.mm__all svg { width: 18px; height: 18px; transition: translate .3s var(--ease); }
.mm__all:hover svg { translate: 4px 0; }

/* Desktop: a full-width panel under the nav */
@media (min-width: 1024px) {
  .nav__inner { position: relative; }
  .nav__drop:has(.mm) { position: static; }
  .nav__drop:has(.mm)::before { display: none; }
  .nav__menu.mm { left: 0; right: 0; top: calc(100% + 6px); min-width: 0; width: auto; padding: 14px; gap: 10px; transform: translateY(8px); border-radius: 24px; }
  .nav__menu.mm::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
  .nav__drop:hover .nav__menu.mm, .nav__drop:focus-within .nav__menu.mm, .nav__drop.is-open .nav__menu.mm { transform: none; }
  .mm__grid { grid-template-columns: 1.15fr repeat(3, 1fr); grid-auto-rows: auto; }
  .mm__card--new { grid-row: span 2; }
  .mm__card--new .mm__img { flex: 1; height: auto; min-height: 210px; }
  .mm__card:not(.mm__card--new) { flex-direction: row !important; align-items: center; }
  .mm__card:not(.mm__card--new) .mm__img { flex: none; width: 92px; height: 92px; }
  .mm__card--new .mm__txt b { font-size: 18px; }
}

/* Phones and tablets: a two-column grid inside the slide-out menu */
@media (max-width: 1023px) {
  .nav__menu.mm { padding: 6px 0 16px; gap: 10px; }
  .mm__grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mm__card { padding: 8px !important; gap: 8px; }
  .mm__img { height: 92px; }
  .mm__txt b { font-size: 14px; }
  .mm__txt > span { display: none; }
  .mm__card--new { grid-column: 1 / -1; flex-direction: row !important; align-items: center; }
  .mm__card--new .mm__img { width: 96px; flex: none; }
  .mm__card--new .mm__txt > span { display: -webkit-box; }
}
@media (prefers-reduced-motion: reduce) { .mm__card:hover .mm__img img { transform: none; } }

/* Images: pinned inside the box so they always fit whole (never cropped or stretched) */
.mm__img img { position: absolute; inset: 7%; width: 86%; height: 86%; max-width: none; max-height: none; object-fit: contain; }
@media (min-width: 1024px) {
  .mm__card--new .mm__img { min-height: 150px; }
  .nav__menu.mm { max-height: calc(100svh - 140px); overflow: auto; }
}
