/* Tik desktop – rodome Mega Menu */
@media (min-width: 1025px) {
  .main-mega-menu {
    display: flex;
    justify-content: center;
    gap: 20px;
    background-color: var(--theme-palette-color-8);
    border-top: 1px solid rgba(44, 62, 80, 0.2);
    border-bottom: 1px solid rgba(44, 62, 80, 0.2);
    padding: 0px 0 0px; /* Bottom padding +5px, kad būtų vietos border'ui */
    font-family: var(--theme-font-family);
    font-weight: var(--theme-font-weight);
    font-size: var(--theme-font-size);
    color: var(--theme-link-initial-color);
    min-height: 45px;
    margin-bottom: auto;
  }

  .main-mega-menu > li {
    position: relative;
    list-style: none;
  }

  .main-mega-menu > li > a {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--theme-link-initial-color);
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
    gap: 6px; /* tarpas tarp teksto ir toggle ikonos */
  }

  /* Rodyklė tik tiems, kurie turi mega menu (dropdown) */
  .main-mega-menu > li.has-mega-menu > a::after {
    content: "";
    display: inline-block;
    margin-left: 6px;
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--theme-link-initial-color);
    border-bottom: 2px solid var(--theme-link-initial-color);
    transform: rotate(-45deg);
    transition: transform 0.3s ease;
    transform-origin: center;
    margin-top: -5px;
  }
  /* Kai hover ar active, rodyklė pasisuka žemyn */
  .main-mega-menu > li.has-mega-menu:hover > a::after,
  .main-mega-menu > li.has-mega-menu > a:active::after {
    transform: rotate(45deg);
    border-color: #ceb06b;
  }

  .main-mega-menu > li > a:hover,
  .main-mega-menu > li > a:active {
    color: #ceb06b;
  }

  /* Dropdown */
  .custom-mega-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: var(--e-a-dropdown-shadow, 0 6px 20px rgba(0, 0, 0, 0.1));
    padding: 20px 20px 20px 20px;
    z-index: 999;
    animation: fadeIn 0.25s ease-in-out forwards;
    white-space: normal;
    max-width: max-content;
    min-width: 200px;
    border-radius: 4px;
  }

  .menu-item.has-mega-menu:hover > .custom-mega-menu {
    display: flex;
    animation-name: fadeIn;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .mega-wrap {
    display: flex;
    flex-wrap: nowrap;
    gap: 50px; /* padidintas tarpas tarp stulpelių */
    background: #ffffff;
    align-items: flex-start;
    padding: 0;
    margin: 0;
  }

  .mega-column {
    flex: 1 1 auto;
    min-width: 250px;
    max-width: fit-content; /* autofit pagal turinį */
  }

  .mega-column h4 {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: 600;
  }

  .mega-column h4 a {
    color: var(--theme-link-initial-color);
    text-decoration: none;
  }

  .mega-column h4 a:hover {
    color: #ceb06b;
  }

  .mega-column ul {
    padding-left: 0;
    list-style: none;
    margin: 0;
  }

  .mega-column ul li ul {
    margin-top: 5px;
    padding-left: 0;
  }

  /* Glaustesni level 3 punktai */
  .mega-column ul li ul li {
    margin-bottom: 1px; /* mažesnis tarpas tarp level 3 punktų */
  }
  

  .mega-column ul li ul li a {
    display: block;
    padding: 1px 0; /* glaustesnis padding */
    color: var(--theme-text-color);
    font-size: 12.5px;
    text-decoration: none;
    transition: color 0.3s ease;
  }

  .mega-column ul li ul li a:hover,
  .mega-column ul li ul li a:active {
    color: #ceb06b;
  }

  /* Dropdown arti Level 1 */
  .menu-item.has-mega-menu > .custom-mega-menu {
    margin-top: 0; /* pašalintas tarpas tarp level1 ir dropdown */
  }
}

/* Tablet/Mobile – slepiame Mega Menu */
@media (max-width: 1024px) {
  .main-mega-menu,
  .custom-mega-menu {
    display: none !important;
  }
}
