.dropdown {
  display: block;

  &:hover .dropdown-menu, &:focus-within .dropdown-menu {
    display: block;
  }

  &:focus-visible {
    outline: 1px solid var(--focus-bg);
    outline-offset: -1px;
  }

  &:hover .dropdown-toggle {
    color: var(--secondary);
    &::before {
      background-color: var(--secondary);
    }
  }
}

.dropdown-toggle {
  border: none;
  cursor: pointer;
  color: var(--placeholder-text);
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-style: normal;
  font-weight: 400;
  line-height: 2rem;
  display: flex;
  align-items: center;

  &::before {
    content: '';
    mask: url(../img/language.svg) no-repeat 50% 50%;
    height: 14px;
    width: 14px;
    margin-right: 4px;
    mask-size: cover;
    background-color: var(--placeholder-text);
  }

  &::after {
    height: 18px;
    width: 18px;
    content: '';
    mask: url(../img/chevron_up.svg) no-repeat 50% 50%;
    mask-size: cover;
    background-color: var(--placeholder-text);
  }
}

.dropdown-menu {
  display: none;
  position: fixed;
  background-color: var(--base-background-light);
  min-width: 100px;
  z-index: 9999;
  padding: 0;
  margin: 0;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.dropdown-item {
  padding-block: 8px;
  padding-inline: 8px;
  border: 0;
  outline: none;
  cursor: pointer;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  align-content: center;
  gap: 8px;
  transition-property: color, background-color, outline-color, box-shadow;
  transition-duration: .2s;
  transition-timing-function: ease;

  &:hover {
    color: var(--secondary);
    background-color: var(--hovered-bg) !important;
  }

  &:active {
    background-color: var(--selected-bg) !important;
  }

  &:focus-visible {
    outline: 1px solid var(--focus-bg);
    outline-offset: -1px;
  }
}

.dropdown-item span {
  color: var(--placeholder-text);
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  line-height: 2rem;
  font-style: normal;
  font-weight: 400;
  text-decoration: none;
}

/* Resolutions below 1080p */
@media (max-width: 1900px) {
  .dropdown-menu {
    transform: translate(0, calc(-100% - 24px));
  }
}
