.top-header {
  color: #fff;
  background-color: #000;

  .top-header__content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 5.625rem;
    padding: 0.625rem 0;
  }

  .top-header__favourite,
  .top-header__cart {
    position: relative;
    z-index: 5;
  }

  .top-header__menu {
    flex: 1 1 auto;
  }

  .top-header__user {
    position: relative;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    padding-left: 2.1875rem;

    &::before {
      content: url("/Img/Incons/User.svg");
      position: absolute;
      left: 0;
    }
  }
}

.menu {
  display: none;
}

.menu-top-header__list,
.menu__list {
  display: flex;
  flex-wrap: wrap;
  row-gap: 5px;
  column-gap: 4.2%;
}

.menu-top-header__link,
.menu__link {
  font-size: 1rem;
  line-height: 125%;
}

.icon-menu {
  display: none;
}

/* BODY-HEADER */

.body-header {
  background-color: #ecf1f2;

  .body-header__content {
    display: flex;
    align-items: center;
    min-height: 6.875rem;
    padding: 0.625rem 0;
  }

  .body-header__search {
    flex: 1 1 auto;
  }
}

.search-header {
  position: relative;
  border-radius: 3px;
  border: 1px solid rgba(4, 4, 4, 0.5);
  background-color: rgba(7, 7, 7, 0.03);

  .search-header__button {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.5625rem;
    width: 2.5625rem;
    top: 0;
    left: 0.5rem;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.5);
    background-color: transparent;

    &::before {
      position: absolute;
      content: url("/Img/Incons/Search.svg");
    }
  }

  .search-header__input {
    height: 2.5625rem;
    width: 100%;
    color: #000;
    background-color: transparent;
    padding: 0 1.25rem 0 3.125rem;

    &::placeholder {
      color: rgba(0, 0, 0, 0.5);
    }
  }
}

.actions-header {
  .actions-header__phones {
    position: relative;
    z-index: 5;
  }

  .actions-header__content {
    display: flex;
    align-items: center;
    column-gap: 30px;
  }

  .actions-header__location {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-weight: 600;

    &::before {
      content: url("/Img/Incons/Location.svg");
      margin-right: 10px;
    }
  }

  .actions-header__cart {
    flex: 0 0 auto;
  }
}

.phones-header {
  .phones-header__item {
    position: relative;
    display: flex;
  }

  .phones-header__phone {
    font-weight: 600;
    white-space: nowrap;
  }

  .phones-header__arrow {
    position: relative;
    cursor: pointer;
    margin-left: 0.625rem;
    padding: 0.625rem;

    &::before,
    &::after {
      position: absolute;
      content: "";
      display: inline-block;
      height: 0.125rem;
      width: 0.75rem;
      border-radius: 0.1875rem;
      background-color: #e8aa31;
      transition: all 0.3s ease-in-out;
    }

    &::before {
      transform: rotate(-45deg);
    }

    &::after {
      transform: rotate(45deg);
      left: 0.1875rem;
    }
  }

  .phones-header__arrow.active.phones-header__arrow::before {
    transform: rotate(45deg);
  }

  .phones-header__arrow.active.phones-header__arrow::after {
    transform: rotate(-45deg);
  }

  .phones-header__list {
    position: absolute;
    z-index: 10;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    border-radius: 0.625rem;
    background-color: #fff;
    color: #141414;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: max-height 0.4s ease-in-out;

    &.show {
      max-height: 500px;
    }

    & li {
      padding: 0.625rem;
    }
  }

  .phones-header__callback {
    font-family: inherit;
    font-weight: 700;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
    color: #e8aa31;
  }
}

.popup {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 0;
  justify-content: center;
  align-items: center;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.5);
  transition: height 0.3s ease-in-out;

  .popup__content {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 300px;
    border-radius: 15px;
    background-color: #fff;
    padding: 0.625rem;
    margin: 25% auto;
  }

  .popup__title {
    font-weight: 700;
    font-size: 2.25rem;
    line-height: 128%;
  }

  .popup__text {
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 170%;
  }
}

.popup.popup_active .popup__content {
  display: flex;
}

.popup.popup_active {
  height: 100%;
}

.cart-header {
  display: flex;
  align-items: center;
  column-gap: 0.9375rem;
  line-height: 125%;

  .cart-header__body {
    font-size: 1rem;
  }

  .cart-header__sum:not(:last-child) {
    margin-bottom: 0.3125em;
  }

  .cart-header__link {
    color: #e8aa31;
  }
}

.top-header__cart,
.cart-header__icon {
  position: relative;
}

.top-header__cart span,
.cart-header__icon span {
  position: absolute;
  top: 0;
  right: -4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0.875rem;
  height: 0.875rem;
  font-size: 0.5rem;
  border-radius: 50%;
  color: #fff;
  background-color: #e8aa31;
}

/* CATALOG-HEADER */

.header__catalog {
  position: relative;
}

.catalog-header {
  color: #fff;
  background-color: #000;
}

.menu-catalog {
  .menu-catalog__list {
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }

  .menu-catalog__link {
    position: relative;
    display: inline-flex;
    transition: color 0.3s ease-in-out;

    &::after {
      position: absolute;
      opacity: 0;
      visibility: hidden;
      content: "";
      left: 0.625rem;
      bottom: 0;
      width: 100%;
      height: 1px;
      background-color: #e8aa31;
      transition: all 0.3s ease-in-out;
    }
  }

  .menu-catalog__sub-menu {
    width: 100%;
    background-color: #000;
  }
}

  .sub-menu-catalog {
  .sub-menu-catalog__container {
    padding: 0 0.625rem;
  }

  .sub-menu-catalog__block {
    display: none;
  }

  .sub-menu-catalog__list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 1.875rem 0.9375rem 1.875rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  }

  .sub-menu-catalog__footer {
    padding: 1.875rem 0.9375rem 1.875rem 0;
  }

  .sub-menu-catalog__all {
    color: #e8aa31;
  }
}

.sub-menu-catalog__block._sub-menu-open {
  display: grid;
  justify-content: start;
  grid-template-columns: repeat(5, minmax(auto, 20rem));
}

/* MEDIA (PC) */

@media (min-width: 1025px) {
  .hover_underline:hover {
    text-decoration: underline;
  }

  .hover_underline-span span:hover {
    text-decoration: underline;
  }
}

@media (max-width: 1224px) {
  .body-header__search {
    padding-left: 1.8%;
  }
}

@media (max-width: 1250px) {
  .cart-header__body {
    display: none;
  }
}

/* MEDIA (TABLET) */

@media (max-width: 1000px) {
  .actions-header__content {
    column-gap: 15px;
  }
}

@media (min-width: 1023px) {
  .top-header__favourite,
  .top-header__cart,
  .menu-top-header__link_arrow,
  .menu-catalog__back,
  .sub-menu-catalog__back {
    display: none;
  }

  .body-header__search {
    padding-right: 1.25rem;
    padding-left: 10%;
  }

  .search-header {
    max-width: 23.5625rem;
  }

  .menu-catalog__link {
    min-height: 70px;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 0.625rem;
  }

  .menu-catalog__link.hover_underline:hover {
    color: #e8aa31;
  }

  .menu-catalog__link.hover_underline:hover.menu-catalog__link::after {
    opacity: 1;
    visibility: visible;
  }

  .back-sub-menu-catalog,
  .menu-catalog__link img {
    display: none;
  }

  .sub-menu-catalog__category {
    font-weight: 700;
    padding: 1.875rem 0;
  }
}

@media (max-width: 1023px) {
  .top-header__content {
    gap: 1.875rem;
  }

  .top-header__user span {
    display: none;
  }

  .top-header__user {
    padding-left: 1.5625rem;
  }

  .phones-header__phone {
    font-size: 1.5625rem;
  }

  .phones-header__arrow,
  .phones-header__callback {
    display: none;
  }

  .menu {
    display: flex;
    justify-content: flex-end;
    flex: 1 1 auto;
  }

  .menu-top-header {
    display: none;
  }

  .menu-top-header__list {
    flex-direction: column;
    row-gap: 25px;
  }

  html.menu-open .menu__body {
    left: 0;
  }

  .menu__body {
    position: fixed;
    z-index: 4;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 6.25rem 0.9375rem 3.125rem 0.9375rem;
    background-color: #000;
    transition: left 0.3s ease 0s;

    .menu__body::before {
      content: "";
      position: fixed;
      top: 0;
      left: -100%;
      width: 100%;
      height: 70px;
      background-color: #000;
    }
  }

  html.menu-open .menu__body::before {
    left: 0;
  }

  .menu-top-header__link {
    font-size: 1.25rem;
  }

  .menu-top-header__link_arrow {
    display: inline-flex;
    gap: 98px;
  }

  .body-header__content {
    justify-content: space-between;
  }

  .actions-header__content {
    display: none;
  }

  .actions-header__favourite,
  .cart-header {
    display: none;
  }

  .menu-catalog__list:not(:first-child) {
    padding-top: 1.45em;
  }

  .menu-catalog,
  .sub-menu-catalog__block {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 1.5625rem 0.9375rem 3.125rem 0.9375rem;
    background-color: #000;
    transition: left 0.3s ease 0s;
  }

  .sub-menu-catalog__link-category {
    font-size: 1.25rem;
  }

  html.catalog-open .menu-catalog,
  html.sub-catalog-open .sub-menu-catalog__block {
    left: 0;
    z-index: 6;
  }

  html.sub-catalog-open .back-sub-menu-catalog,
  .menu-catalog__back {
    position: relative;
    font-family: inherit;
    font-weight: inherit;
    display: inline-flex;
    align-items: center;
    font-size: 1.25rem;
    line-height: 125%;
    color: #fff;
    padding-left: 30px;
    transition: all 0.3s ease 0s;
  }

  html.sub-catalog-open .menu-catalog__back {
    display: none;
  }

  html.sub-catalog-open .back-sub-menu-catalog {
    z-index: 7;
  }

  html.sub-catalog-open .back-sub-menu-catalog::before,
  .menu-catalog__back::before {
    position: absolute;
    left: 0;
    content: url("/Img/Incons/Arrow-back.svg");
  }

  .menu-catalog__list {
    row-gap: 1.5625rem;
    flex-direction: column;
  }

  .menu-catalog__link {
    display: inline-flex;
    gap: 98px;
    font-size: 1.25rem;
  }

  .sub-menu-catalog__block._sub-menu-open {
    display: block;
  }

  .sub-menu-catalog__block {
    padding-top: 4.8125rem;
  }

  .sub-menu-catalog__list,
  .sub-menu-catalog__footer {
    display: none;
  }

  .sub-menu-catalog__category:not(:last-child) {
    margin-bottom: 1.5625rem;
  }

  .icon-menu,
  .close-icon-menu {
    display: block;
    position: relative;
    z-index: 100;
    width: 40px;
    height: 22.5px;
    cursor: pointer;
  }

  .icon-menu::before,
  .icon-menu::after,
  .icon-menu span {
    position: absolute;
    left: 0px;
    width: 100%;
    height: 2px;
    background-color: #fff;
    transition: all 0.3s ease 0s;
  }

  .icon-menu::before,
  .icon-menu::after {
    content: "";
  }

  .icon-menu::before {
    top: 0px;
  }

  .icon-menu span {
    top: 43.6%;
  }

  .icon-menu::after {
    bottom: 0px;
  }

  .close-icon-menu span {
    display: none;
  }

  .close-icon-menu::before {
    top: 10px;
    transform: rotate(45deg);
  }

  .close-icon-menu::after {
    bottom: 10px;
    transform: rotate(-45deg);
  }
}

/* MEDIA (MOBILE) */

@media (max-width: 767px) {
  .phones-header__phone::before {
    content: url(/Img/Incons/Phone.svg);
  }

  .phones-header__phone span {
    display: none;
  }

  .header__catalog {
    padding: 1.25rem 0;
  }

  .search-header {
    background-color: #fff;
  }

  .body-header__search {
    padding-left: 0;
  }
}
