/* header */

.header {
  background: var(--bg-main);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 15
}

.header.active {
  background: var(--bg-hover)
}

.header.active .header__container {
  position: relative;
  z-index: 51
}

.header__container {
  max-width: 1270px;
  margin-inline: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 26px;
}

@media (max-width: 479px) {
  .header__container {
    padding: 20px 8px
  }
}

.header-logo {
  width: 170px;
  height: 44px;
  display: flex
}

.header-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1023px) {
  .header-nav {
    display: none
  }
}

.header__link {
  display: block;
  cursor: pointer;
  padding: 10px 12px;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: .08px;
  border-radius: 12px;
  transition: .3s cubic-bezier(.65, .05, .36, 1);
  text-decoration: none;
  color: var(--text-main)
}

.header__link:hover {
  background: var(--bg-hover)
}

.header__controls {
  display: flex;
  align-items: center;
  gap: 12px
}

.theme-switcher__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-main);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-switcher__button:hover {
  background-color: var(--bg-hover);
}

.theme-switcher__icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  background-color: var(--text-main);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  transition: all 0.3s ease;
}

.theme-switcher__icon--sun {
  display: block;
  mask-image: url('/src/icon/sun.svg');
  -webkit-mask-image: url('/src/icon/sun.svg');
}

.theme-switcher__icon--moon {
  display: none;
  mask-image: url('/src/icon/moon.svg');
  -webkit-mask-image: url('/src/icon/moon.svg');
}

[data-theme="dark"] .theme-switcher__icon--sun {
  display: none;
}

[data-theme="dark"] .theme-switcher__icon--moon {
  display: block;
}

.header__lang .dropdown__btn {
  border: 1px solid var(--border);
}

.header__burger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  position: relative;
  cursor: pointer;
  border: none;
  padding: 0;
  z-index: 51;
}

.header__burger::before,
.header__burger::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.header__burger::before {
  top: 18px;
  transform: rotate(0deg);
}

.header__burger::after {
  bottom: 18px; 
  transform: rotate(0deg);
}

.header__burger.active::before {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.header__burger.active::after {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

@media (max-width: 1023px) {
  .header__burger {
    display: flex;
    outline: thin solid var(--border);
    border-radius: 16px
  }
  
  .header__controls .header__lang {
    display: none
  }
  
  .header.active .header__controls .button {
    display: none
  }
}

@media (max-width: 479px) {
  .header .header__controls .button {
    display: none
  }
}

.menu-mobile {
  pointer-events: none;
  opacity: 0;
  background: var(--bg-hover);
  position: fixed;
  left: 0;
  right: 0;
  top: 84px;
  bottom: 0;
  z-index: 50;
  display: none;
  padding: 20px;
  transition: opacity 0.3s ease;
}

@media (max-width: 1023px) {
  .menu-mobile {
    display: block;
  }
}

@media (max-width: 479px) {
  .menu-mobile {
    padding-left: 8px;
    padding-right: 8px;
  }
}

.menu-mobile.active {
  opacity: 1;
  pointer-events: all;
}

.menu-mobile__content {
  height: calc(100vh - 224px);
  overflow: auto;
  padding-bottom: 40px;
}

.menu-mobile__content::-webkit-scrollbar {
  width: 0;
  opacity: 0;
  display: none;
}

.menu-mobile__wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

@media (max-width: 479px) {
  .menu-mobile__wrapper {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.menu-mobile__item:last-of-type {
  width: 100%;
}

.menu-mobile__item-title {
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  color: var(--text-second);
  padding: 0 12px;
  margin-bottom: 8px;
}

.menu-mobile__item-link {
  font-weight: 600;
  display: block;
  padding: 6px 12px;
  margin-bottom: 6px;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
}

.menu-mobile__item-link.active {
  color: var(--primary);
}

.menu-mobile__item-link.not-click {
  pointer-events: none;
  opacity: 0.5;
}

.menu-mobile__footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0 16px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.menu-mobile__footer-text {
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
}

@media (max-width: 479px) {
  .menu-mobile__footer-text {
    max-width: 140px;
  }
}

/* dropdown */

.dropdown {
  position: relative;
  -webkit-user-select: none;
  user-select: none
}

.dropdown__btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 20px;
  border-radius: 16px;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 24px;
  font-weight: 500;
  letter-spacing: .08px;
  height: 44px;
  transition: .3s cubic-bezier(.65, .05, .36, 1);
  text-decoration: none;
  color: var(--text-main);
}

.dropdown__btn > img {
  width: 20px;
  height: 20px;
  transition: .3s cubic-bezier(.65, .05, .36, 1)
}

.dropdown__btn:hover {
  background: var(--bg-hover);
  border: 1px solid var(--bg-hover);
}

.dropdown__btn:hover::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
}

.dropdown__btn:hover .dropdown__list,
.dropdown__list:hover {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown__list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-main);
  padding: 8px;
  z-index: 10;
  width: max-content;
  min-width: 100%;
}

.dropdown__list .dropdown__link {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.dropdown__list .dropdown__link:hover {
  background: var(--bg-hover);
}

.dropdown__list .dropdown__link:active,
.dropdown__list .dropdown__link.active {
  background: var(--bg-hover);
  color: var(--primary);
}

.dropdown__list .dropdown__link.not-click {
  pointer-events: none;
  opacity: 0.5;
}

.dropdown__btn:hover .arrow {
  transform: rotate(-180deg);
}