/* ==========================================================================
   Styles for Patients Section
   File: template-parts/css/patients.css
   ========================================================================== */

.patients {
    padding: 80px 0;
    position: relative;
    overflow-x: hidden; /* Защита от горизонтального скролла */
}

/* --- Заголовок секции --- */
.patients__header {
    margin-bottom: 48px;
}

/* --- Контейнер и трек слайдера --- */
.patients__slider-container {
    overflow: visible; 
    position: relative;
    /* ТРЮК: Растягиваем контейнер строго до краев экрана с помощью данных из JS */
    margin-left: var(--margin-left, 0px);
    margin-right: var(--margin-right, 0px);
}
/* --- Контейнер и трек слайдера --- */
.patients__slider-track {
    display: flex;
    gap: 32px;
    overflow-x: auto; 
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory; 
    
    /* ВОЗВРАЩАЕМ НОРМАЛЬНЫЕ ОТСТУПЫ */
    padding-left: var(--pad-left, 15px);
    padding-right: var(--pad-right, 15px); /* Убрали костыль 80vw */
    padding-bottom: 24px; 
    
    scroll-padding-left: var(--pad-left, 15px);
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

.patients__slider-track::-webkit-scrollbar {
    display: none; 
}

.patients__slider-item {
    /* Фиксируем ширину карточки: 1000px на ПК, и до 85vw на телефонах */
    flex: 0 0 clamp(280px, 80vw, 1000px); 
    
    /* Точка магнита для каждой карточки */
    scroll-snap-align: start; 
    scroll-snap-stop: always;
}

/* --- Карточка --- */
.patients__card {
    background: #FFFFFF;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(41, 43, 50, 0.06);
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

/* --- Ползунок До/После (BA Slider) --- */
.ba-slider {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    user-select: none;
}

.ba-slider__before,
.ba-slider__after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ba-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ba-slider__after {
    clip-path: inset(0 0 0 50%); 
    z-index: 2;
}

.ba-slider__before {
    z-index: 1;
}

.ba-slider__range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
}

.ba-slider__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #FFFFFF;
    z-index: 5;
    transform: translateX(-50%);
    pointer-events: none;
}

.ba-slider__circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--header-accent);
    border: 3px solid #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.ba-slider__circle svg {
    transform: rotate(90deg);
}

.ba-slider__label {
    position: absolute;
    top: 30px; 
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: rgba(124, 132, 152, 0.8);
    letter-spacing: 1px;
    z-index: 8; 
    text-transform: uppercase;
    pointer-events: none; 
}

.ba-slider__label--before { left: 30px; }
.ba-slider__label--after { right: 30px; }

/* --- Инфо-блок (Правая колонка) --- */
.patients__card-info {
    padding: 40px 46px 40px 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.patients__card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.patients__card-tag {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--header-gray);
    border: 1px solid #CBCCD3;
    padding: 8px 16px;
    border-radius: 100px;
    text-decoration: none;
    transition: 0.2s;
}

.patients__card-tag:hover {
    background: var(--header-accent);
    color: #FFFFFF;
    border-color: var(--header-accent);
}

.patients__card-title {
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    font-size: 21px;
    line-height: 1.3;
    color: var(--header-dark);
    margin-bottom: 15px;
}

.patients__card-patient {
    font-family: var(--header-font-primary);
    font-style: italic;
    font-size: 14px;
    color: var(--header-gray);
    padding-bottom: 15px;
    border-bottom: 1px dotted #CBCCD3;
    margin-bottom: 20px;
}

.patients__card-review {
    display: flex; 
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.patients__card-review-icon {
    flex-shrink: 0; 
    margin-top: 4px; 
    width: 24px; 
    height: auto;
    display: block;
}

.patients__card-review p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--header-gray);
    margin: 0;
}

.patients__card-link {
    font-family: var(--header-font-primary);
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    width: fit-content;
    
    background: linear-gradient(90deg, #F44847 0%, #F19E57 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.patients__card-link:hover {
    opacity: 0.8;
    gap: 12px;
}

/* --- Стрелки навигации --- */
.patients__arrows {
    display: flex;
    gap: 15px;
}

.patients__arrow {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--header-accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.patients__arrow:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(255, 138, 4, 0.2);
}

/* --- Подсказка внизу --- */
.patients__footer-note {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start; 
}

.patients__footer-note p {
    font-size: 14px;
    color: #62748E;
    margin: 0;
}

.patients__footer-note strong {
    font-weight: 700;
    color: var(--header-dark);
}

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */

@media (max-width: 991.98px) {
    .ba-slider {
        min-height: 400px;
    }
    .patients__card-info {
        padding: 30px;
    }
}

@media (max-width: 767.98px) {
    .patients {
        padding: 40px 0;
    }
    .ba-slider {
        min-height: 350px;
    }
    .patients__card-title {
        font-size: 20px;
    }
}

/* ==========================================================================
   СТИЛИ ДЛЯ ФИНАЛЬНОЙ КАРТОЧКИ (CTA)
   ========================================================================== */
.patients__card--cta {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Делаем легкий фоновый градиент для выделения */
    background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
    position: relative;
}

/* Добавляем легкое свечение на фон */
.patients__card--cta::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(244, 72, 71, 0.03) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.patients__cta-content {
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.patients__cta-text {
    font-family: var(--header-font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--header-gray);
    max-width: 450px;
    margin: 0 auto;
}

.patients__cta-btn {
    width: auto !important; /* Отменяем мобильное растягивание на 100% */
    padding: 20px 40px !important;
    font-size: 16px !important;
}

@media (max-width: 767.98px) {

    .patients__footer-note {
        display: none !important;
    }

    /* Стилизуем контейнер мобильной кнопки */
    .patients__mobile-cta {
        width: 100%;
        display: block;
    }

    /* Делаем кнопку оранжевой и во всю ширину */
    .patients__mobile-cta .btn-primary-large {
        width: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
        text-transform: uppercase;
        font-weight: 600;
        /* Убедись, что класс .btn-primary-large уже имеет оранжевый фон в style.css */
    }

    .patients {
        padding: 40px 0;
    }
    .ba-slider {
        min-height: 350px;
    }
    .patients__card-title {
        font-size: 20px;
    }
    
    /* --- ВОЗВРАЩАЕМ ВЕРТИКАЛЬНЫЙ ВИД НА МОБИЛКАХ --- */
    
    /* 1. Отключаем растягивание контейнера за пределы экрана */
    .patients__slider-container {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* 2. Превращаем трек из горизонтального в вертикальный */
    .patients__slider-track {
        flex-direction: column;
        gap: 24px; /* Отступ между карточками вниз */
        
        /* Отключаем скролл, магниты и боковые отступы */
        overflow-x: visible; 
        scroll-snap-type: none; 
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* 3. Карточки занимают всю ширину экрана */
    .patients__slider-item {
        flex: 0 0 auto;
        width: 100%;
    }

    /* Скрываем текстовую подсказку и финальную карточку (на всякий случай дублируем) */
    .patients__footer-note,
    .patients__slider-item--cta {
        display: none !important;
    }

    /* Оранжевая кнопка для мобилок */
    .patients__mobile-cta .btn-primary-large {
        width: 100% !important;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 22px;
        border-radius: 100px;
        border: none;
        
        /* Тот самый оранжевый градиент */
        background: linear-gradient(90deg, #F44847 0%, #F19E57 100%) !important;
        
        font-family: 'Inter', sans-serif;
        font-size: 16px;
        font-weight: 600;
        color: #FFFFFF !important;
        text-transform: uppercase;
        text-decoration: none;
        box-shadow: 0 4px 16px rgba(244, 72, 71, 0.25);
    }
}

/* На всякий случай скрываем мобильную кнопку на ПК */
@media (min-width: 992px) {
    .patients__mobile-cta {
        display: none !important;
    }
}