Спрей для полости рта Dentiste с цинком и растительными экстрактами, 10 мл
Описание
характеристиКИ
Спрей для полости рта Dentiste с цинком и растительными экстрактами, 10 мл
/* --- Скрываем автоматические заголовки от шорткода (h2, h3) --- */
.custom-product-slider h2,
.custom-product-slider h3 {
display: none !important;
}
/* --- Стили для стрелочек --- */
.home-slider-arrows {
display: flex;
justify-content: flex-end;
gap: 10px;
position: left;
z-index: 10;
}
.slider-btn {
width: 40px;
height: 40px;
border-radius: 50%;
background: #ffffff;
border: none;
color: #3b7c5e;
font-size: 16px;
cursor: pointer;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
.slider-btn:hover {
background: #e9e9e9;
transform: scale(1.05);
}
/* --- Превращаем сетку шорткода в слайдер --- */
.custom-product-slider ul.products {
display: flex !important;
flex-wrap: nowrap !important;
gap: 20px !important;
overflow-x: auto !important;
overflow-y: visible !important;
scroll-snap-type: x mandatory !important;
scroll-behavior: smooth !important;
padding: 10px 0 30px 0 !important;
margin: 0 !important;
scrollbar-width: none !important;
}
.custom-product-slider ul.products::-webkit-scrollbar {
display: none !important;
}
/* --- Базовые стили карточки товара (ПК) --- */
.custom-product-slider ul.products li.product {
flex: 0 0 calc((100% - 60px) / 4) !important;
scroll-snap-align: start !important;
margin: 0 !important;
height: auto !important;
max-height: 300px !important; /* Жесткое ограничение высоты */
overflow: hidden !important;
display: flex !important;
flex-direction: column !important;
justify-content: space-between !important;
padding: 10px !important; /* Компактные отступы внутри карточки */
}
/* Обертка для картинки и заголовка */
.custom-product-slider ul.products li.product a.woocommerce-LoopProduct-link {
display: flex !important;
flex-direction: column !important;
flex-grow: 1 !important;
}
/* Уменьшаем картинку */
.custom-product-slider ul.products li.product img {
max-height: 120px !important;
width: 100% !important;
object-fit: contain !important;
margin: 0 auto 10px auto !important;
}
/* Настраиваем заголовок: меньше шрифт, 2 строки с многоточием */
.custom-product-slider ul.products li.product .woocommerce-loop-product__title {
font-size: 13px !important;
line-height: 1.3 !important;
margin-bottom: 5px !important;
padding: 0 !important;
display: -webkit-box !important;
-webkit-line-clamp: 2 !important;
-webkit-box-orient: vertical !important;
overflow: hidden !important;
white-space: normal !important;
}
/* Уменьшаем цену */
.custom-product-slider ul.products li.product .price {
font-size: 14px !important;
margin-bottom: 10px !important;
}
/* Кнопка "В корзину" (прижата к низу) */
.custom-product-slider ul.products li.product .button {
padding: 6px 12px !important;
font-size: 12px !important;
margin-top: auto !important;
text-align: center !important;
}
/* --- Адаптив: Планшеты (до 1024px) --- */
@media (max-width: 1024px) {
.custom-product-slider ul.products {
gap: 15px !important;
}
.custom-product-slider ul.products li.product {
/* Показываем 3 карточки и кусочек 4-й */
flex: 0 0 calc((100% - 30px) / 3.2) !important;
}
}
/* --- Адаптив: Большие телефоны (до 768px) --- */
@media (max-width: 768px) {
.custom-product-slider ul.products {
gap: 10px !important;
}
.custom-product-slider ul.products li.product {
/* Показываем 2 карточки и кусочек 3-й */
flex: 0 0 calc((100% - 20px) / 2.3) !important;
}
}
/* --- Адаптив: Узкие смартфоны (до 480px) --- */
@media (max-width: 480px) {
.custom-product-slider ul.products {
gap: 8px !important;
}
.custom-product-slider ul.products li.product {
/* 2 карточки займут 84%, оставляя место для "хвостика" 3-й карточки */
flex: 0 0 42% !important;
}
}
document.addEventListener('DOMContentLoaded', function() {
const slider = document.querySelector('.custom-product-slider ul.products');
const btnLeft = document.getElementById('slide-left');
const btnRight = document.getElementById('slide-right');
if (slider && btnLeft && btnRight) {
function getScrollAmount() {
const firstCard = slider.querySelector('li.product');
if (!firstCard) return slider.clientWidth;
// Динамически берем gap (20px, 15px, 10px или 8px)
const gap = parseInt(window.getComputedStyle(slider).gap) || 0;
const cardWidth = firstCard.offsetWidth + gap;
// Считаем сколько полных карточек влезает на экран
const visibleCards = Math.max(1, Math.floor(slider.clientWidth / cardWidth));
return cardWidth * visibleCards;
}
btnRight.addEventListener('click', () => {
slider.scrollBy({ left: getScrollAmount(), behavior: 'smooth' });
});
btnLeft.addEventListener('click', () => {
slider.scrollBy({ left: -getScrollAmount(), behavior: 'smooth' });
});
}
});
Отзывы
У этого товара пока нет отзывов. Станьте первым!