:root {
  --logo-width: 5rem;
  --nav-height: 3rem;
}

.main-header {
  display: flex;
  background-color: var(--orange);
  color: #FFF;
}

#header-actions {
  padding-right: 1em;
}

#collapseMenu {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
}

.main-nav {
  z-index: 55;
}

#toggleClose {
  color: var(--orange);
}

.main-logo {
  background-color: #FFF;
  width: var(--logo-width);
  padding: 1em;
  border-top-right-radius: 20px 100%;
  border-bottom-right-radius: 20px 100%;
}

.top-menu {
  height: 100%;
  align-items: center;
}

.searchbar {
  border: none;
}

.searchbar::placeholder {
  color: rgba(255, 255, 255, .8);
}

.searchbar:focus {
  box-shadow: none;
}

.searchbar-container:focus-within {
  border-color: var(--orange);
}

.menu {
  justify-content: space-between;
  width: calc(100% - var(--logo-width));
  flex-direction: row-reverse;
  align-items: flex-end;
}

.family {
  color: var(--orange);
  font-size: 1.2rem;
}

.sub-families {
  display: none;
  color: var(--dark);
  padding: 1em;
  font-weight: normal;
  font-style: italic;
}

.sub-family::before {
  content: '> ';
}

.sub-families.open {
  display: block;
}

@media screen and (min-width: 640px) {
  :root {
    --logo-width: 9rem;
  }

  #collapseMenu {
    position: static;
  }

  #collapseMenu > nav {
    width: max-content;
  }

  .main-nav {
    z-index: 1000;
  }

  .family {
    color: #FFF;
    position: relative;
    height: var(--nav-height);
    z-index: 100;
  }

  .sub-family {
    color: var(--dark);
  }

  .sub-family:hover {
    color: var(--orange);
  }

  .sub-family a {
    display: block;
    padding: .5em 2em;
  }

  .family:hover .sub-families {
    opacity: 1;
    height: fit-content;
    max-height: 1000px;
    padding: 1em 0;
  }
  
  .sub-families {
    display: block;
    opacity: 0;
    max-height: 0;
    transition: all .2s ease-in-out;
    position: absolute;
    top: var(--nav-height);
    border-bottom: var(--orange) 2px solid;
    background-color: #ffefd8;
    z-index: 1;
    width: max-content;
    padding: 0;
    font-weight: 600;
    font-style: normal;
    height: 0;
    overflow: hidden;
  }

  .sub-family::before {
    display: none;
  }

  .search-results-container {
    margin-top: .1em;
    width: max-content;
  }
}