/* =================================================================
   MEGA MENU — Multi-column dropdown (intemerata.eu style)
   ================================================================= */

/* Full-width blue menu bar */
.header-menu-bar {
  background: #2980b9;
  width: 100%;
}

.header-menu-bar .ps-mainmenu {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Main nav bar styling */
.ps-mainmenu__tree {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: stretch;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ps-mainmenu__tree-item {
  position: relative;
  display: flex;
  align-items: center;
}

.ps-mainmenu__tree-item-wrapper {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.ps-mainmenu__tree-link {
  display: block;
  padding: 0.875rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.ps-mainmenu__tree-link:hover,
.ps-mainmenu__tree-item.current .ps-mainmenu__tree-link,
.ps-mainmenu__tree-item:hover .ps-mainmenu__tree-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.ps-mainmenu__chevron {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.2s ease;
}

.ps-mainmenu__tree-item:hover .ps-mainmenu__chevron {
  transform: rotate(180deg);
  color: #fff;
}

/* Dropdown */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  min-width: 240px;
  background: #fff;
  border-top: 3px solid #2980b9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 1rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.ps-mainmenu__tree-item:hover > .mega-dropdown,
.ps-mainmenu__tree-item.has-mega:hover > .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Single column layout */
.mega-dropdown__grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

/* Links list (subcategories) */
.mega-dropdown__links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mega-dropdown__links li {
  margin: 0;
  border-bottom: 1px solid #f0f0f0;
}

.mega-dropdown__links li:last-child {
  border-bottom: none;
}

.mega-dropdown__link {
  display: block;
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: #333;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.mega-dropdown__link:hover {
  background: #f5f5f5;
  color: #2980b9;
}

/* Badges (Hot, Nowości) — add class .menu-badge--hot or .menu-badge--new to <span> after link text */
.menu-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 3px;
  vertical-align: top;
  margin-left: 0.3rem;
  line-height: 1.2;
}

.menu-badge--hot {
  background: #e74c3c;
  color: #fff;
}

.menu-badge--new {
  background: #27ae60;
  color: #fff;
}

/* Auto-badges via CSS for specific menu items */
.ps-mainmenu__tree-item[data-id="lnk-promocje"] {
  position: relative;
}

.ps-mainmenu__tree-item[data-id="lnk-promocje"]::after {
  content: "Hot";
  position: absolute;
  top: 2px;
  right: -2px;
  padding: 1px 5px;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: #e74c3c;
  border-radius: 3px;
  pointer-events: none;
}

.ps-mainmenu__tree-item[data-id="lnk-nowosci"] {
  position: relative;
}

.ps-mainmenu__tree-item[data-id="lnk-nowosci"]::after {
  content: "Nowości";
  position: absolute;
  top: 2px;
  right: -4px;
  padding: 1px 5px;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  background: #27ae60;
  border-radius: 3px;
  pointer-events: none;
}

/* Make parent nav position: relative for dropdown positioning */
.header-menu-bar .ps-mainmenu__desktop {
  position: static;
}

/* Each menu item positions its own dropdown */
.header-menu-bar .ps-mainmenu__tree-item {
  position: relative;
}

/* Hide dropdown toggle button (we use CSS hover now) */
.ps-mainmenu__tree-dropdown-toggle {
  display: none !important;
}

/* Responsive: hide mega on smaller screens */
@media (max-width: 1199.98px) {
  .mega-dropdown {
    display: none !important;
  }
}
