/**
 * Шапка сайта - обновленный дизайн
 */

/* Мобильная шапка - скрыта на десктопе */
.mobile-only {
  display: none;
}

/* Десктопная шапка - скрыта на мобильных */
.desktop-only {
  display: block;
}

@media (max-width: 991px) {
  .mobile-only {
    display: block;
  }
  
  .desktop-only {
    display: none;
  }
}

.header-new {
  background: #fff;
  position: relative;
  z-index: 2000;
}

/* Баннер: уточняйте цены у менеджеров */
.sortmet-alert {
  background: #f0cf4c;
  border-bottom: 1px solid #e5bc30;
  padding: 6px 0;
  font-size: 13px;
}

.sortmet-alert.was-closed {
  display: none;
}

.sortmet-alert .wrapper {
  max-width: 1392px;
  margin: 0 auto;
  padding: 0 32px;
}

.sortmet-alert__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}

.sortmet-alert__text {
  color: #1a1a1a;
  font-weight: 500;
  line-height: 1.3;
}

.sortmet-alert__close {
  position: absolute;
  right: 0;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.sortmet-alert__close:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

/* === ВЕРХНЯЯ ПАНЕЛЬ === */
.utility-nav {
  background: #fff;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.utility-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1392px;
  padding: 0 32px;
}

.utility-nav__left,
.utility-nav__center,
.utility-nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.utility-nav__center {
  flex: 1;
  justify-content: center;
}

/* Выбор города */
.utility-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1a1a1a;
  font-weight: 500;
}

.utility-nav__item i {
  color: #1a1a1a;
  font-size: 16px;
}

.header__select_city {
  color: #1a1a1a;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.header__select_city_text {
  position: relative;
  padding-right: 16px;
}

.header__select_city_text::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #f4ce47;
}

/* Меню */
.utility-nav__menu {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.utility-nav__link {
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  font-size: 12px;
}

.utility-nav__link:hover {
  color: #f4ce47;
}

/* Dropdown */
.utility-nav__dropdown {
  position: relative;
}

.utility-nav__dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.utility-nav__dropdown-toggle i {
  font-size: 10px;
}

.utility-nav__dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 4px 0;
  z-index: 1000;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transition-delay: 0.1s;
}

.utility-nav__dropdown:hover .utility-nav__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

/* Расширенная область для наведения — псевдоэлемент */
.utility-nav__dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 20px;
  z-index: 999;
}

.utility-nav__dropdown:hover::before {
  height: 30px;
}

.utility-nav__dropdown-item {
  display: block;
  padding: 6px 12px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.utility-nav__dropdown-item:hover {
  background: #f5f5f5;
  color: #f4ce47;
}

/* Телефон и соцсети справа */
.utility-nav__phone {
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.utility-nav__social {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #e5e7eb;
}

.utility-nav__social-link {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #9ca3af;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: 13px;
}

.utility-nav__social-link--tg:hover {
  background: #0088cc;
  color: #fff;
}

.utility-nav__social-link--wa:hover {
  background: #25d366;
  color: #fff;
}

/* === СРЕДНЯЯ ПАНЕЛЬ (с поиском) === */
.main-header {
  background: #3a4149;
  padding: 10px 0;
  transition: all 0.3s ease;
}

/* Фиксированная шапка на десктопе */
.main-header--fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2001;
  animation: slideDownDesktop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@keyframes slideDownDesktop {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1392px;
  padding: 0 32px;
}

.main-header__left {
  flex-shrink: 0;
}

.main-header__catalog {
  flex-shrink: 0;
  position: relative;
}

.main-header__logo-img {
  width: 130px;
  height: auto;
  filter: brightness(0) invert(1);
}

.main-header__logo-text {
  display: inline-flex;
  align-items: center;
  height: 38px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 20px;
  text-transform: uppercase;
}

.mobile-bottom-bar__logo-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 14px;
  text-transform: uppercase;
}

.main-header__center {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.main-header__search {
  width: 100%;
  position: relative;
}

.main-header__search-wrapper {
  display: flex;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  height: 36px;
}

.main-header__search-input {
  flex: 1;
  padding: 0 14px;
  border: none;
  font-size: 13px;
  color: #333;
  background: transparent;
}

.main-header__search-input::placeholder {
  color: #999;
}

.main-header__search-input:focus {
  outline: none;
}

.main-header__search-btn {
  width: 42px;
  background: #4a525a;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 14px;
  transition: background 0.2s;
}

.main-header__search-btn:hover {
  background: #5a626a;
}

.main-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.main-header__cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: #fff;
  text-decoration: none;
  position: relative;
  font-size: 18px;
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #f4ce47;
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Кнопка поиска (десктоп) */
.main-header__search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.main-header__search-toggle:hover {
  background: rgba(255,255,255,0.1);
  color: #f4ce47;
}

/* === AUTOCOMPLETE DROPDOWN === */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 2100;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  margin-top: 4px;
}

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

.search-autocomplete__section {
  border-bottom: 1px solid #f0f0f0;
}

.search-autocomplete__section:last-child {
  border-bottom: none;
}

.search-autocomplete__section-title {
  padding: 10px 14px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-autocomplete__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: #1a1a1a;
  transition: background 0.15s;
  cursor: pointer;
}

.search-autocomplete__item:hover,
.search-autocomplete__item.highlighted {
  background: #f9fafb;
}

.search-autocomplete__item-image {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}

.search-autocomplete__item-image i {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
  font-size: 16px;
}

.search-autocomplete__item-info {
  flex: 1;
  min-width: 0;
}

.search-autocomplete__item-title {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-autocomplete__item-price {
  font-size: 12px;
  color: #059669;
  font-weight: 600;
  margin-top: 2px;
}

.search-autocomplete__item-type {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 1px;
}

.search-autocomplete__footer {
  padding: 10px 14px;
  background: #f9fafb;
  border-top: 1px solid #f0f0f0;
}

.search-autocomplete__all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.search-autocomplete__all-link:hover {
  background: #f0cf4c;
}

.search-autocomplete__empty {
  padding: 20px 14px;
  text-align: center;
  color: #6b7280;
  font-size: 13px;
}

/* Autocomplete в попапе поиска */
.search-popup__content .search-autocomplete {
  position: static;
  margin-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: none;
  border-top: 1px solid #e5e7eb;
  max-height: 300px;
}

/* === НИЖНЯЯ ПАНЕЛЬ (каталог) === */
.category-nav {
  background: #f8f9fa;
  padding: 0;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.category-nav .container {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1392px;
  padding: 0 32px;
  height: 44px;
}

/* Кнопка каталога */
.main-header__catalog-wrapper {
  position: relative;
}

.main-header__catalog-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  background: #f4ce47;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  color: #1a1a1a;
  transition: background 0.2s;
}

.main-header__catalog-btn:hover {
  background: #e5bf38;
}

.main-header__catalog-btn i {
  font-size: 14px;
}

/* Меню категорий */
.category-nav__list {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.category-nav__list::-webkit-scrollbar {
  display: none;
}

.category-nav__item {
  color: #1a1a1a;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 4px;
}

.category-nav__item:hover {
  color: #f4ce47;
}

/* Category dropdown - fixed */
.category-nav__item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
}

.category-nav__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  max-width: 280px;
  background: #fff;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 6px 0;
  z-index: 99999;
  max-height: 320px;
  overflow-y: auto;
}

.category-nav__item-wrapper:hover .category-nav__dropdown,
.category-nav__item-wrapper:focus-within .category-nav__dropdown {
  display: block;
}

/* Keep dropdown open when hovering over it */
.category-nav__dropdown:hover {
  display: block;
}

.category-nav__dropdown-item {
  display: block;
  padding: 6px 14px;
  color: #1a1a1a;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.category-nav__dropdown-item:hover {
  background: #f9fafb;
  color: #f4ce47;
}

.category-nav__dropdown-more {
  display: block;
  padding: 8px 14px;
  color: #f4ce47;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  border-top: 1px solid #f3f4f6;
  margin-top: 4px;
}

.category-nav__dropdown-more:hover {
  color: #d4b73f;
}

/* Кнопка Для юрлиц */
.category-nav__business-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 32px;
  background: #e8f4fd;
  color: #0066cc;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
  margin-left: auto;
}

.category-nav__business-btn:hover {
  background: #d0e8fa;
}

.category-nav__business-btn i {
  font-size: 14px;
}

/* === ВЫПАДАЮЩЕЕ МЕНЮ КАТАЛОГА (MEGAMENU) === */
.categories-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 12px;
  background: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 1280px;
  max-height: 80vh;
  overflow: hidden;
}

.categories-dropdown__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

.categories-dropdown__close:hover {
  background: #e5e7eb;
  color: #1a1a1a;
}

/* Подменю начинается там же, где логотип (левый край контента) */
.main-header .container {
  position: relative;
}

.main-header__catalog-wrapper,
.main-header__catalog {
  position: static;
}

.categories-dropdown {
  left: var(--container-padding, 32px);
  top: 100%;
  margin-top: 12px;
  max-width: calc(100vw - 2 * var(--container-padding, 32px));
}

.main-header__catalog-wrapper.is-open .categories-dropdown,
.main-header__catalog-wrapper.is-hover .categories-dropdown {
  display: block;
}

.categories-dropdown__container {
  display: flex;
  min-height: 420px;
}

/* Левая колонка - категории (как в референсе) */
.categories-dropdown__sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 20px 0;
  background: #f5f6f8;
  border-right: 1px solid #e5e7eb;
}

.categories-dropdown__item {
  margin: 0;
  cursor: pointer;
}

.categories-dropdown__item:hover,
.categories-dropdown__item.active {
  background: #fff;
  box-shadow: 0 1px 0 0 #e5e7eb;
}

.categories-dropdown__item.active .categories-dropdown__link {
  color: #1a1a1a;
  font-weight: 600;
}

.categories-dropdown__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.categories-dropdown__link:hover {
  color: #1a1a1a;
  background: #fff;
}

.categories-dropdown__item.active .categories-dropdown__icon {
  color: #f4ce47;
}

.categories-dropdown__link-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.categories-dropdown__icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  text-align: center;
  color: #f4ce47;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.categories-dropdown__icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}

.categories-dropdown__arrow {
  font-size: 12px;
  color: #999;
}

/* Правая колонка - подкатегории + промо */
.categories-dropdown__content {
  flex: 1;
  min-width: 0;
  padding: 24px 24px 24px 32px;
  background: #fff;
  overflow-y: auto;
  max-height: 80vh;
}

.categories-dropdown__panel {
  display: none;
  height: 100%;
  flex-direction: column;
}

.categories-dropdown__panel.active {
  display: flex;
}

.categories-dropdown__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  display: block;
  flex-shrink: 0;
}

.categories-dropdown__title a {
  color: #1a1a1a;
  text-decoration: none;
}

.categories-dropdown__title a:hover {
  color: #f4ce47;
}

/* Прокручиваемая область со списком подкатегорий (как в референсе) */
.categories-dropdown__panel-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -4px 0 0;
  padding-right: 4px;
}

.categories-dropdown__list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 16px;
  align-content: start;
}

.categories-dropdown__list-item {
  margin: 0;
  padding: 0;
}

.categories-dropdown__subcategory {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: #4b5563;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  border-bottom: none;
}

.categories-dropdown__subcategory:hover {
  color: #f4ce47;
}

.categories-dropdown__no-children {
  margin: 0 0 16px;
  color: #666;
  font-size: 14px;
}

/* Сетка оставлена для обратной совместимости, если где-то используется */
.categories-dropdown__subcategories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 32px;
  flex: 1;
  align-content: start;
}

.categories-dropdown__subcategory:hover {
  color: #f4ce47;
}

.categories-dropdown__subcategory::before {
  content: '+';
  width: 14px;
  height: 14px;
  min-width: 14px;
  border: 1px solid #ddd;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #999;
  flex-shrink: 0;
}

.categories-dropdown__subcategory--parent {
  font-weight: 700;
  color: #1a1a1a;
}

.categories-dropdown__sublist {
  list-style: none;
  margin: 0 0 2px 0;
  padding: 0 0 0 22px;
}

.categories-dropdown__sublist-item {
  margin: 0;
  padding: 0;
}

.categories-dropdown__sublist .categories-dropdown__subcategory {
  padding: 2px 0;
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
}

.categories-dropdown__sublist .categories-dropdown__subcategory::before {
  content: '·';
  border: none;
  font-size: 14px;
}

.categories-dropdown__all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 20px;
  background: #f4ce47;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: 6px;
  transition: background 0.2s;
  flex-shrink: 0;
  width: fit-content;
}

.categories-dropdown__all-link:hover {
  background: #e5bf38;
}

.categories-dropdown__all-link i {
  font-size: 12px;
}

/* Блок акций/промо справа (как в референсе) */
/* Блок акции в подменю: Весь каталог металлопроката */
.categories-dropdown__promo {
  width: 200px;
  flex-shrink: 0;
  padding: 12px;
  background: linear-gradient(165deg, #2d3e50 0%, #1c2833 50%, #151d26 100%);
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.categories-dropdown__promo-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
  width: 100%;
  text-align: center;
  min-height: 0;
}

.categories-dropdown__promo-inner:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(244, 206, 71, 0.35);
  color: #fff;
  transform: translateY(-2px);
}

.categories-dropdown__promo-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(244, 206, 71, 0.2);
  color: #f4ce47;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 8px;
  flex-shrink: 0;
  transition: background 0.25s, color 0.25s;
}

.categories-dropdown__promo-inner:hover .categories-dropdown__promo-icon-wrap {
  background: rgba(244, 206, 71, 0.3);
  color: #ffd54f;
}

.categories-dropdown__promo-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.categories-dropdown__promo-text {
  font-size: 10px;
  opacity: 0.85;
  margin-bottom: 8px;
  line-height: 1.35;
}

.categories-dropdown__promo-arrow {
  font-size: 11px;
  color: #f4ce47;
  opacity: 0.9;
}

.categories-dropdown__promo-arrow i {
  display: inline-block;
  transition: transform 0.2s;
}

.categories-dropdown__promo-inner:hover .categories-dropdown__promo-arrow {
  opacity: 1;
}

.categories-dropdown__promo-inner:hover .categories-dropdown__promo-arrow i {
  transform: translateX(4px);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Мобильное меню */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 2300;
  padding: 16px;
  padding-top: 60px;
  overflow-y: auto;
}

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

.mobile-menu__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 24px;
  color: #666;
  cursor: pointer;
}

.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu__link {
  display: block;
  padding: 14px 0;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu__link:hover {
  color: #f4ce47;
}

body.mobile-menu-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 1200px) {
  .category-nav__list {
    gap: 20px;
  }
  
  .utility-nav__menu {
    gap: 20px;
  }
  
  .categories-dropdown {
    width: 1100px;
  }
  
  .categories-dropdown__promo {
    width: 180px;
    padding: 16px;
  }
  
  .categories-dropdown__promo-inner {
    padding: 16px;
  }
  
  .categories-dropdown__promo-icon-wrap {
    width: 42px;
    height: 42px;
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .categories-dropdown__promo-title {
    font-size: 13px;
  }
  
  .categories-dropdown__promo-text {
    font-size: 11px;
    margin-bottom: 10px;
  }
}

@media (max-width: 992px) {
  .utility-nav__center {
    display: none;
  }
  
  .main-header .container {
    flex-wrap: wrap;
  }
  
  .main-header__center {
    order: 3;
    width: 100%;
    max-width: none;
  }
  
  .category-nav__list {
    display: none;
  }
  
  .categories-dropdown {
    width: 320px;
    max-width: calc(100vw - 2 * var(--container-padding, 32px));
    left: var(--container-padding, 32px);
  }
  
  .categories-dropdown__close {
    display: none !important;
  }
  
  .categories-dropdown__container {
    flex-direction: column;
  }
  
  .categories-dropdown__sidebar {
    width: 100%;
    border-right: none;
    border-bottom: none;
  }
  
  .categories-dropdown__content {
    display: none;
  }
  
  /* Акция «Весь каталог металлопроката»: полная ширина под списком категорий */
  .categories-dropdown__promo {
    display: flex !important;
    width: 100%;
    padding: 0 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  
  .categories-dropdown__promo-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    width: 100%;
  }
  
  .categories-dropdown__promo-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  
  .categories-dropdown__promo-text {
    font-size: 11px;
    margin-bottom: 8px;
  }
  
  .categories-dropdown__promo-icon-wrap {
    width: 40px;
    height: 40px;
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .categories-dropdown__promo-arrow {
    align-self: flex-end;
    font-size: 12px;
  }
}

/* ========================================
   МОБИЛЬНАЯ ШАПКА (новая версия)
   ======================================== */

/* Мобильная верхняя панель (телефон + email) */
.mobile-top-bar {
  display: none;
  background: #f5f5f5;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.mobile-top-bar__phone {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.mobile-top-bar__phone i {
  color: #f4ce47;
  font-size: 12px;
}

.mobile-top-bar__email {
  color: #0066cc;
  text-decoration: none;
  font-size: 13px;
}

/* Мобильная нижняя панель (иконки) */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  z-index: 2100;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-bar__container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 56px;
  max-width: 1392px;
  margin: 0 auto;
  padding: 0 8px;
}

.mobile-bottom-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #666;
  text-decoration: none;
  font-size: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  min-width: 56px;
  position: relative;
}

.mobile-bottom-bar__item i {
  font-size: 20px;
  color: #666;
}

.mobile-bottom-bar__item span {
  font-size: 10px;
  line-height: 1.2;
}

.mobile-bottom-bar__item:active,
.mobile-bottom-bar__item:hover {
  color: #f4ce47;
}

.mobile-bottom-bar__item:active i,
.mobile-bottom-bar__item:hover i {
  color: #f4ce47;
}

.mobile-bottom-bar__logo {
  padding: 4px;
}

.mobile-bottom-bar__logo-img {
  height: 28px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
}

.mobile-bottom-bar__cart .cart-count {
  position: absolute;
  top: 2px;
  right: 6px;
  background: #f4ce47;
  color: #1a1a1a;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Мобильный оверлей поиска */
.mobile-search-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  z-index: 2200;
  padding: 12px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.mobile-search-overlay__header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mobile-search-form {
  flex: 1;
  display: flex;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.mobile-search-form__input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 15px;
}

.mobile-search-form__input:focus {
  outline: none;
}

.mobile-search-form__btn {
  padding: 0 14px;
  border: none;
  background: #f4ce47;
  color: #1a1a1a;
  cursor: pointer;
}

.mobile-search-overlay__close {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 20px;
  color: #666;
  cursor: pointer;
}

@media (max-width: 768px) {
  .sortmet-alert .wrapper {
    padding: 0 16px;
  }
  .sortmet-alert__text {
    font-size: 12px;
  }
  /* Показываем мобильную верхнюю панель */
  .mobile-top-bar {
    display: block;
  }
  
  /* Скрываем десктопную утилити-навигацию */
  .utility-nav {
    display: none;
  }
  
  /* Меняем основную шапку для мобильных */
  .main-header {
    background: #fff;
    padding: 0;
    border-bottom: 1px solid #e5e7eb;
  }
  
  .main-header .container {
    padding: 0;
    height: 56px;
  }
  
  /* Скрываем логотип в основной шапке (он в нижней панели) */
  .main-header__left {
    display: none;
  }
  
  /* Скрываем кнопку каталога */
  .main-header__catalog {
    display: none;
  }
  
  /* Поиск в шапке скрыт (открывается по кнопке) */
  .main-header__center {
    display: none;
  }
  
  /* Корзина в шапке скрыта (в нижней панели) */
  .main-header__right {
    display: none;
  }
  
  /* Показываем мобильную нижнюю панель */
  .mobile-bottom-bar {
    display: block;
  }
  
  /* Скрываем категорийную навигацию */
  .category-nav {
    display: none;
  }
  
}

@media (max-width: 576px) {
  .utility-nav__social {
    display: none;
  }
  
  .utility-nav__phone span {
    display: none;
  }
  
  .main-header__logo-img {
    width: 110px;
  }
  
  .category-nav__business-btn span {
    display: none;
  }
}

/* Responsive header visibility */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}

/* ==================== ПОПАП ПОИСКА (десктоп) ==================== */
.search-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.search-popup.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.search-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.search-popup__content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    animation: popupSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popupSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.search-popup__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.search-popup__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.search-popup__close:hover {
    background: #e5e7eb;
    color: #1a1a1a;
}

.search-popup__form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-popup__input {
    flex: 1;
    height: 50px;
    padding: 0 18px;
    background: #f3f4f6;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.2s;
}

.search-popup__input:focus {
    background: #fff;
    border-color: #f0cf4c;
    outline: none;
}

.search-popup__submit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    height: 50px;
    background: #f0cf4c;
    border: none;
    border-radius: 10px;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-popup__submit:hover {
    background: #d4b73f;
}

.search-popup__hints {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.search-popup__hint-title {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px;
}

.search-popup__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-popup__tag {
    display: inline-block;
    padding: 8px 14px;
    background: #f3f4f6;
    border-radius: 20px;
    color: #374151;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.search-popup__tag:hover {
    background: #f0cf4c;
    color: #1a1a1a;
}

/* Мобильный попап поиска (ниже) */
@media (max-width: 991px) {
    .search-popup.active {
        padding-top: 80px;
    }
    
    .search-popup__content {
        padding: 20px;
        border-radius: 12px;
    }
    
    .search-popup__input {
        height: 44px;
        font-size: 15px;
    }
    
    .search-popup__submit {
        height: 44px;
        padding: 0 16px;
    }
    
    .search-popup__submit span {
        display: none;
    }
}


/* ==================== ПОПАП ВЫБОРА ГОРОДА ==================== */
.city-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
}

.city-popup.active {
    display: flex;
    align-items: flex-end;
}

@media (min-width: 640px) {
    .city-popup.active {
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
}

.city-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.city-popup__content {
    position: relative;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: citySlideUp 0.3s ease;
}

@media (min-width: 640px) {
    .city-popup__content {
        border-radius: 16px;
        max-width: 560px;
        max-height: 80vh;
    }
}

@keyframes citySlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.city-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.city-popup__title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.city-popup__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.city-popup__close:hover {
    background: #e5e7eb;
    color: #1a1a1a;
}

.city-popup__subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 20px;
}

.city-popup__section {
    margin-bottom: 20px;
}

.city-popup__section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}

.city-popup__popular {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-popup__city-btn {
    display: inline-block;
    padding: 8px 14px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.city-popup__city-btn:hover {
    background: #f0cf4c;
    color: #1a1a1a;
}

.city-popup__all {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}

@media (min-width: 480px) {
    .city-popup__all {
        grid-template-columns: repeat(3, 1fr);
    }
}

.city-popup__city-link {
    display: block;
    padding: 8px 10px;
    color: #6b7280;
    font-size: 14px;
    text-decoration: none;
    text-align: left;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-popup__city-link:hover {
    background: #f9fafb;
    color: #1a1a1a;
}

/* Кнопка выбора города в utility-nav */
.utility-nav__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.utility-nav__item:hover {
    color: #f0cf4c;
}
