/* ============ СТИЛЬ КАРТОЧЕК ТОВАРОВ ST320N ============ */

#rec1663949121 .t-store__card {
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
    overflow: hidden !important;
    transition: .25s ease !important;
}

#rec1663949121 .t-store__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12) !important;
}

/* картинка */
#rec1663949121 .t-store__card__imgwrapper img {
    transition: transform .35s ease !important;
}
#rec1663949121 .t-store__card:hover .t-store__card__imgwrapper img {
    transform: scale(1.04);
}

/* заголовок */
#rec1663949121 .t-store__card__title {
    font-size: 17px !important;
    font-weight: 600 !important;
    padding: 14px 20px 0 20px !important;
    color: #1d1d1d !important;
}

/* описание */
#rec1663949121 .t-store__card__descr {
    padding: 0 20px !important;
    color: #555 !important;
    font-size: 14px !important;
}

/* артикул */
#rec1663949121 .t-store__card__sku {
    padding: 6px 20px !important;
    font-size: 13px !important;
    color: #777 !important;
}

/* цвета */
#rec1663949121 .t-store__card__option-item {
    width: 22px !important;
    height: 22px !important;
    border-radius: 6px !important;
    border: 2px solid #fff !important;
    box-shadow: 0 0 0 2px #e8e8e8 !important;
    margin: 4px !important;
    transition: box-shadow .25s ease;
}
#rec1663949121 .t-store__card__option-item.t-active {
    box-shadow: 0 0 0 2px #0A7C4A !important;
}

/* кнопка "Подробнее" */
#rec1663949121 .t-store__card__btn-more .t-btn {
    background-color: #0A7C4A !important;
    color: #fff !important;
    border-radius: 10px !important;
    padding: 14px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 6px 16px rgba(10,124,74,0.25) !important;
    transition: background .25s ease, transform .25s ease !important;
}

#rec1663949121 .t-store__card__btn-more .t-btn:hover {
    background-color: #0D9A5E !important;
    transform: translateY(-2px);
}

/* кнопка "Под заказ" */
#rec1663949121 .t-store__card__btn-second .t-btn {
    background: #f0f0f0 !important;
    color: #222 !important;
    border-radius: 10px !important;
    padding: 12px !important;
    font-size: 14px !important;
    margin-top: 6px !important;
    transition: background .25s ease;
}

#rec1663949121 .t-store__card__btn-second .t-btn:hover {
    background: #e4e4e4 !important;
}

/* отступы */
#rec1663949121 .t-store__card__btns-wrapper {
    padding: 10px 20px 20px 20px !important;
}
/* === КНОПКИ В КАРТОЧКАХ — ОСНОВНАЯ ("Подробнее") === */
#rec1663949121 .t-store__card__btn .t-btnflex_type_button {
    background-color: #0A7C4A !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 14px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    box-shadow: 0 6px 18px rgba(10,124,74,0.28) !important;
    transition: 0.25s ease !important;
}

#rec1663949121 .t-store__card__btn .t-btnflex_type_button:hover {
    background-color: #0D9A5E !important;
    transform: translateY(-2px);
}

/* === КНОПКА "Под заказ" === */
#rec1663949121 .t-store__card__btn_second .t-btnflex_type_button2 {
    background-color: #f0f0f0 !important;
    color: #222 !important;
    border-radius: 12px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: 0.25s ease;
}

#rec1663949121 .t-store__card__btn_second .t-btnflex_type_button2:hover {
    background-color: #e4e4e4 !important;
}
/* уменьшение ширины карточек */
#rec1663949121 .t-store__card {
    max-width: 260px !important; 
}

/* уменьшение высоты + более плотная верстка */
#rec1663949121 .t-store__card__wrap {
    padding-bottom: 10px !important;
}

#rec1663949121 .t-store__card__title {
    font-size: 15px !important;
}

#rec1663949121 .t-store__card__descr {
    font-size: 13px !important;
}
/* увеличиваем блок фильтров по высоте */
#rec1663949121 .t-store__filter {
    padding: 30px 20px !important;
}

/* увеличиваем расстояние между фильтрами */
#rec1663949121 .t-store__filter__item {
    margin-right: 20px !important;
}

/* увеличиваем размер кнопок фильтра */
#rec1663949121 .t-store__filter__btn {
    padding: 12px 22px !important;
    font-size: 15px !important;
}

/* увеличиваем выпадающие списки */
#rec1663949121 .t-store__filter__select select {
    padding: 12px 14px !important;
    font-size: 15px !important;
    border-radius: 10px !important;
}
/* ============ КАРТОЧКА 343x341 (КНОПКИ В РЯД + ЦЕНТР) ============ */

/* 1. РАЗМЕР И ФОРМА КАРТОЧКИ */
#rec1663949121 .t-store__card {
    display: flex !important;
    flex-direction: column !important;
    
    /* Новые размеры */
    width: 343px !important; 
    height: 341px !important; /* 492 - 151 = 341px */
    max-width: 100% !important;
    
    margin: 0 auto !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06) !important;
    border: 1px solid #eaeaea !important;
    transition: all 0.25s ease !important;
    
    /* Отступы */
    padding-bottom: 20px !important; 
    padding-top: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#rec1663949121 .t-store__card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
    transform: translateY(-3px);
}

/* 2. КАРТИНКА (Немного уменьшили высоту контейнера для компактности) */
#rec1663949121 .t-store__card__imgwrapper {
    height: 130px !important; /* Было 150, стало 130, чтобы влез текст */
    width: 100% !important;
    
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    
    margin: 0 auto !important;
    padding: 15px 0 0 0 !important;
    flex-shrink: 0 !important;
}

#rec1663949121 .t-store__card__img, 
#rec1663949121 .t-store__card__imgwrapper img {
    max-height: 100% !important;
    max-width: 80% !important;
    width: auto !important;
    height: auto !important;
    
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* 3. ТЕКСТ */
#rec1663949121 .t-store__card__textwrapper {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* Текст начинается сразу под фото */
    padding: 10px 20px 0 20px !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#rec1663949121 .t-store__card__title {
    font-size: 15px !important; /* Чуть аккуратнее шрифт для низкой карточки */
    font-weight: 500 !important;
    line-height: 1.3 !important;
    color: #1a1a1a !important;
    margin-bottom: 5px !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Скрываем лишнее */
#rec1663949121 .t-store__card__option-wrapper,
#rec1663949121 .t-store__card__prod-variants,
#rec1663949121 .t-store__card__sku {
    display: none !important;
}

/* 4. КНОПКИ (В ОДНУ ЛИНИЮ) */
#rec1663949121 .t-store__card__btns-wrapper {
    padding: 0 20px !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* СТИЛЬ КНОПОК */
#rec1663949121 .t-store__card__btns-wrapper a {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    
    flex: 1 !important;
    height: 38px !important; /* Чуть компактнее по высоте */
    
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 50px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    padding: 0 5px !important;
    margin-top: 0 !important;
}

/* БЕЛАЯ КНОПКА ("В корзину" / "Под заказ") */
/* Делаем её белой с обводкой, чтобы не сливалась с зеленой */
#rec1663949121 .t-store__card__btn_second,
#rec1663949121 .t-store__card__btn-second .t-btn {
    background-color: #fff !important;
    color: #175e58 !important; /* Цвет текста зеленый */
    border: 1px solid #175e58 !important; /* Зеленая обводка */
}
#rec1663949121 .t-store__card__btn_second:hover,
#rec1663949121 .t-store__card__btn-second .t-btn:hover {
    background-color: #f4f4f4 !important;
}

/* ЗЕЛЕНАЯ КНОПКА ("Подробнее") */
#rec1663949121 .t-store__card__btn,
#rec1663949121 .t-store__card__btn-more .t-btn {
    background-color: #175e58 !important;
    color: #fff !important;
    border: 1px solid #175e58 !important;
}
#rec1663949121 .t-store__card__btn:hover,
#rec1663949121 .t-store__card__btn-more .t-btn:hover {
    background-color: #114541 !important;
    border-color: #114541 !important;
}

    }
}
/* ============ ST305: СУПЕР-ФИКС ДЛЯ ФОТО И ОТСТУПОВ ============ */
/* ID БЛОКА: #rec1666224971 */

/* 1. ПРИНУДИТЕЛЬНАЯ СТРУКТУРА КАРТОЧКИ */
#rec1666224971 .t-item {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    
    height: 341px !important;
    width: 100% !important;
    max-width: 343px !important;
    margin: 0 auto !important;
    
    background-color: #ffffff !important;
    border-radius: 12px !important;
    border: 1px solid #eaeaea !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06) !important;
    
    padding: 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: pointer !important;
}

#rec1666224971 .t-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important;
}

/* 2. ЛЕЧИМ ИСЧЕЗНУВШИЕ ФОТО (Универсальный селектор) */
/* Обращаемся к любой картинке внутри карточки */
#rec1666224971 .t-item img {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    
    width: auto !important;
    max-width: 85% !important;
    height: 130px !important; /* Фиксируем высоту */
    
    object-fit: contain !important;
    object-position: center center !important;
    
    margin: 20px auto 10px auto !important; /* Отступы: сверху 20, снизу 10, по бокам авто */
}

/* Если есть обертка картинки - сбрасываем её влияние */
#rec1666224971 .t-item__imgwrapper {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
}

/* 3. ТЕКСТ (Заголовок) */
#rec1666224971 .t-item__textwrapper {
    width: 100% !important;
    padding: 0 20px !important;
    margin: 0 !important;
    text-align: center !important;
    position: static !important; /* Чтобы текст не улетал */
    display: block !important;
}

#rec1666224971 .t-item__title {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    line-height: 1.35 !important;
    margin-bottom: 5px !important;
}

/* Скрываем описание */
#rec1666224971 .t-item__descr {
    display: none !important;
}

/* 4. КНОПКИ (Рисуем заново) */
/* Левая (Белая) */
#rec1666224971 .t-item::before {
    content: "В корзину";
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: calc(50% - 25px);
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border: 1px solid #175e58;
    color: #175e58;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
}

/* Правая (Зеленая) */
#rec1666224971 .t-item::after {
    content: "Подробнее";
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: calc(50% - 25px);
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #175e58;
    color: #fff;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
}

/* Hover эффекты */
#rec1666224971 .t-item:hover::before { background-color: #f4f4f4; }
#rec1666224971 .t-item:hover::after { background-color: #114541; }



SmoothScroll({
    // Время скролла 400 = 0.4 секунды
    animationTime    : 800,
    // Размер шага в пикселях 
    stepSize         : 75,

    // Дополнительные настройки:
    
    // Ускорение 
    accelerationDelta : 30,  
    // Максимальное ускорение
    accelerationMax   : 2,   

    // Поддержка клавиатуры
    keyboardSupport   : true,  
    // Шаг скролла стрелками на клавиатуре в пикселях
    arrowScroll       : 50,

    // Pulse (less tweakable)
    // ratio of "tail" to "acceleration"
    pulseAlgorithm   : true,
    pulseScale       : 4,
    pulseNormalize   : 1,

    // Поддержка тачпада
    touchpadSupport   : true,
})


document.addEventListener("DOMContentLoaded", function() {   
    (function () {
        const emptyFavorites = false; //Скрыть-Показать пустое избранное - true-false
       
        const fIcon = document.querySelectorAll('.favorites_icon');
        const fTotal = document.querySelectorAll('.favorites_total');
      
        function showWishIcon(){
            fIcon.forEach(el=>el.classList.add('show-fav'));
            fTotal.forEach(el=>el.classList.add('show-fav'));
        };
        
        function hideWishIcon(){
            fIcon.forEach(el=>el.classList.remove('show-fav'));
            fTotal.forEach(el=>el.classList.remove('show-fav'));
        };
        
    
        function checkTotalWishList(){
            
            if (window.twishlist != undefined) { 
                if(!emptyFavorites) showWishIcon();
                    
                const nTot = twishlist.total;
                fTotal.forEach(el=>el.querySelector('.tn-atom').innerText=nTot);
                
                fIcon.forEach(el=>el.classList.add('favorites_icon_anim'));
 
                setTimeout(function(){ 
                    fIcon.forEach(el=>el.classList.remove('favorites_icon_anim'));
                }, 700);
            
                if  (nTot==0){
                    if(emptyFavorites) {
                        hideWishIcon();
                    }else{
                        showWishIcon();
                    };
                }else{ 
                    fIcon.forEach(el=>el.classList.remove('blkFav'));
                    if(emptyFavorites) showWishIcon();
                };
            };
        };
        
        
        setTimeout(function(){
            checkTotalWishList()
        }, 1000);

        const observer = new MutationObserver(mutationRecords => {
            setTimeout(function(){
               checkTotalWishList();
            }, 300);
        });
        
        const wishiconCounter  = document.querySelector('.t1002__wishlisticon-counter');
        if(wishiconCounter!=null){
            observer.observe(wishiconCounter, {
                childList: true, 
                subtree: true, 
                characterDataOldValue: true
            });
        }else{
            console.log('wishlist counter option not active');  
        };

        fIcon.forEach(function (el, index) {
            el.addEventListener('click',function(e) {
                twishlist__openWishlist();
            });    
        });
        

    })();         
});	




.blkFav{pointer-events:none; }
.favorites_icon , 
.favorites_total {
    opacity: 0;
    pointer-events: none;
}
.r .show-fav{
    opacity: 1;
    pointer-events: auto;
}
.favorites_icon_anim {
    -webkit-animation: t1002__pulse-anim 0.6s;
    animation: t1002__pulse-anim 0.6s;
}
.favorites_icon{
    cursor:pointer;
    transition: -webkit-transform 0.2s ease-in-out;
    transition: transform 0.2s ease-in-out;
    transition: transform 0.2s ease-in-out,-webkit-transform 0.2s ease-in-out;
}
.t1002__wishlisticon {  display: none}
