.sp-product-table-container {
    margin: 20px 0;
    font-family: "Rubik", Sans-serif;
    font-size: 18px;
    font-weight: 200;
}

.sp-product-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.sp-product-search input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
}

.sp-product-sort select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.sp-product-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.sp-product-table tr {
    height: auto;
}

.sp-product-table tbody tr {
    height: 150px;
}

.sp-product-table thead tr {
    height: 40px !important;
}

.sp-product-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    vertical-align: middle;
}

.sp-product-table th {
    padding: 0 15px;
    text-align: right;
    background: #f7f7f7;
    font-weight: 500;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 16px;
    border-bottom: 2px solid #e2e8f0;
    height: 40px !important;
    line-height: 40px;
}

.sp-product-table thead {
    border-bottom: none;
}

.sp-product-table tbody tr:first-child td {
    padding-top: 15px;
}

.product-image {
    width: 150px;
    height: 150px;
    padding: 10px !important;
    position: relative;
    overflow: visible;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease, z-index 0.3s ease;
}

.product-image:hover {
    z-index: 100;
}

.product-image:hover img {
    transform: scale(2.2);
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background-color: white;
    border-radius: 4px;
    cursor: zoom-in;
}

@media screen and (max-width: 768px) {
    .sp-product-table {
        display: block;
    }

    .sp-product-table thead {
        display: none;
    }

    .sp-product-table tbody {
        display: grid;
        gap: 20px;
        padding: 10px;
    }

    .sp-product-table tr {
        display: flex;
        flex-direction: column;
        background: #fff;
        border: 1px solid #eee;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 15px;
        margin: 0;
        height: auto;
    }

    .sp-product-table td {
        display: block;
        padding: 10px 5px;
        border: none;
        text-align: center;
        white-space: normal;
    }

    /* Изображение */
    .product-image {
        width: 100%;
        height: auto;
        padding: 0 !important;
        margin-bottom: 10px;
    }

    .product-image img {
        max-width: 100%;
        height: 200px;
        object-fit: contain;
    }

    /* Название товара */
    .product-title {
        padding: 10px 0;
    }

    .product-title a {
        color: #333;
        font-size: 18px;
        font-weight: 500;
        text-decoration: none;
        line-height: 1.3;
    }

    /* Цена */
    .product-price {
        font-size: 22px;
        font-weight: bold;
        color: #061b76;
        padding: 10px 0;
    }

    /* Описание */
    .product-description {
        display: none; /* Скрываем описание на мобильных */
    }

    /* Количество */
    .quantity-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin: 15px 0;
    }

    .quantity-button {
        width: 40px;
        height: 40px;
        font-size: 20px;
        background: #f0f0f0;
        border: none;
        border-radius: 8px;
    }

    .quantity-button:active {
        background: #e0e0e0;
    }

    .product-quantity input.qty {
        width: 60px;
        height: 40px;
        font-size: 18px;
        text-align: center;
        border: 1px solid #ddd;
        border-radius: 8px;
    }

    /* Кнопка добавления в корзину */
    .product-actions {
        padding: 10px 0 0 0 !important;
    }

    .add-to-cart {
        width: 100%;
        min-height: 50px;
        font-size: 18px;
        padding: 12px 20px;
        border-radius: 8px;
        background-color: #061b76;
        color: white;
        border: none;
        margin-top: 10px;
    }

    .add-to-cart.in-cart {
        background-color: #1d4ed8;
    }

    /* Поиск и сортировка */
    .sp-product-controls {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
        padding: 0 10px;
    }

    .sp-product-search input,
    .sp-product-sort select {
        width: 100%;
        height: 45px;
        padding: 10px 15px;
        font-size: 16px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background-color: white;
    }

    /* Кнопка загрузк */
    .load-more-container {
        padding: 20px 10px;
    }

    .load-more-button {
        width: 100%;
        height: 50px;
        font-size: 18px;
        border-radius: 8px;
    }

    .product-card .quantity-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin: 15px auto;
        width: fit-content;
    }

    .product-card .quantity-button {
        width: 40px;
        height: 40px;
        font-size: 20px;
        background: #f0f0f0;
        border: 1px solid #ddd;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .product-card .qty {
        width: 60px;
        height: 40px;
        text-align: center;
        font-size: 18px;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin: 0 5px;
        -moz-appearance: textfield;
    }

    /* Убираем стрелки в Chrome и других браузерах */
    .product-card .qty::-webkit-outer-spin-button,
    .product-card .qty::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* Стили для неактивной кнопки */
    .product-card .quantity-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        background: #e0e0e0;
    }
}

/* Стили для маленьких экранов */
@media screen and (max-width: 480px) {
    .sp-product-table tbody {
        gap: 15px;
    }

    .product-image img {
        height: 180px;
    }

    .product-title a {
        font-size: 16px;
    }

    .product-price {
        font-size: 20px;
    }

    .quantity-button,
    .product-quantity input.qty {
        height: 45px;
    }
}

.load-more-container {
    text-align: center;
    margin: 20px 0;
    padding: 0 15px;
    display: block !important;
}

.load-more-button {
    display: inline-block !important;
    padding: 10px 20px;
    background: #061b76;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    min-width: 200px;
}

.load-more-button:hover {
    background: #0a2ba6;
}

.load-more-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
    padding-right: 40px;
}

.load-more-button.loading:after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.sp-product-table th:nth-child(1),
.sp-product-table td:nth-child(1) {
    width: 100px;
}

.sp-product-table th:nth-child(2),
.sp-product-table td:nth-child(2) {
    width: 20%;
}

.sp-product-table th:nth-child(3),
.sp-product-table td:nth-child(3) {
    width: 15%;
}

.sp-product-table th:nth-child(4),
.sp-product-table td:nth-child(4) {
    width: auto;
    white-space: normal;
}

.sp-product-table th:nth-child(5),
.sp-product-table td:nth-child(5) {
    width: 100px;
}

.sp-product-table th:nth-child(6),
.sp-product-table td:nth-child(6) {
    width: 150px;
}

/* Стили для элемента управления количеством */
.quantity-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 120px;
    position: relative;
    gap: 5px;
}

.quantity-button {
    width: 25px;
    height: 25px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.quantity-button:hover {
    background: #e9e9e9;
}

.quantity-button:active {
    background: #ddd;
}

.quantity-button.plus {
    margin: 0;
}

.quantity-button.minus {
    margin: 0;
}

.product-quantity input.qty {
    width: 45px;
    height: 35px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    padding: 0 5px;
    margin: 0 5px;
    -moz-appearance: textfield;
}

/* Убираем стрелки в Chrome и других браузерах */
.product-quantity input.qty::-webkit-outer-spin-button,
.product-quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Стили для неактивной кнопки */
.quantity-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-to-cart {
    width: 100%;
    background-color: #061b76;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    font-family: "Rubik", Sans-serif;
    font-size: 16px;
}

/* Стиль для кнопки с товаром в корзине */
.add-to-cart.in-cart {
    background-color: #1d4ed8; /* Более светлый синий */
    position: relative;
    overflow: hidden;
}

.add-to-cart.in-cart:hover {
    background-color: #2563eb; /* Еще более светлый при наведении */
}

.add-to-cart:disabled {
    opacity: 0.7;
    cursor: wait;
}

.add-to-cart:hover:not(:disabled) {
    background-color: #0a2ba3;
}

/* Desktop/Mobile переключение */
.mobile-view {
    display: none;
}

@media screen and (max-width: 768px) {
    .desktop-view {
        display: none;
    }

    .mobile-view {
        display: block;
    }

    .products-grid {
        display: grid;
        gap: 20px;
        padding: 10px;
    }

    .product-card {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .product-card .product-image {
        width: 100%;
        height: 200px;
        margin-bottom: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .product-card .product-image img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .product-card .product-title {
        font-size: 18px;
        font-weight: 500;
        margin: 0;
        text-align: center;
    }

    .product-card .product-title a {
        color: #333;
        text-decoration: none;
    }

    .product-card .product-price {
        font-size: 22px;
        font-weight: bold;
        color: #061b76;
        text-align: center;
    }

    .product-card .quantity-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin: 15px auto;
        width: fit-content;
    }

    .product-card .add-to-cart {
        width: 100%;
        min-height: 50px;
        font-size: 18px;
        padding: 12px;
        border-radius: 8px;
    }
}

@media screen and (max-width: 480px) {
    .product-card .product-image {
        height: 180px;
    }
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 10px;
    align-items: center;
}

.view-button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
}

.view-button i {
    font-size: 16px;
}

.view-button:hover {
    background: #f5f5f5;
    color: #333;
}

.view-button.active {
    background: #061b76;
    color: white;
    border-color: #061b76;
}

/* View containers */
.table-view-container,
.grid-view-container,
.mobile-view-container {
    display: none;
}

.table-view-container.active,
.grid-view-container.active,
.mobile-view-container.active {
    display: block;
}

/* Grid View */
.products-grid {
    display: grid;
    gap: 20px;
    padding: 20px 0;
}

.product-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    transition: box-shadow 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-card .product-image {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

.product-card .product-image a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card .product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card .product-title {
    font-size: 16px;
    line-height: 1.4;
    margin: 0;
    flex-grow: 1;
    text-align: center;
}

.product-card .product-title a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-price {
    font-size: 20px;
    font-weight: bold;
    color: #061b76;
    text-align: center;
    margin: 10px 0;
}

.product-card .quantity-wrapper {
    margin: 8px auto;
    display: flex;
    justify-content: center;
    gap: 5px;
    height: 30px;
}

.product-card .quantity-wrapper .quantity-button {
    width: 25px;
    height: 25px;
    font-size: 14px;
    padding: 0;
    line-height: 25px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.product-card .quantity-wrapper .quantity-button:hover {
    background: #f5f5f5;
}

.product-card .quantity-wrapper .qty {
    width: 40px;
    height: 25px;
    font-size: 14px;
    padding: 0 5px;
    margin: 0;
    line-height: 25px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.product-card .add-to-cart {
    width: 100%;
    padding: 12px;
    margin-top: auto;
    background: #061b76;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.product-card .add-to-cart:hover {
    background: #0a2ba6;
}

/* Responsive Grid */
@media screen and (max-width: 1200px) {
    /* Responsive styles for large screens */
}

@media screen and (max-width: 992px) {
    /* Responsive styles for medium screens */
}

@media screen and (max-width: 768px) {
    .view-switcher {
        display: none;
    }
}

/* View Switcher */
.view-switcher {
    display: flex;
    gap: 10px;
    align-items: center;
}

.view-button {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
}

.view-button i {
    font-size: 16px;
}

.view-button:hover {
    background: #f5f5f5;
    color: #333;
}

.view-button.active {
    background: #061b76;
    color: white;
    border-color: #061b76;
}

/* Базовые стили для изображений */
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Эффект увеличения ТОЛЬКО для table view */
.table-view-container .product-image {
    position: relative;
    overflow: visible;
}

.table-view-container .product-image img {
    transition: transform 0.3s ease, z-index 0.3s ease;
}

.table-view-container .product-image:hover {
    z-index: 100;
}

.table-view-container .product-image:hover img {
    transform: scale(2.2);
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background-color: white;
    border-radius: 4px;
    cursor: zoom-in;
}

/* Отключаем все эффекты для grid view */
.grid-view-container .product-image {
    position: static;
    overflow: hidden;
}

.grid-view-container .product-image img {
    transition: none;
}

.grid-view-container .product-image:hover {
    z-index: auto;
}

.grid-view-container .product-image:hover img {
    transform: none;
    position: static;
    box-shadow: none;
}

/* Стили для кликабельного изображения в grid view */
.grid-view-container .product-image a {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.grid-view-container .product-image a img {
    cursor: pointer;
}

.desktop-grid .quantity-wrapper .qty {
    width: 40px;
    height: 25px;
    font-size: 14px;
    padding: 0 5px;
    margin: 0;
    line-height: 25px;
    text-align: center;
}

/* Mobile View - Disabled to use desktop view on all devices */
@media screen and (max-width: 768px) {
    /* Keep desktop views visible on mobile */
    .table-view-container.active,
    .grid-view-container.active {
        display: block !important;
    }

    /* Always hide mobile view */
    .mobile-view-container,
    .mobile-view-container.active {
        display: none !important;
    }

    .view-switcher {
        display: none; /* Скрываем переключатель на мобильных */
    }
}

@media screen and (min-width: 769px) {
    .mobile-view-container {
        display: none !important; /* Принудительно скрываем мобильную версию на десктопе */
    }
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin: 20px 0;
    padding: 0 15px;
    display: block !important;
}

.load-more-button {
    display: inline-block !important;
    padding: 10px 20px;
    background: #061b76;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    min-width: 200px;
}

.load-more-button:hover {
    background: #0a2ba6;
}

/* Стили для кнопки в разных видах */
.table-view-container .load-more-container {
    margin-top: 30px;
}

.grid-view-container .load-more-container {
    margin-top: 30px;
    grid-column: 1 / -1; /* Растягиваем на всю ширину grid */
}

.mobile-view-container .load-more-container {
    margin-top: 20px;
}

@media screen and (max-width: 768px) {
    .load-more-button {
        width: 100%;
        padding: 15px 20px;
        font-size: 18px;
    }
}

/* Убедитесь, что контейнер кнопки виден во всех видах */
.table-view-container .load-more-container,
.grid-view-container .load-more-container,
.mobile-view-container .load-more-container {
    display: block !important;
}

/* Category Carousel */
.sp-category-carousel-container {
    margin: 20px auto;
    position: relative;
    max-width: 100%; /* На всю ширину */
    padding: 0;
}

.category-swiper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Градиенты по бокам */
.category-swiper:before,
.category-swiper:after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 2;
    pointer-events: none;
}

.category-swiper:before {
    left: 0;
    background: linear-gradient(to right, 
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,0.8) 50%,
        rgba(255,255,255,0) 100%
    );
}

.category-swiper:after {
    right: 0;
    background: linear-gradient(to left, 
        rgba(255,255,255,1) 0%,
        rgba(255,255,255,0.8) 50%,
        rgba(255,255,255,0) 100%
    );
}

/* Стили для слайдов */
.swiper-slide {
    width: 180px !important;
    flex-shrink: 0;
}

/* Стили для карточек категорий */
.category-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    height: 160px;
    display: flex;
    flex-direction: column;
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.category-image {
    flex: 1;
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    height: 120px;
}

.category-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: auto;
    height: auto;
}

.category-title {
    padding: 6px 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

/* Navigation Buttons */
.swiper-button-next,
.swiper-button-prev {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 32px !important;
    height: 32px !important;
    background: #061b76 !important;
    border-radius: 50%;
    color: white !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Позиционирование кнопок */
.swiper-button-prev {
    left: 0 !important;
    right: auto !important;
}

.swiper-button-next {
    right: 0 !important;
    left: auto !important;
}

/* Убираем стандартные стрелки и добавляем свои */
.swiper-button-next:after,
.swiper-button-prev:after {
    content: '' !important;
}

/* Добавляем свои стрелки через Font Awesome */
.swiper-button-next:before {
    content: '\f054' !important; /* Стрелка вправо */
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
    font-size: 14px !important;
}

.swiper-button-prev:before {
    content: '\f053' !important; /* Стрелка влево */
    font-family: 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
    font-size: 14px !important;
}

/* Эффекты при наведении */
.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: #0a2ba6 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
        width: 28px !important;
        height: 28px !important;
    }

    .swiper-button-next:before,
    .swiper-button-prev:before {
        font-size: 12px !important;
    }
}

@media screen and (max-width: 480px) {
    .swiper-button-next,
    .swiper-button-prev {
        width: 24px !important;
        height: 24px !important;
    }

    .swiper-button-next:before,
    .swiper-button-prev:before {
        font-size: 10px !important;
    }
}
