html, body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
}

main {
  display: grid;
  place-items: center;
  color: white;
  text-align: center;
}

.topbar-nav {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  border-radius: 20px;
  background-color: #111;
  padding: 15px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.topbar-nav:hover {
  transform: translateX(-50%) scale(1.03);
}

.asto-logo {
  font-size: 23px;
  font-weight: bold;
  color: white;
  text-decoration: none;
  position: relative;
}

.asto-logo:hover {
  color: inherit; /* Zachowaj kolor zdefiniowany wcześniej */
  text-decoration: none; /* Zapewnia, że nie pojawi się podkreślenie */
}

.topbar-menu {
  display: flex;
  gap: 10px;
  align-items: center;
}

.topbar-menu a {
  font-size: 14px;
  padding: 5px 10px;
  position: relative;
  color: white;
  isolation: isolate;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
}

.topbar-menu a.active::before,
.topbar-menu a:hover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
  z-index: -1;
  border-radius: 10px;
}

.topbar-menu a:hover {
  transform: translateY(-3px);
}

.topbar-menu a:hover:not(.active)::before {
  opacity: 0.5;
}

.topbar-megamenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.5s ease;
  /* Dodatkowe właściwości, np. pozycjonowanie, kolory, border-radius itd. */
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
  width: 948px;
  background-color: #111;
  color: white;
  text-align: center;
  border-radius: 0px 0px 20px 20px;
  z-index: 500;
}

/* Pokaż submenu tylko, gdy najechano na element menu lub samo submenu */
.topbar-menu-item:hover .topbar-megamenu,
.topbar-megamenu:hover {
  max-height: 400px; /* Maksymalna wysokość megamenu */
  opacity: 1;
}

/* Gdy megamenu jest otwarte, zmieniamy border-radius na górze */
.topbar-nav:has(.topbar-menu-item:hover .topbar-megamenu),
.topbar-nav:has(.topbar-megamenu:hover) {
  border-radius: 20px 20px 0px 0px;
}

.topbar-megamenu iframe {
  border-radius: 0 0 20px 20px; /* Zaokrąglenie dolnych rogów */
  overflow: hidden; /* Ukrycie zawartości wykraczającej poza zaokrąglenie */
  background: transparent;
}
