/* Контейнер карусели */
.carousel-section {
    padding: 40px 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.carousel-title {
    text-align: center;
    /* color: #2d3436; */
    color: #202E56;
    font-size: 2.5rem;
    margin-bottom: 30px;
    font-weight: 700;
    width: 100%;
    /*max-width: 100%; /* На маленьких экранах будет сужаться*/
    font-family: 'Comfortaa', sans-serif;
}

/* Базовый фрейм для 5 карточек */
.carousel-gallery {
    width: calc(230px * 5 + 10px * 4); /* 5 карточек + 4 отступа */
    max-width: 1200px;
    margin: 20px auto;
    padding: 0; /* было 15*/
    position: relative;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Фрейм для 4 карточек (когда totalSlides <= 5) */
.carousel-gallery.small-frame {
    width: calc(230px * 4 + 10px * 3); /* 4 карточки + 3 отступа */
    max-width: 1020px; /* 230*4 + 10*3 = 920 + 30 = 950px */
    justify-content: center !important;
}

/* Для карусели с одним слайдом */
.carousel-gallery:has(.swiper-slide:only-child) .swiper-wrapper {
    justify-content: center !important;
}

/* Отключаем все интерактивные элементы для одного слайда */
.carousel-gallery:has(.swiper-slide:only-child) .swiper-container {
    cursor: default !important;
}

.carousel-gallery .swiper-container {
    width: auto;
    padding: 20px 0;
}

.carousel-gallery::-webkit-scrollbar {
    height: 6px;
}

.carousel-gallery::-webkit-scrollbar-track {
    background: transparent;
}

.carousel-gallery::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}


.carousel-gallery .swiper-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    transform: none !important;
    width: auto !important;
    justify-content: center;
}

.carousel-gallery .swiper-slide {
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 230px !important;
    flex-shrink: 0;
}

/* Включаем grab cursor */
.carousel-gallery .swiper-container {
    cursor: grab;
}

.carousel-gallery .swiper-container:active {
    cursor: grabbing;
}

/* Скрываем пагинацию */
.carousel-gallery .swiper-pagination {
    display: none;
}

/* Карточка товара */
.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

.product-card {
    width: 230px;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Контейнер изображения */
.product-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Затемнение для читаемости текста */
.product-image-container::after {
    /* content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0.4) 0%,
                rgba(0, 0, 0, 0.2) 60%,
                rgba(0, 0, 0, 0.7) 100%);
    z-index: 2; */
    display: none;
}

/* Контейнер названия */
.product-name-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 66%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 3;
    text-align: center;
}

.product-name {
    font-family: 'Comfortaa', sans-serif;
    color: #FFDF70;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    line-height: 1.4;
}

.product-name-gold {
    font-family: 'Comfortaa', sans-serif;
    color: #202E56;
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 0 3px rgba(101, 67, 33, 0.4);
    line-height: 1.4;
}

/* Контейнер цены */
.product-price-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 34%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 3;
}

.product-price {
    color: #FFDF70;
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.product-price-gold {
    color: #202E56;
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(101, 67, 33, 0.4);
}

/* Адаптивность */
@media (max-width: 1270px) {
    .carousel-gallery {
        width: calc(230px * 4 + 20px * 3);
        max-width: 1060px;
    }
}

@media (max-width: 1024px) {
    .carousel-gallery {
        width: calc(230px * 3 + 20px * 2);
        max-width: 790px;
    }

    .carousel-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .carousel-gallery {
        width: calc(230px * 2 + 20px * 1);
        max-width: 480px;
        padding: 0 10px;
    }

    .carousel-gallery .swiper-slide {
        width: 200px !important;
    }

    .product-card {
        width: 200px;
        height: 280px;
    }

    .product-name {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .carousel-section {
        padding: 20px 0;
    }

    .carousel-gallery {
        width: 230px;
        max-width: 230px;
    }

    .carousel-gallery .swiper-slide {
        width: 180px !important;
    }

    .product-card {
        width: 180px;
        height: 250px;
    }

    .carousel-title {
        font-size: 1.8rem;
    }
}