.uc-rec-hidden {
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;

    width: 1px !important;
    height: 1px !important;

    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;

    margin: 0 !important;
    padding: 0 !important;

    visibility: hidden !important;
    z-index: -1 !important;
}

.catalog-megamenu-container {
    position: relative;
    display: inline-block;
    height: 100%;
}

/* ===== МЕГА-МЕНЮ ===== */
.catalog-megamenu {
    position: absolute;
    top: calc(100% + 8px); /* 8px отступ от кнопки */
    left: 0;
    z-index: 10000;
    
    width: 1360px;
    max-width: 90vw;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(136, 136, 136, 0.3);
    
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(-10px);
    transform-origin: left top; /* Анимация из левого верхнего угла */
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.catalog-megamenu.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

/* ===== КОНТЕНТ МЕГА-МЕНЮ ===== */
.megamenu-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 131px; /* Расстояние между блоками категорий */
    padding: 20px;
}

/* ===== СЕКЦИЯ КАТЕГОРИИ ===== */
.category-section {
    display: flex;
    flex-direction: column;
}

.category-section.active {
    opacity: 1;
}

.category-section.inactive {
    opacity: 0.6;
    pointer-events: none;
}

/* ===== ЗАГОЛОВОК КАТЕГОРИИ ===== */
.category-header {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Расстояние до подкатегорий */
    margin-bottom: 16px;
}

/* ===== ОБЁРТКА ИКОНКИ ===== */
.category-icon-wrapper {
    width: 92px;
    height: 92px;
    flex-shrink: 0;
}

/* ===== ИКОНКА КАТЕГОРИИ ===== */
.category-icon {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #F5F5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-icon:hover img {
    transform: scale(1.05);
}

.icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* ===== ГЛАВНАЯ КАТЕГОРИЯ ===== */
.main-category-link {
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.main-category-link.disabled {
    cursor: default;
}

.main-category-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 26px;
    color: #000000;
    margin: 0;
    transition: color 0.2s ease;
}

.main-category-link:not(.disabled):hover .main-category-title {
    color: #B90000;
}

.coming-soon {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #888888;
    margin-top: 4px;
    display: block;
}

/* ===== СПИСОК ПОДКАТЕГОРИЙ ===== */
.subcategories-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Расстояние между категориями */
    margin-left: 20px; /* Отступ слева для подкатегорий */
}

.subcategories-list.empty {
    min-height: 40px;
}

.empty-subcategories {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-style: italic;
    color: #888888;
    padding: 8px 0;
}

/* ===== ССЫЛКИ ПОДКАТЕГОРИЙ ===== */
.subcategory-link {
    text-decoration: none;
    display: block;
    padding: 4px 0;
}

.subcategory-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 26px;
    color: #000000;
    transition: all 0.2s ease;
    position: relative;
    padding-left: 0;
}

.subcategory-link:hover .subcategory-text {
    color: #B90000;
    padding-left: 8px;
}

.subcategory-link:hover .subcategory-text::before {
    content: "→";
    position: absolute;
    left: -12px;
    opacity: 0;
    animation: slideIn 0.2s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ОВЕРЛЕЙ ДЛЯ ЗАКРЫТИЯ ===== */
.megamenu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: transparent;
    display: none;
}

.megamenu-overlay.active {
    display: block;
}

/* ===== АДАПТИВНОСТЬ ===== */

/* Планшеты */
@media (max-width: 1400px) {
    .catalog-megamenu {
        width: 95vw;
        left: 50%;
        transform: translateX(-50%) scale(0.95) translateY(-10px);
    }
    
    .catalog-megamenu.active {
        transform: translateX(-50%) scale(1) translateY(0);
    }
    
    .megamenu-content {
        gap: 80px;
        padding: 20px;
    }
}

/* Мобильные устройства - АККОРДЕОН */
@media (max-width: 768px) {
    .catalog-megamenu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        border-radius: 0;
        transform: translateY(-100%);
        transform-origin: top left;
        overflow-y: auto;
        padding: 20px;
        box-shadow: none;
    }
    
    .catalog-megamenu.active {
        transform: translateY(0);
    }
    
    .megamenu-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0;
    }
    
    /* Скрываем неактивные категории на мобильных */
    .category-section.inactive {
        display: none;
    }
    
    .category-section.active {
        background: #FFFFFF;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .category-header {
        flex-direction: row;
        align-items: center;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .category-icon-wrapper {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }
    
    .subcategories-list {
        margin-left: 80px; /* Иконка + отступ */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .category-section.active .subcategories-list {
        max-height: 500px; /* Достаточно для всех подкатегорий */
    }
    
    .subcategory-link {
        padding: 12px 0;
        border-bottom: 1px solid #F0F0F0;
    }
    
    .subcategory-link:last-child {
        border-bottom: none;
    }
    
    .subcategory-text {
        font-size: 18px;
    }
    
    /* Кнопка закрытия на мобильных */
    .megamenu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #F5F5F5;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10001;
    }
    
    .megamenu-close svg {
        width: 20px;
        height: 20px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .subcategories-list {
        margin-left: 0;
    }
    
    .category-icon-wrapper {
        width: 50px;
        height: 50px;
    }
}

/* ===== Z-INDEX ДЛЯ РАЗНЫХ СТРАНИЦ ===== */

/* На главной странице (хедер + герой) */
.main-page .catalog-megamenu {
    z-index: 99999;
}

.main-page .megamenu-overlay {
    z-index: 99998;
}

/* На внутренних страницах */
.inner-page .catalog-megamenu {
    z-index: 10000;
}

.inner-page .megamenu-overlay {
    z-index: 9999;
}

/* Стили для кнопки корзины в хедере */
.header-cart-button {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 28px;
  text-decoration: none;
}

.cart-icon {
  width: 30px;
  height: 28px;
  color: #000000; /* Базовый цвет #000000 */
  transition: color 0.3s ease;
}

.header-cart-button:hover .cart-icon {
  color: #B90000; /* При наведении #B90000 */
}

/* Счетчик товаров в корзине */
.cart-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background-color: #B90000;
    border-radius: 50%;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    /* Убираем flex и используем line-height */
    line-height: 16px; /* Это исправит вертикальное центрирование */
    text-align: center;
    z-index: 10;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* Если в корзине 0 товаров, скрываем счетчик */
.cart-counter[data-count="0"] {
  display: none;
}

#rec1849240951{
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
}

/* ===========================================
   КНОПКА КОНТАКТОВ В ХЕДЕРЕ
=========================================== */
.header-contacts-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.header-contacts-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.contacts-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
}

.contacts-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.contacts-icon svg {
  width: 100%;
  height: 100%;
}

/* ===========================================
   МОДАЛЬНОЕ ОКНО КОНТАКТОВ
=========================================== */
.contacts-modal {
  z-index: 10001; /* Выше других модалок */
}

.contacts-modal-content {
  max-width: 500px;
  width: 90%;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease-out;
}

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

/* Стилизация виджета СДЭК */
.cdek-widget {
  margin: 20px 0;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 20px;
}

/* Кнопка выбора ПВЗ */
.cdek-select-btn {
  background: #B90000;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}

.cdek-select-btn:hover {
  background: #990000;
}


  /* Скрываем стандартную круглую иконку корзины Тильды */
.t706__carticon {
    display: none !important;
}