/* ============================================
   TAVLO MEGA-MENU - V3
   JS-controlled dropdown (no CSS :hover trigger)
   ============================================ */

/* Parent li */
.nav-item.has-mega {
  position: relative;
}

/* ---- DESKTOP PANEL ---- */
.mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 400px;
  background: var(--bg-elevated, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.05));
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  padding: 1.5rem;
  margin-top: 4px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s, transform 0.2s ease;
  pointer-events: none;
}

/* Show ONLY via JS class - no CSS :hover */
.mega-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---- PANEL GRID ---- */
.mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

/* ---- COLUMN ---- */
.mega-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mega-heading {
  font-family: var(--font-display, serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3, #999);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border, rgba(0,0,0,0.05));
}

/* ---- MENU ITEMS ---- */
.mega-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mega-col ul li a,
.mega-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  color: var(--text-2, #666);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: color 0.15s;
  line-height: 1.3;
}

.mega-col ul li a:hover,
.mega-item:hover {
  color: var(--accent, #C5941A);
}

/* Icons inside menu items - SMALL */
.mega-col ul li a .icon,
.mega-item .icon,
.mega-panel .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent, #C5941A);
  opacity: 0.7;
}

.mega-col ul li a:hover .icon,
.mega-item:hover .icon {
  opacity: 1;
}

/* ---- MOBILE (accordion) ---- */
@media (max-width: 768px) {
  .mega-panel {
    position: static;
    min-width: 100%;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 0 1rem;
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: max-height 0.3s ease;
  }

  .mega-panel.is-open {
    max-height: 600px;
  }

  .mega-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}
