@font-face {
font-family: 'Quicksand';
src: url('../fonts/quicksand-regular.woff2') format('woff2'),
     url('../fonts/quicksand-regular.woff') format('woff'),
     url('../fonts/quicksand-regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

#topnav {
transform-origin: top;
transform: scaleY(0);
transition: transform 1s ease;
position: absolute;
top: 100%; right: 0; left: 0;
font-family: 'Quicksand', sans-serif;
background: #FFFFFF;
z-index: 999;
overflow: visible;
width: 100%;
margin-top: 10px;
box-shadow: -10px 10px 10px rgba(0, 0, 0, 0.3);
}

#topnav ul {
list-style: none;
}

#topnav li {
border-bottom: 1px solid #999999;
}

#topnav li:last-of-type {
border-bottom: none;
}

#topnav li a {
display: block;
padding: 10px 0 0 20px;
background: #FEFEFE;
font-family: 'Quicksand', sans-serif;
font-weight: bold;
color: #333333 !important;
text-decoration: none;
}

#topnav li a:last-of-type {
padding-bottom: 10px;
}

#topnav li a:hover {
background: #DDDDDD;
color: #111111 !important;
}

#topnav li a.active, #topnav li a.active:hover {
background: #8FBF1E;
color: #FFFFFF !important;
font-weight: bold;
}

#topnav.open {
transform: scaleY(1);
}

@media (min-width: 1024px) {

  #topnav ul ul {
    position: absolute;
    top: 0;
    right: 100%;
    min-width: 320px;   /* HIER anpassen */
    width: max-content; /* passt sich dem Inhalt an */
    background: #FFFFFF;
    box-shadow: -10px 10px 10px rgba(0,0,0,0.3);
    display: none;
  }

  #topnav li {
    position: relative;
  }

  #topnav li:hover > ul {
    display: block;
  }

  #topnav ul ul li a {
    padding: 10px 20px;
    font-weight: normal;
  }

}

@media (max-width: 1023px) {

  #topnav ul ul {
    position: relative;
    right: auto;
    top: auto;
    display: none;
    box-shadow: none;
  }

  #topnav li.open > ul {
    display: block;
  }

  #topnav ul ul li a {
    padding-left: 40px;
    font-weight: normal;
  }

}

@media screen and (max-width: 768px) {
  #topnav { width: 100%; margin-top: 0; border: 4px solid #BBBBBB; box-shadow: none; border-radius: none !important; }
  #topnav li a { font-size: 20px; border-radius: none !important; }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  #topnav { width: 100%; margin-top: 0; border: 4px solid #BBBBBB; box-shadow: none; border-radius: none !important; }
  #topnav li a { font-size: 20px; border-radius: none !important; }

}

@media screen and (min-width: 1024px) and (max-width: 1280px) {
  #topnav { border: 4px solid #BBBBBB; border-radius: 10px; }
  #topnav li a { font-size: 18px; }

}

@media screen and (min-width: 1280px) and (max-width: 1536px) {
  #topnav { border: 4px solid #BBBBBB; border-radius: 10px; }
  #topnav li a { font-size: 19px; }
}

@media (min-width: 1536px) {
  #topnav { border: 4px solid #BBBBBB; border-radius: 10px; }
  #topnav li a { font-size: 20px; }
}