.slider-check {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin: 24px 0;
    }
    
    .custom-check {
        position: relative;
        cursor: pointer;
        user-select: none;
    }
    
    .custom-check input {
        position: absolute;
        opacity: 0;
        cursor: pointer;
        height: 0;
        width: 0;
    }
    
    .check-wrapper {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 16px 20px;
        background: rgba(31, 165, 253, 0.05);
        border: 1px solid rgba(31, 165, 253, 0.1);
        border-radius: 12px;
        transition: all 0.3s ease;
    }
    
    .custom-check:hover .check-wrapper {
        background: rgba(31, 165, 253, 0.1);
        transform: translateX(4px);
    }
    
    .custom-check input:checked + .check-wrapper {
        background: rgba(31, 165, 253, 0.15);
        border-color: #1fa5fd;
    }
    #quiz-recommendation .personal-product-card:hover{
        transform: none;
    }
    .check-icon {
        width: 24px;
        height: 24px;
        border: 2px solid rgba(31, 165, 253, 0.3);
        border-radius: 4px;
        position: relative;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }
    
    .custom-check input:checked + .check-wrapper .check-icon {
        border-color: #1fa5fd;
        background: #1fa5fd;
    }
    
    .check-icon::after {
        content: '';
        position: absolute;
        top: 45%;
        left: 50%;
        width: 6px;
        height: 12px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: translate(-50%, -50%) rotate(45deg) scale(0);
        transition: transform 0.3s ease;
    }
    
    .custom-check input:checked + .check-wrapper .check-icon::after {
        transform: translate(-50%, -50%) rotate(45deg) scale(1);
}
    
    .check-text {
        color: #c1d1e9;
        font-size: 1rem;
        line-height: 1.5;
        transition: color 0.3s ease;
    }
    
    .custom-check input:checked + .check-wrapper .check-text {
        color: #fff;
    }
    
    /* Accessibility improvements */
    .custom-check input:focus-visible + .check-wrapper {
        box-shadow: 0 0 0 2px rgba(31, 165, 253, 0.5);
    }
    
    /* Mobile optimization */
    @media (max-width: 576px) {
        .slider-check {
            gap: 12px;
        }
    
        .check-wrapper {
            padding: 12px 16px;
        }
    
        .check-text {
            font-size: 0.95rem;
        }
    }

    .slider-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(31, 165, 253, 0.1);
}

.slider-buttons .btn-form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.slider-buttons .btn-form svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.slider-buttons .btn-form.prev {
    background: rgba(31, 165, 253, 0.1);
    color: white;
}

.slider-buttons .btn-form.prev:hover {
    background: rgba(31, 165, 253, 0.2);
    transform: translateX(-4px);
}

.slider-buttons .btn-form.prev svg {
    margin-right: 8px;
    fill: currentColor;
}

.slider-buttons .btn-form.next,
.slider-buttons .btn-form.order {
    background: linear-gradient(90deg, #1fa5fd 0%, #0dcaf0 100%);
    color: white;
    margin-left: auto;
}

.slider-buttons .btn-form.next:hover,
.slider-buttons .btn-form.order:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(31, 165, 253, 0.25);
}

.slider-buttons .btn-form.next svg {
    margin-left: 8px;
    fill: currentColor;
}

.slider-buttons .btn-form:active {
    transform: scale(0.98);
}

.slider-buttons .btn-form:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile styles */
@media (max-width: 576px) {
    .slider-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
        padding-top: 20px;
    }

    .slider-buttons .btn-form {
        width: 100%;
        min-width: 0;
        padding: 12px 20px;
    }

    .slider-buttons .btn-form.next,
    .slider-buttons .btn-form.order {
        margin-left: 0;
        order: -1;
    }
}

/* Touch device optimization */
@media (hover: none) {
    .slider-buttons .btn-form {
        padding: 16px 24px;
    }
    
    .slider-buttons .btn-form:active {
        opacity: 0.8;
    }
}

.slider-text {
    margin-bottom: 32px;
}

.slider-text p {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.3;
    font-weight: 600;
    color: #fff;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #c1d1e9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.slider-text p span {
    display: block;
    font-size: 1rem;
    font-weight: normal;
    color: #8b9bb4;
    margin-top: 12px;
    -webkit-text-fill-color: currentColor;
}

/* Animation for text appearance */
.item.active .slider-text p {
    animation: textFadeIn 0.6s ease forwards;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    .slider-text {
        margin-bottom: 24px;
    }

    .slider-text p {
        font-size: clamp(1.25rem, 5vw, 1.5rem);
    }
}

/* High contrast mode support */
@media (forced-colors: active) {
    .slider-text p {
        -webkit-text-fill-color: CanvasText;
        background: none;
    }
}

/* Adjustments for product cards in quiz recommendation */
#quiz-recommendation .row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin: 0;
}

#quiz-recommendation .col-12 {
    padding: 0;
    flex: 0 0 auto; /* Не растягиваем элемент */
    width: 100%; /* Но позволяем занимать всю ширину контейнера */
    display: flex;
    justify-content: center;
}

#quiz-recommendation .personal-product-card,
#quiz-recommendation .col-12 .personal-product-card {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

#quiz-recommendation .personal-product-card__wrapper,
#quiz-recommendation .col-12 .personal-product-card__wrapper {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100%;
}

/* Убираем отступы mb-3, которые добавляются в стандартной карточке */
#quiz-recommendation .col-lg-4.mb-3 {
    margin: 0 auto !important;
    width: 100%;
}

/* Обеспечиваем перенос текста и правильное отображение содержимого */
#quiz-recommendation .personal-product-card__title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1.1rem;
}

#quiz-recommendation .personal-product-card__description {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    max-height: 6rem;
}

/* Правильное оформление изображения */
#quiz-recommendation .personal-product-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* квадрат */
    max-height: 300px; /* верхний предел высоты */
    overflow: hidden;
}

#quiz-recommendation .personal-product-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#quiz-recommendation .personal-product-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* квадрат */
    max-height: 300px; /* верхний предел высоты */
    overflow: hidden;
}

#quiz-recommendation .personal-product-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#quiz-recommendation .personal-product-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#quiz-recommendation .badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

#quiz-recommendation .badge-new {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

#quiz-recommendation .badge-bestseller {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

#quiz-recommendation .personal-product-card__content {
    padding: 20px;
}

#quiz-recommendation .personal-product-card__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

#quiz-recommendation .personal-product-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

#quiz-recommendation .personal-product-card__price {
    display: flex;
    flex-direction: column;
}

#quiz-recommendation .price {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}
#quiz-recommendation .personal-product-card__description p{
    margin-bottom: 2px;
    font-size: 14px;
}
#quiz-recommendation .old-price {
    font-size: 0.875rem;
    color: #C1D1E9;
    text-decoration: line-through;
}

#quiz-recommendation .product-card__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 165, 253, 0.3);
}

/* Responsive adjustments for product cards in quiz */
@media (max-width: 768px) {
    #quiz-recommendation .personal-product-card__title {
        font-size: 1.1rem;
    }
    
    #quiz-recommendation .price {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    #quiz-recommendation .personal-product-card__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    #quiz-recommendation .product-card__btn {
        width: 100%;
        text-align: center;
    }
}

/* Стили для основного контейнера рекомендации */
.recommendation-container {
    width: 100%;
    margin-top: 20px;
    display: flex;
    gap: 20px;
    align-items: stretch;
    justify-content: center;
}

/* Планшеты: складываем в колонку, центрируем, увеличиваем зазор */
@media (max-width: 992px) {
    .recommendation-container {
        flex-direction: column;
        align-items: center;
        gap: 24px;
        padding: 0 20px;
        margin-top: 0px;
    }
    #quiz-recommendation-title {
        padding: 20px 0px;
        text-align: center;
    }
    .recommended-product-wrapper {
        flex: 0 1 auto;
        max-width: 420px; /* немного шире на планшетах */
        width: 100%;
    }
    .alternatives-wrapper {
        width: 100%;
        align-items: center;
        display: block;
    }
    .alternatives-section {
        width: 100%;
    }
    .alternatives-grid {
        width: 100%;
        max-width: 700px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin: 0 auto;
    }
}

.recommended-product-wrapper {
    flex: 0 0 auto; /* match personal-product-card width */
    display: flex;
    flex-direction: column;
}

.recommended-product-wrapper > #quiz-recommendation {
    flex: 1 1 auto;
    display: flex;
}

.recommended-product {
    margin-bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
}

@media (max-width: 576px) {
    .alternatives-wrapper {
        width: 100%;
        flex: 1 1 100%;
    }
    .recommended-product-wrapper {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Мобильные: одна колонка, растягиваем карточки на всю ширину */
@media (max-width: 576px) {
    .recommendation-container {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .recommended-product-wrapper {
        width: 100%;
    }
    .alternatives-wrapper {
        width: 100%;
    }
    .alternatives-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        max-width: 100%;
    }
    .alternative-card {
        min-height: 180px;
    }
    #alt3 h4, #alt4 h4 {
        font-size: 1rem;
    }
}

/* Стили для секции альтернативных решений */
.alternatives-section {
    width: auto; /* allow wrapper to size to grid width */
}

.alternatives-section h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: #fff;
}

.alternatives-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 500px; /* explicit width so grid tracks can resolve */
    max-width: 100%;
}

/* Улучшения для средних брейкпоинтов: более гибкая ширина */
@media (max-width: 1200px) {
    .alternatives-grid {
        width: 100%;
        max-width: 900px;
    }
}

@media (max-width: 576px) {
    .alternatives-grid {
        width: 100%;
    }
}

.alternative-card__wrapper {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alternative-card__content {
    padding: 20px;
    text-align: center;
    width: 100%;
}

.alternative-card__content h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #fff;
}

.alternative-card__content p {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: #ccc;
}

/* Стили для кнопки консультации */
.consultation-button {
    text-align: center;
    margin: 20px 0px;
}

/* Адаптивность для альтернативной сетки */
@media (max-width: 768px) {
    .alternatives-grid {
        grid-template-columns: 1fr; /* На мобильных устройствах одна колонка */
    }
    #quiz-recommendation-title{
        padding: 20px 0px;
        text-align: center;
    }
}

/* Дополнительные стили для адаптации карточек из каталога к альтернативному контексту */
#alt1 .col-lg-4.mb-3,
#alt2 .col-lg-4.mb-3 {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none;
    display: flex !important;
    justify-content: center;
}

.alternative-card .personal-product-card__wrapper {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    width: 100%;
    height: 100%;
    min-height: 150px;
}

.alternative-card .personal-product-card__content {
    padding: 20px;
}

/* Обеспечиваем, что карточки продуктов внутри альтернативных карточек занимают всю ширину */
.alternative-card .col-lg-4 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.alternatives-wrapper {
    flex: 0 1 auto; /* do not force full remaining width */
    display: flex;
    flex-direction: column;
    width: 100%; /* avoid shrink-to-zero on small screens */
    min-width: 0;
}

.alternatives-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.alternative-card-link {
    text-decoration: none;
}

.alternative-card {
    width: 100%;
    max-width: 100%;
    min-height: 220px; /* safe minimum to ensure visibility */
    height: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}
/* Фоны для альтернативных карточек */
.alternative-card--catalog { background-image: url('/static/img/art1.png'); }
.alternative-card--choice { background-image: url('/static/img/art2.jpg'); }

.alternative-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 100%);
}

.alternative-card__title {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.alternative-card__description p{
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: #eee;
    font-size: 0.9rem;
    margin: 0;
}

#alt3 .alternative-card__wrapper,
#alt4 .alternative-card__wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


.recommendation-item .slide {
    display: flex;
    flex-direction: column;
}

.recommendation-item .slider-text {
    width: 100%;
    text-align: left;
    margin-bottom: 20px;
}

#alt3 .alternative-card__overlay,
#alt4 .alternative-card__overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}

#alt3 .alternative-card__content,
#alt4 .alternative-card__content {
    text-align: left;
}

#alt3 h4, #alt4 h4 {
    font-size: 1rem;
}

.alternatives-grid > a.alternative-card {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
}

/* UI/UX улучшения для контейнеров рекомендаций */
.recommendation-container .slider-text {
    margin: 0 0 8px 0;
}
.recommendation-container .slider-text p {
    font-size: clamp(1.125rem, 2.2vw, 1.375rem);
    line-height: 1.35;
    text-align: center;
    padding-bottom: 20px;
}
@media (max-width: 992px) {
    .recommendation-container .slider-text p {
        text-align: center;
        margin: 8px 0 4px 0;
    }
}

/* Выравнивание и сетка альтернатив */
.recommendation-layout {
    padding: 8px 0 0 0;
}
@media (max-width: 992px) {
    .recommendation-layout {
        padding: 0px 20px;
    }
}
.alternatives-section {
    display: block;
}
.alternatives-grid {
    justify-items: stretch;
}
@media (max-width: 992px) {
    .alternatives-grid {
        margin: 0 auto;
    }
}

/* Карточки альтернатив: интерактивность, доступность, отступы */
.alternative-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.alternative-card:focus-visible {
    outline: 2px solid #1fa5fd;
    outline-offset: 2px;
}
.alternative-card:hover .alternative-card__overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.65) 100%);
}
.alternative-card:active {
    transform: scale(0.99);
}
.alternative-card__content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    column-gap: 12px;
    row-gap: 6px;
    min-height: 48px; /* улучшенный тап-таргет */
    border-radius: 12px;
    padding: 16px 20px;
}
.alternative-card__content h4 {
    margin: 0;
    letter-spacing: 0.2px;
    line-height: 1.25;
    text-align: left;
}
/* Иконка в заголовке альтернатив */
.alternative-card__icon {
    display: inline-block;
    width: 44px !important;
    height: 44px;
    margin: 0px 1px !important;
    vertical-align: middle;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
    flex: 0 0 auto;
}
.alternative-card__content {
    column-gap: 0px;
}
@media (max-width: 576px) {
    .alternative-card {
        border-radius: 14px;
    }
    .alternative-card__content {
        padding: 14px 16px;
        column-gap: 10px;
        min-height: 44px;
    }
}

/* Кнопка консультации: отступы и выравнивание */
.consultation-button {
    display: flex;
    justify-content: center;
}
.consultation-button .btn {
    min-height: 44px;
    padding: 12px 20px;
    position: relative;
    z-index: 0;
    will-change: transform, box-shadow, opacity;
    animation: quizPulse 2.2s ease-in-out infinite, quizGlow 3.6s ease-in-out infinite;
}

/* Мерцание/пульсация */
@keyframes quizPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

@keyframes quizGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(31,165,253,0.0); }
    50% { box-shadow: 0 10px 24px rgba(31,165,253,0.35), 0 0 0 6px rgba(31,165,253,0.15); }
}

/* Блик (shimmer) поверх кнопки */
.consultation-button .btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 120%;
    height: 100%;
    background: linear-gradient(110deg, rgba(255,255,255,0) 20%, rgba(255,255,255,0.25) 40%, rgba(255,255,255,0) 60%);
    transform: skewX(-20deg);
    z-index: -1;
    animation: quizShimmer 3.2s ease-in-out infinite;
}

@keyframes quizShimmer {
    0% { left: -150%; opacity: 0; }
    30% { opacity: 1; }
    60% { left: 130%; opacity: 0.9; }
    100% { left: 130%; opacity: 0; }
}

/* Уважение к настройкам доступности */
@media (prefers-reduced-motion: reduce) {
    .consultation-button .btn {
        animation: none;
    }
    .consultation-button .btn::after {
        animation: none;
        display: none;
    }
}

/* Responsive fixes for alternatives layout (placed last to win cascade) */
@media (max-width: 992px) {
    .alternatives-wrapper {
        width: 100%;
        align-items: center;
        display: block; /* избегаем проблем флекса в карусели */
        min-width: 0;
    }
    .alternatives-grid {
        width: 100%;
        max-width: 700px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin: 0 auto;
    }
}

@media (max-width: 576px) {
    .alternatives-wrapper {
        width: 100%;
        display: block; /* на мобилках используем блочную модель */
        min-width: 0;
    }
    .alternatives-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
        gap: 12px;
    }
}

/* Desktop layout: split container into two equal columns */
@media (min-width: 993px) {
    .recommendation-container {
        align-items: stretch;
    }
    .recommended-product-wrapper {
        flex: 1 1 50%;
        max-width: 50%;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .alternatives-wrapper {
        flex: 1 1 50%;
        max-width: 50%;
        display: flex; /* колонка, чтобы растягиваться по высоте контейнера */
        flex-direction: column;
        min-height: 0;
    }
    /* Allow grid to use available half width */
    .alternatives-section,
    .alternatives-grid {
        width: 100%;
        max-width: none;
    }

    /* Make inner sections stretch to equalize heights */
    .recommended-product-wrapper > #quiz-recommendation {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .alternatives-section {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }
    .alternatives-grid {
        flex: 1 1 auto; /* растягиваем грид, чтобы колонка была равной высоты */
        min-height: 0;
    }
}