/* Header Styles */
.site-header {
  box-shadow: 4px 8px 16px 0 rgba(69, 79, 89, 0.04);
  padding-bottom: 15px;
}
/* Top Header */
.top-header {
  background-color: var(--primary-color);
  color: var(--white);
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) 0;
}

.top-header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-header__left,
.top-header__right {
  display: flex;
  align-items: center;
}

.top-header__item {
  display: flex;
  align-items: center;
}

.top-header__item:last-child {
  margin-right: 0;
}

.top-header__city,
.top-header__email,
.top-header__hours,
.top-header__account {
  display: flex;
  align-items: center;
  color: var(--white);
  font-size: var(--font-size-md);
}

.top-header__email:hover,
.top-header__account:hover,
.top-header__social-link:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none; /* Улучшение для доступности */
  outline: none;
}

.top-header__email:focus,
.top-header__account:focus,
.top-header__social-link:focus {
  outline: 1px dotted var(--white);
  text-decoration: underline; /* Улучшение для доступности */
}

.top-header i {
  margin-right: 6px;
  font-size: 14px;
}

.top-header__divider {
  margin: 0 var(--spacing-sm);
  color: rgba(255, 255, 255, 0.5);
}

.top-header__socials {
  display: flex;
  align-items: center;
  margin-left: var(--spacing-md);
}

.top-header__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  margin-left: 12px;
  transition: color var(--transition-fast);
}

.top-header__social-link:first-child {
  margin-left: 0;
}

.main-header {
  padding-top: 20px;
}

.main-header__logo .logo {
  display: flex;
  align-items: center;
  column-gap: 5px;
}

.main-header__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-header__logo {
  width: 15%;
}

.main-header__search {
  width: 53%;
}

.main-header__contact {
  width: 26%;
}

.contact-info {
  display: flex;
  align-items: center;
  column-gap: 50px;
}

.contact-info__text {
  display: flex;
  flex-direction: column;
}

.contact-info__text span {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--black);
}

.contact-info__text .contact-info__email {
  font-size: var(--font-size-md);
}

.contact-info__phone {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--black);
}

.dgwt-wcas-style-pirx.dgwt-wcas-style-pirx-compact
  .dgwt-wcas-sf-wrapp
  button.dgwt-wcas-search-submit {
  top: 10px !important;
}

html:not(.dgwt-wcas-overlay-mobile-on)
  .dgwt-wcas-style-pirx.dgwt-wcas-style-pirx-compact
  .dgwt-wcas-sf-wrapp
  input[type='search'].dgwt-wcas-search-input {
  border-radius: 10px !important;
  height: 48px !important;
}

.category-nav {
  margin-top: 25px;
}
.main-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-menu__first {
  display: flex;
  align-items: center;
  column-gap: 20px;
  width: 60%;
}

.main-menu__item--category {
  margin-right: 20px;
  width: 26%;
}

.main-menu__item--category button {
  display: flex;
  align-items: center;
  column-gap: 11px;
}

.main-menu__item--category span {
  margin-right: 20px;
}

.main-menu__item a {
  color: var(--black);
}

.main-menu__item--action a i {
  color: #ffe600;
}

.main-menu__last {
  display: flex;
  align-items: center;
  column-gap: 60px;
}

@media (max-width: 1440px) {
  .main-header__contact {
    width: 28%;
  }
  .contact-info {
    column-gap: 20px;
  }
  .main-header__search {
    width: 50%;
  }
}

@media (max-width: 1200px) {
  .main-header__contact {
    width: 32%;
  }

  .contact-info__phone {
    font-size: var(--font-size-md);
  }
  .main-header__search {
    width: 50%;
  }
}

@media (max-width: 992px) {
  .main-header__logo {
    width: 20%;
  }

  .main-header__search {
    width: 40%;
  }

  .main-header__contact {
    width: 36%;
  }

  .contact-info {
    column-gap: 10px;
  }

  .main-menu__first {
    width: 69%;
  }

  .main-menu__last {
    column-gap: 20px;
  }
  .main-menu__item--category span {
    margin-right: 10px;
  }
  .main-menu__item--category {
    margin-right: 5px;
    width: 27%;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .top-header {
    display: none;
  }

  .main-header__logo {
    width: 25%;
  }

  .main-header__search {
    width: 72%;
  }

  .main-header__contact {
    display: none;
  }

  .category-nav {
    display: none;
  }
}

@media (max-width: 620px) {
  .main-header__search {
    width: 10%;
  }
  .main-header__logo {
    width: 30%;
  }
}

@media (max-width: 426px) {
  .main-header__logo {
    width: 40%;
  }
}

/* Мобильное нижнее меню */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: none;
}

.mobile-bottom-nav__content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 5px;
}

.mobile-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20%;
  color: var(--black);
  font-size: var(--font-size-sm);
  text-decoration: none;
  padding: 5px 0;
  position: relative;
}

.mobile-bottom-nav__item i {
  font-size: 20px;
  margin-bottom: 5px;
}

.mobile-bottom-nav__item.active {
  color: var(--primary-color);
}

.mobile-bottom-nav__count {
  position: absolute;
  top: -3px;
  right: calc(50% - 20px);
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
}

/* Мобильный поиск */
.mobile-search {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 1001;
  display: none;
  overflow-y: auto;
  padding: 20px 0;
}

.mobile-search.active {
  display: block;
}

.mobile-search__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.mobile-search__close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--black);
  padding: 5px;
}

.mobile-search__content {
  padding-bottom: 80px;
}

@media (max-width: 992px) {
  .mobile-bottom-nav {
    display: block;
  }
  .xoo-wsc-cart-trigger {
    background-color: #fff !important;
  }
  .main-header__search {
    width: 65%;
  }
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }

  .xoo-wsc-basket[style*='block'] {
    display: none !important;
  }
  .xoo-wsc-basket {
    display: none !important;
  }

  /* Добавляем отступ внизу для контента, чтобы он не перекрывался меню */
  #content,
  footer {
    padding-bottom: 60px;
  }
}

/* Мобильное боковое меню */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background-color: #fff;
  z-index: 1010;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  visibility: hidden; /* Улучшено для доступности */
}

.mobile-sidebar.active {
  transform: translateX(0);
  visibility: visible; /* Улучшено для доступности */
}

.mobile-sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eaeaea;
}

.mobile-sidebar__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0; /* Сброс стандартных отступов для h2 */
}

.mobile-sidebar__close {
  background: none;
  border: none;
  font-size: 20px;
  color: #333;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.mobile-sidebar__close:hover,
.mobile-sidebar__close:focus {
  background-color: #f5f5f5;
  outline: none;
}

.mobile-sidebar__content {
  padding: 15px;
}

.mobile-menu-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.mobile-menu-list__item {
  margin-bottom: 8px;
}

.mobile-menu-list__item a {
  display: flex;
  align-items: center;
  color: #333;
  font-size: 16px;
  text-decoration: none;
  padding: 10px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.mobile-menu-list__item a:hover,
.mobile-menu-list__item a:focus {
  background-color: #f5f5f5;
  outline: none;
}

.mobile-menu-list__item a i {
  margin-right: 12px;
  min-width: 20px;
  text-align: center;
}

.mobile-sidebar__contacts {
  margin-bottom: 20px;
  border-top: 1px solid #eaeaea;
  padding-top: 20px;
}

.mobile-sidebar__phone,
.mobile-sidebar__email,
.mobile-sidebar__hours {
  display: flex;
  align-items: center;
  color: #333;
  font-size: 14px;
  margin-bottom: 12px;
  text-decoration: none;
  padding: 8px;
  border-radius: 4px;
}

.mobile-sidebar__phone:hover,
.mobile-sidebar__email:hover,
.mobile-sidebar__phone:focus,
.mobile-sidebar__email:focus {
  background-color: #f5f5f5;
  outline: none;
}

.mobile-sidebar__contacts i {
  margin-right: 12px;
  min-width: 20px;
  text-align: center;
}

.mobile-sidebar__socials {
  display: flex;
  margin-top: 20px;
  border-top: 1px solid #eaeaea;
  padding-top: 20px;
}

.mobile-sidebar__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  margin-right: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.mobile-sidebar__social-link:hover,
.mobile-sidebar__social-link:focus {
  opacity: 0.85;
  outline: none;
}

/* Скрытые заголовки для доступности */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Затемнение фона при открытом меню */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1005;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Блокировка прокрутки страницы при открытом меню */
body.mobile-menu-open {
  overflow: hidden;
}

@media (max-width: 540px) {
  .mobile-bottom-nav__item {
    font-size: var(--font-size-xs);
  }
}
