/* =========================================================
   VR Mega Menu (VER-5)
   Pasek kategorii głównych na całą szerokość + panel
   z drzewem podkategorii i bestsellerami po najechaniu.
   Markup: templates/_partials/header.tpl, dane: modules/vrhomepage
   ========================================================= */

.vr-mm { position: relative; z-index: 65; border-bottom: 1px solid var(--slate-100); }
.vr-mm__bar { gap: 0; }

/* ---- Pasek kategorii ---- */
.vr-mm__list {
  display: flex;
  align-items: stretch;
  height: 100%;
  margin: 0 0 0 -14px;
  padding: 0;
  list-style: none;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.vr-mm__list::-webkit-scrollbar { display: none; }
.vr-mm__item { position: static; display: flex; flex-shrink: 0; }
.vr-mm__top {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--slate-800);
  text-decoration: none;
  white-space: nowrap;
}
.vr-mm__top::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: var(--slate-900);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}
.vr-mm__top:hover,
.vr-mm__top:focus-visible,
.vr-mm__item.is-open > .vr-mm__top { color: var(--slate-900); text-decoration: none; }
.vr-mm__top:hover::after,
.vr-mm__top:focus-visible::after,
.vr-mm__item.is-open > .vr-mm__top::after { transform: scaleX(1); }

/* ---- Panel (pełna szerokość okna) ---- */
.vr-mm__panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--slate-200);
  box-shadow: 0 24px 40px -24px rgba(15, 23, 42, .18);
  animation: vrMmFade .16s ease-out;
}
.vr-mm__item.is-open > .vr-mm__panel { display: block; }
@keyframes vrMmFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.vr-mm__panel-inner {
  max-width: 1536px;
  margin: 0 auto;
  padding: 32px 40px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 56px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.vr-mm__panel-inner:not(:has(.vr-mm__picks)) { grid-template-columns: minmax(0, 1fr); }

.vr-mm__all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--slate-900);
  text-decoration: none;
}
.vr-mm__all:hover { color: var(--accent); text-decoration: none; }

.vr-mm__groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 28px 32px;
}
.vr-mm__group-title {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-900);
  text-decoration: none;
}
.vr-mm__group-title:hover { color: var(--accent); text-decoration: none; }

.vr-mm__links { margin: 0; padding: 0; list-style: none; }
.vr-mm__links li + li { margin-top: 7px; }
.vr-mm__links a {
  font-size: 14px;
  line-height: 1.4;
  color: var(--slate-600);
  text-decoration: none;
}
.vr-mm__links a:hover { color: var(--slate-900); text-decoration: underline; text-underline-offset: 3px; }
.vr-mm__links--flat { columns: 3 200px; column-gap: 32px; }
.vr-mm__links--flat li { break-inside: avoid; margin: 0 0 9px; }
.vr-mm__links--flat li + li { margin-top: 0; }
.vr-mm__links .vr-mm__more { font-weight: 600; color: var(--slate-900); }

/* ---- Bestsellery ---- */
.vr-mm__picks { border-left: 1px solid var(--slate-100); padding-left: 40px; }
.vr-mm__picks-title {
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate-900);
}
.vr-mm__picks-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.vr-mm__pick { display: block; color: var(--slate-700); text-decoration: none; }
.vr-mm__pick:hover { color: var(--slate-900); text-decoration: none; }
.vr-mm__pick-img {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--slate-50);
  overflow: hidden;
}
.vr-mm__pick-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform .3s ease;
}
.vr-mm__pick:hover .vr-mm__pick-img img { transform: scale(1.04); }
.vr-mm__pick-name {
  display: -webkit-box;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Mobile ---- */
.vr-mm__toggle,
.vr-mm__drawer { display: none; }

@media (max-width: 1200px) {
  .vr-mm__panel-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 32px; }
  .vr-mm__picks { padding-left: 24px; }
}

@media (max-width: 991px) {
  .vr-mm__list,
  .vr-mm__panel { display: none !important; }
  .vr-mm__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 4px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-900);
    cursor: pointer;
  }
  .vr-mm__drawer:not([hidden]) {
    display: block;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    padding: 4px 16px 16px;
    border-top: 1px solid var(--slate-100);
    background: #fff;
  }
  .vr-mm__acc,
  .vr-mm__acc-top { border-bottom: 1px solid var(--slate-100); }
  .vr-mm__acc summary,
  .vr-mm__acc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--slate-900);
    text-decoration: none;
    list-style: none;
    cursor: pointer;
  }
  .vr-mm__acc summary::-webkit-details-marker { display: none; }
  .vr-mm__acc summary::after { content: '+'; font-size: 20px; font-weight: 400; color: var(--slate-500); }
  .vr-mm__acc[open] summary::after { content: '–'; }
  .vr-mm__acc-all,
  .vr-mm__acc-link {
    display: block;
    padding: 8px 0 8px 12px;
    font-size: 14px;
    color: var(--slate-600);
    text-decoration: none;
  }
  .vr-mm__acc-all { font-weight: 700; color: var(--slate-900); }
  .vr-mm__acc[open] { padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .vr-mm__panel { animation: none; }
  .vr-mm__top::after,
  .vr-mm__pick-img img { transition: none; }
}
