/**
 * Mega Menu — style dla motywu Hummingbird
 * Umieść w: themes/hummingbird/assets/css/mega-menu.css
 * Zarejestruj w: themes/hummingbird/config/theme.yml
 */

/* ─── Nadrzędny li musi być position:static
       żeby panel rozciągał się na pełną szerokość ─── */
.main-menu__tree__item.has-mega-menu {
  position: static !important;
}

/* ─── PANEL ─── */
.mega-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #ffffff;
  border-top: 2px solid #b5924a;
  border-bottom: 1px solid #e4e2de;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.10);
  z-index: 1000;
  display: none;
}

.has-mega-menu:hover .mega-menu-panel,
.has-mega-menu:focus-within .mega-menu-panel,
.has-mega-menu.keyboard-open .mega-menu-panel {
  display: block !important;
}

.mega-menu-inner {
  display: flex;
  min-height: 400px;
  max-height: 560px;
  max-width: 1320px; /* dopasowane do kontenera Bootstrap hummingbird */
  margin: 0 auto;
}

/* ─── LEWA KOLUMNA ─── */
.mega-menu__cat-list {
  list-style: none;
  padding: 14px 0;
  margin: 0;
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid #e4e2de;
  background: #f8f7f5;
  overflow-y: auto;
}

.mega-menu__cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px 11px 18px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 100ms, border-color 100ms;
}

.mega-menu__cat-item:hover,
.mega-menu__cat-item.active {
  background: #ffffff;
  border-left-color: #b5924a;
}

.mega-menu__cat-item a {
  color: #333333;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  flex: 1;
  /* nawigacja przez hover — bezpośredni klik obsługuje "Zobacz wszystkie" w nagłówku */
  /*pointer-events: none;*/
}

.mega-menu__cat-item.active a {
  font-weight: 600;
  color: #1a1a1a;
}

.mega-menu__cat-item .mega-menu__chevron {
  font-size: 1.1rem;
  color: #cccccc;
  transition: color 100ms;
}

.mega-menu__cat-item:hover .mega-menu__chevron,
.mega-menu__cat-item.active .mega-menu__chevron {
  color: #999999;
}

/* ─── PRAWA KOLUMNA ─── */
.mega-menu__sub-panels {
  flex: 1;
  padding: 24px 32px 28px;
  overflow-y: auto;
}

.mega-menu__sub-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
  animation: megaFade 150ms ease forwards;
}

.mega-menu__sub-panel.active {
  display: flex;
}

@keyframes megaFade {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* nagłówek panelu */
.mega-menu__sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4e2de;
}

.mega-menu__sub-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.mega-menu__sub-link {
  font-size: 0.78rem;
  color: #b5924a;
  text-decoration: none;
  font-weight: 500;
  margin-left: 16px;
  white-space: nowrap;
  display: none;
}

.mega-menu__sub-link:hover {
  text-decoration: underline;
}

/* ─── KAFELKI ─── */
.mega-menu__tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.mega-menu__tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #222222;
  border: 1px solid #e4e2de;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  transition: box-shadow 180ms, transform 180ms, border-color 180ms;
}

.mega-menu__tile:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
  transform: translateY(-3px);
  border-color: #cccccc;
}

.mega-menu__tile-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #ece9e3;
}

.mega-menu__tile-img--placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ece9e3;
}

.mega-menu__tile-name {
  padding: 9px 10px 11px;
  font-size: 0.78rem;
  color: #333333;
  text-align: center;
  line-height: 1.4;
  border-top: 1px solid #e4e2de;
}
