.t-descr_xxs {
    font-size: 22px;  /* размер шрифта описания в карточке товара */
}

.t-name_xs {
    font-size: 24px;  /* размер шрифта табов в карточке товара */
}

.js-product .t-product__option-variants_buttons .t-product__option-checkmark_image {
    border-radius: 10px;  /* скругления превью в карточке товара */
}

.js-product .t-product__option-variants_buttons .t-product__option-input:checked+.t-product__option-checkmark_image:before {
    border-radius: 14px; /* скругления активного превью в карточке товара */
}

.t-name_xl {
    font-size: 52px; /* размерр шрифта Н1 в карточке товара */
}

.js-store-prod-price-val {
     font-size: 28px; /* размер шрифта цены в карточке товара */
}

.js-product .t-product__option-variants_buttons .t-product__option-checkmark_image {
    height: 70px;  /* размер превью вариантов товара в карточке товара */
    width: 70px;
}

.js-product .t-product__option-variants_buttons .t-product__option-item_image:hover .t-product__option-title {
  /*  display:none !important; /* выключить отображение названия модели (дизайна) при наведении на превью варианта товара в карточке */
}

.t-store__prod-popup__btn {
    font-weight: 600;
    font-size: 16px;
    width: 160px;
    height: 56px;
    
}



ul {
    list-style-image: url("https://static.tildacdn.com/tild3864-3465-4231-b335-356166383134/bulet.svg")  /* изображение буллита списоков */
}

#allrecords ul {
    padding-top: 8px; /* расстояние от списоков до строки выше */
}


/* Измененный код для цен */
.t-store__card__price-value::before,
.js-product-price::before {
    content: "от" !important;
    margin-right: 7px;
}

.t706__cartwin-prodamount-price:before {
content:'от ';
vertical-align:bottom;
}

.t-store__prod-popup__price-currency:after {
    content: "В зависимости от выбранной ткани" !important;
    margin-left: 7px;
    font-size: 16px;
    font-weight: 400;
}


.js-store-prod-text a {    /* стили для кнопок в описании карточки товара */
    display: inline-block;
    padding: 12px 24px;
    margin-right: 8px;
    margin-top: 14px;
    border-radius: 4px;
    font-weight: 600;
}
.js-store-prod-text a:first-of-type { /* первая кнопка в карточке товара */
    background-color: #7244FF;
    color: #ffffff !important;
}
.js-store-prod-text a:last-of-type { /*вторая кнопка в карточке товара */
    background-color: #7244FF;
    color: #ffffff !important;
}

.js-store-prod-text a:first-of-type:hover {
    background-color: #212121 !important;
    transition: 0.2s;
}

.js-store-prod-text a:last-of-type:hover {
    background-color: #212121 !important;
    transition: 0.2s;
}
 
.t706__cartwin_showed {
    z-index: 999999999;
}



.js-store-prod-name .t-name_xs:hover {
        color: #7244FF;
}



document.addEventListener("DOMContentLoaded", function() {    
    (function () {
        const hideMode = false; //Скрыть-Показать пустую корзину - true-false

        const cartcopyElem = document.querySelectorAll(".cartcopy_elem .tn-atom");
        cartcopyElem.forEach(function (el, index) {
            el.classList.add('cartcopy');   
        });
        
        const cartpriceElem = document.querySelectorAll(".cartprice_elem .tn-atom");
        cartpriceElem.forEach(function (el, index) {
            el.classList.add('cartcopyprice');   
        });
        
        function showCart(){
            document.querySelectorAll('.cartcopy').forEach(el=>el.classList.add('show-cart'));
            document.querySelectorAll('.cartcopyprice').forEach(el=>el.classList.add('show-cart'));  
        };
        
        function checkCartTotal(){
            if (window.tcart != undefined) {
                if(!hideMode) showCart()
                
                const chCounter = window.tcart.total;
                const chPrice = window.tcart.prodamount;
                if  (chPrice==0){
                    document.querySelectorAll('div[data-elem-type="text"] .cartcopyprice').forEach(el=>el.innerHTML='');
                    if(hideMode) {
                        document.querySelectorAll('.cartcopy').forEach(el=>el.classList.remove('show-cart'));
                        document.querySelectorAll('.cartcopyprice').forEach(el=>el.classList.remove('show-cart'));
                    }else{
                        showCart();
                    };
               }else{ 
                    document.querySelectorAll('div[data-elem-type="text"] .cartcopyprice').forEach(el=>el.innerHTML=chPrice+' руб');
                    if(hideMode) showCart();
               };

               document.querySelectorAll('div[data-elem-type="text"] .cartcopy').forEach(el=>el.innerHTML=chCounter);
               
               if(chCounter==0){ 
                   document.querySelectorAll('.cartcopy').forEach(el=>el.classList.add('blkElem'));
                   
               }else{ 
                   document.querySelectorAll('.cartcopy').forEach(el=>el.classList.remove('blkElem'));
               }; 
              
               if(chCounter=='') document.querySelectorAll('div[data-elem-type="text"] .cartcopy').forEach(el=>el.innerHTML=0);
            };

        };
       
        setTimeout(function(){
            checkCartTotal();
        }, 500);
        
        
        const observer = new MutationObserver(mutationRecords => {
            setTimeout(function(){
               checkCartTotal();
            }, 300);
            document.querySelectorAll('div[data-elem-type="image"] .cartcopy').forEach(el=>el.classList.add('cartcopyanim'));
            setTimeout(function(){ 
                document.querySelectorAll('div[data-elem-type="image"] .cartcopy').forEach(el=>el.classList.remove('cartcopyanim'));
            }, 1000);
        });
        
        const carticonCounter  = document.querySelector('.t706__carticon-counter');
        if(carticonCounter!=null){
            observer.observe(carticonCounter, {
                childList: true, 
                subtree: true, 
                characterDataOldValue: true
            });
        }else{
            console.log('cart counter option not active');  
        };
        
        const cartcopy = document.querySelectorAll(".cartcopy");
        cartcopy.forEach(function (el, index) {
            el.addEventListener('click',function(e) {
                e.preventDefault();
                tcart__openCart();
            });    
        });

    })();    
});	
