{# COLORS #}
header {
  --header-background: 255, 255, 255;
  --header-topbar-background: 242, 245, 249;
}
header.color-theme-dark {
  --header-background: 10, 23, 68;
  --header-topbar-background: 10, 23, 68;
  --color-background-card: #16255A;
  --color-button-tertiary-bg-hover: #16255A;
}
@media screen and (min-width: 800px) {
  header.scroll-down {
    margin-top: -48px;
  }
}

@media screen and (max-width: 800px) {
  header.scroll-down .header__topbar {
    margin-top: -40px;
  }
}

{# HEADER #}
@media screen and (min-width: 800px) {
  .dnd-section:first-child {
    padding: 140px 20px 100px!important;
  }
}
body:has(.header__menu[data-mobile-open="true"]) {
  overflow: hidden;
}
header {
  z-index: 1000;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  transition: var(--transition);
}
header, header *, .header__nav, .header__nav * {
  box-sizing: border-box;
}
header.scroll {
  background: rgb(var(--header-background));
}

{# TOPBAR & MAIN #}
.header__topbar, .header__main {
  padding: 0 20px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header__topbar .buttons, .header__main .buttons {
  margin: 0;
}

@media (max-width: 800px) {
  .header__topbar, .header__main {
    padding: 0 12px;
  }
}

{# TOPBAR #}
.header__topbar {
  height: 48px;
  background-image: linear-gradient(to right, rgb(var(--header-topbar-background)), rgb(var(--header-topbar-background)));
  background-blend-mode: multiply;
  transition: var(--transition);
}
header.scroll .header__topbar {
  background-color: rgba(var(--header-topbar-background), 0.2);
}
.header__topbar .header__menu__dropdown {
  border-radius: 12px;
}
.header__topbar .header__menu__dropdown__column {
  padding: 0;
}
.header__topbar .buttons {
  gap: 0;
}
.header__topbar .buttons__item {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
}
.header__topbar .header__menu__item {
  background: var(--color-background-card);
}
header:not(.color-theme-dark) .header__topbar .header__menu__item[aria-expanded="false"] {
  background: rgb(var(--header-background));
}

@media (max-width: 800px) {
  .header__topbar {
    height: 40px;
    padding-right: 0;
  }
  .header__topbar .buttons__item > span {
    display: none;
  }
}

{# MAIN #}
.header__main {
  height: 70px;
}
.header__main .buttons__item {
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
}
.header__main__content {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

@media (max-width: 800px) {
  .header__main {
    height: 48px;
  }
  .header__main__content {
    flex-direction: row-reverse;
    justify-content: end;
  }
  .header__main .buttons__item {
    height: 36px;
    padding: 0 16px;
  }
}

{# MAIN LOGO #}
.header__logo {
  flex: none;
  margin: 0 0 6px;
  position: relative;
  width: 100px;
}
.header__logo img {
  width: 100%;
  height: auto;
}
.header__logo img:not(:first-child) {
  position: absolute;
  top: 0;
  left: 0;
}
header.color-theme-dark .header__logo img[color="light"],
header:not(.color-theme-dark) .header__logo img[color="dark"] {
  opacity: 0;
}

@media (max-width: 800px) {
  .header__logo {
    margin: 0;
    width: 88px;
  }
}

{# MAIN MENU #}
.header__menu {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: start;
  transition: var(--transition);
}
.header__menu > li {
  flex: none;
}
.header__menu__item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 40px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text-primary);
  font-weight: 600;
  transition: var(--transition);
}
.header__menu__item svg path {
  fill: var(--color-text-primary);
  transition: var(--transition);
}
.header__menu__item[aria-expanded="true"] {
  color: var(--color-body);
  background: var(--color-body-reverse);
}
.header__menu__item[aria-expanded="true"] svg path {
  fill: var(--color-body);
}
.header__menu__has-dropdown {
  position: relative;
}
.header__menu__dropdown {
  z-index: 1;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  padding: 4px;
  gap: 4px;
  background: var(--color-body);
  border-radius: 16px;
  box-shadow: var(--shadow);
  will-change: transform;
  display: none;
}
.header__menu__has-dropdown[data-open="true"] .header__menu__dropdown {
  display: flex;
}
.header__menu__dropdown__column {
  list-style: none;
  padding: 8px;
  width: 440px;
  max-width: 100%;
  border-radius: 12px;
}
.header__menu__dropdown__column:not(:first-child):last-child {
  background: var(--color-background-card);
}
.header__menu__dropdown__title {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.header__menu__dropdown__item {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: var(--transition);
}
.header__menu__dropdown__column:not(:first-child):last-child .header__menu__dropdown__item:hover {
  background: #E5ECF4;
}
.header__menu__dropdown__item.color-theme-dark {
  background: var(--color-body);
}
.header__menu__dropdown__item:has(.header__menu__dropdown__item__img) .header__menu__dropdown__item__text {
  display: flex;
  flex-direction: column-reverse;
}
.header__menu__dropdown__item .icon:before {
  flex: none;
  width: 24px;
  height: 24px;
}
.header__menu__dropdown__item__img {
  flex: none;
  width: 80px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
}
.header__menu__dropdown__item__text {
  width: 100%;
}
.header__menu__dropdown__item__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}
.header__menu__dropdown__item__description {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.header__menu__item__tag {
  flex: none;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-white);
  background: #004AF6;
  border-radius: 6px;
}

{# MOBILE MENU #}
.header__menu__close {
  z-index: 1000;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to bottom, var(--color-body) 80%, transparent);
  display: flex;
  align-items: center;
  justify-content: end;
}
.header__close,
.header__burger {
  font-size: 24px;
  line-height: 1;
}
.header__close {
  padding: 12px;
  width: 42px;
  height: 48px;
  line-height: 1;
}

/* Desktop */
.header__burger {
  display: none;
}
@media (min-width: 800px) {
  .header__menu__item:not([aria-expanded="true"]):hover {
    background: var(--color-background-card);
  }
  .header__menu__dropdown__item:hover {
    background: var(--color-background-card);
  }
}

/* Mobile */
@media (min-width: 800px) {
  .header__menu__close {
    display: none;
  }
}
@media (max-width: 800px) {
  .header__burger {
    display: inline-flex;
  }
  
  .header__menu__dropdown {
    flex-direction: column;
  }
  .header__menu__dropdown__column {
    padding: 12px;
  }
  
  .header__menu__dropdown__title {
    padding: 0;
    opacity: 0.7;
  }
  .header__menu__dropdown__item {
    padding: 12px 0;
  }
  .header__topbar .header__menu__dropdown__item {
    padding: 12px;
  }
  .header__menu__dropdown__item .icon:before {
    width: 16px;
    height: 16px;
  }
  

  .header__nav[data-burger="true"] .header__menu {
    padding: 60px 8px 8px;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--color-body);
    opacity: 1;
    overflow-y: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .header__nav[data-burger="true"] .header__menu::-webkit-scrollbar {
    display: none;
  }
  .header__nav[data-burger="true"] .header__menu[data-mobile-open="false"] {
    opacity: 0;
    transform: translateX(100%);
  }
  .header__nav[data-burger="true"] .header__menu li:not(.header__menu__close) {
    width: 100%;
  }
  .header__nav[data-burger="true"] .header__menu__item {
    width: 100%;
  }
  .header__nav[data-burger="true"] .header__menu__dropdown__column {
    background: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
  }
  .header__nav[data-burger="true"] .header__menu__dropdown {
    position: relative;
    top: auto;
    left: auto;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    gap: 0;
  }
  .header__nav[data-burger="true"] .header__menu__dropdown__item:not(:has(.header__menu__dropdown__item__img)) .header__menu__dropdown__item__description {
    display: none;
  }

  .header__menu[data-mobile-open="true"] {
    display: flex;
  }
  
  .header__menu[data-mobile-open="true"] .header__menu__item {
    margin: 4px 0px;
    padding: 10px 16px;
  }
}