body {
  -webkit-animation: bugfix infinite 1s;
  /* needed for checkbox hack */
}

@-webkit-keyframes bugfix {
  from {
    padding: 0;
  }
  to {
    padding: 0;
  }
}
/* needed for checkbox hack */


/* -------- Common settings -------- */
#nav {
	font-size: 90%;
    font-weight: bold;
	position: relative;
	width: 100%;
}
#nav ul {
  display: none;
  width: 100%; 
  list-style: none;
  margin: 0 0 5px 0;
  padding: 0px;
  background: #8cc63e;
}
#nav ul li a {
  display: block;
  padding: 12px;
  color: #000000;
  text-decoration: none;
  
}
#nav ul li a:hover {
  background: #f4f9ec;
}

/* -------- Common dropdown menu -------- */
#nav ul li ul li {
  display: none;
}
#nav ul li ul li a:hover {
  display: block !important;
}
#nav input.trigger {
  position: absolute;
  top: -9999px;
  left: -9999px;
}
#nav input.trigger:checked ~ ul, #nav input.trigger:checked ~ ul li ul {
  display: block !important;
}

/* -------- Mobile Menu label -------- */
#nav label {
  position: relative;
  display: block;
  min-height: 2em;
  padding: .45em;
  font-size: 1em;
  margin: 0;
  cursor: pointer;
  background: #8cc53e;
  line-height: 2em;
  color: #000000;
}
#nav label:after {
  position: absolute;
  right: 1em;
  top: .2em;
  content: "\2261";
  font-size: 1.8em;
  color: #000000;
}

/* -------- Normal screen stuff -------- */

@media (min-width: 800px) {

  #nav input.trigger:checked ~ ul, #nav input.trigger:checked ~ ul li ul {
    /* older flexbox */
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-box-orient: horizontal;
    -moz-box-orient: horizontal;
    box-orient: horizontal;
    /* newer flexbox */
    display: flex;
    flex-direction: row;
  }
	#nav {
		width: 90%;
	}

  #nav ul {
	/* older flexbox */
    display: -ms-flexbox;
    flex-direction: -ms-row;
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-box-orient: horizontal;
    -moz-box-orient: horizontal;
    box-orient: horizontal;
    /* newer flexbox */
    display: flex;
    flex-direction: row;
  background: -moz-linear-gradient(top, #acd676, #6d9d2f);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#acd676), to(#6d9d2f));   	
  border-radius: 7px;
    box-shadow: 2px 2px 2px #000000;	  
  }
  #nav ul li {
    position: relative;
    text-align: center;
    /* older flexbox */
    -ms-flex: 1;
    -webkit-box-flex: 1;
    -moz-box-flex: 1;
    box-flex: 1;
    /* newer flexbox */
    flex: 1;
  }
  
#nav ul li:first-of-type:hover a{
  border-radius: 7px 0 0 7px;
}
#nav ul li:last-of-type:hover a{
  border-radius: 0 7px 7px 0;
}
#nav ul li a:hover {
  background: -moz-linear-gradient(top, #f4f9ec, #8cc53e);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f4f9ec), to(#8cc53e));
}
#nav ul li a.pressed {
  background: -moz-linear-gradient(top, #6d9d2f, #acd676);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#6d9d2f), to(#acd676)); 
} 
#nav ul li a.first{
  background: -moz-linear-gradient(top, #6d9d2f, #acd676);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#6d9d2f), to(#acd676)); 
  border-radius: 7px 0 0 7px;
}
#nav ul li a.last{
  background: -moz-linear-gradient(top, #6d9d2f, #acd676);
  background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#6d9d2f), to(#acd676)); 
  border-radius: 0 7px 7px 0;
} 
  #nav ul li ul {
    display: none !important;
    position: absolute;
    top: 2.8em;
    left: 0;
    display: block;
    width: 8.8em;
    box-shadow: 2px 2px 2px #000000;	
    z-index: 200;
  }
  #nav ul li ul li {
    text-align: left;	
  } 
  #nav ul li ul li:first-of-type:hover a{
	border-radius: 7px 7px 0 0;
  }
  #nav ul li ul li:last-of-type:hover a{
	border-radius: 0 0 7px 7px;
  }
  #nav ul li ul li {
    display: block !important;;
  }  
  #nav ul li ul li a {
    padding-top: -20px;
    padding-left: 1.5em;
	font-size: 80%;  
}  
  #nav ul li ul li ul {  
    z-index: 300;
    top: 0px;
    left: 12.4em;
  }
  #nav ul li:hover > ul {
    display: block !important;
  }
  #nav label {
	position: absolute;
	top: -9999px;
	left: -9999px;
  }
}
