/* Изолированная обертка модуля */
.sj-grid-six-wrap {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Сетка для десктопа: 3 колонки (как на скриншоте) */
.sj-grid-six-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0;
    padding: 15px 0;
    box-sizing: border-box;
    max-width: 100%;
}

/* Карточка товара: Flexbox (изображение слева, текст справа) */
.sj-grid-six-item {
    position: relative;
    background: #fff;
    padding: 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.sj-grid-six-item:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
    z-index: 2;
}

/* Левая колонка (Изображение). Автоматическая ширина по размеру картинки. */
.sj-grid-six-left {
    position: relative;
    flex: 0 0 auto;
    padding-right: 15px;
    box-sizing: border-box;
}

.sj-grid-six-img-link {
    display: block;
}

/* Изображение динамически берет размеры из CSS-переменных, переданных из PHP */
.sj-grid-six-img-link img {
    display: block;
    max-width: 100%;
    width: var(--base-img-w, auto);
    height: var(--base-img-h, auto);
    object-fit: contain;
}

/* Ярлык SALE */
.sj-grid-six-label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.sj-grid-six-label span {
    background: #e77673;
    color: #fff;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Правая колонка (Информация) - Занимает всё оставшееся место */
.sj-grid-six-right {
    flex: 1 1 auto;
    padding-right: 35px; /* Отступ справа, чтобы текст не наезжал на кнопки */
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    box-sizing: border-box;
    min-height: 80px; /* Минимальная высота для корректного размещения кнопок сверху и снизу */
}

/* Кнопки Wishlist и Quickview справа */
.sj-grid-six-wishlist,
.sj-grid-six-quickview {
    position: absolute;
    right: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
    z-index: 2; /* Повышено для кликабельности поверх растянутой ссылки */
}

.sj-grid-six-quickview { top: 15px; }
.sj-grid-six-wishlist { bottom: 15px; }

.sj-grid-six-wishlist:hover,
.sj-grid-six-quickview:hover {
    border-color: #bbb;
    color: #333;
}

.sj-grid-six-wishlist.active svg {
    fill: #e74c3c;
    stroke: #e74c3c;
}

.sj-grid-six-wishlist.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Категория */
.sj-grid-six-cat {
    font-size: 15px;
    text-transform: uppercase;
    margin-bottom: 3px;
    letter-spacing: 0.5px;
}

.sj-grid-six-cat a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2; /* Повышено для кликабельности */
}

.sj-grid-six-cat a:hover {
    color: #E97C11;
}

/* Заголовок (Создание единой ссылки на всю карточку через ::after) */
.sj-grid-six-title {
    margin-bottom: 5px;
}

.sj-grid-six-title a {
    font-size: 18px;
    color: #333;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.sj-grid-six-target-link::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1; /* Растягивает ссылку заголовка на всю карточку */
}

.sj-grid-six-title a:hover {
    color: #E97C11;
}

/* Рейтинг */
.sj-grid-six-rating-box {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.sj-grid-six-stars-bg {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 14px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23e0e0e0"><path d="M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.564-.955L10 0l2.948 5.955 6.564.955-4.756 4.635 1.122 6.545z"/></svg>') repeat-x;
    background-size: 14px 14px;
}

.sj-grid-six-stars-active {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23E97C11"><path d="M10 15l-5.878 3.09 1.122-6.545L.488 6.91l6.564-.955L10 0l2.948 5.955 6.564.955-4.756 4.635 1.122 6.545z"/></svg>') repeat-x;
    background-size: 14px 14px;
}

.sj-grid-six-reviews {
    font-size: 12px;
    color: #888;
}

/* Описание */
.sj-grid-six-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    display: none;
}

/* Цена */
.sj-grid-six-price {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin-top: auto;
}

/* Кнопка в корзину */
.sj-grid-six-actions {
    display: none;
}

/* Toast */
.sj-grid-six-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2b303b;
    color: #fff;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 15px;
}

.sj-grid-six-toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.sj-grid-six-toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}
.modal-backdrop.fade.show {
z-index: 3;	
}
/* Адаптивность (Планшеты: уменьшение картинки на 10%) */
@media (max-width: 1200px) {
    .sj-grid-six-container { grid-template-columns: repeat(2, 1fr); }
    .sj-grid-six-img-link img {
        width: calc(var(--base-img-w) * 0.9);
        height: calc(var(--base-img-h) * 0.9);
    }
}

/* Адаптивность (Мобильные: уменьшение картинки на 25%) */
@media (max-width: 768px) {
    .sj-grid-six-wrap { overflow: hidden; }
    .sj-grid-six-container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding-bottom: 0;
    }
    .sj-grid-six-item {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .sj-grid-six-img-link img {
        width: calc(var(--base-img-w) * 0.75);
        height: calc(var(--base-img-h) * 0.75);
    }
}
@media (max-width: 399px) {
.sj-grid-six-title a {
    font-size: 16px;

}
}