.doctors_list {
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.doctors_list a {
    text-decoration: none;
}

.doctors_list_description {
    font-size: 20px;
    text-transform: uppercase;
    padding-left: 4px;
    color: var(--theme-base-color);
}

.doctors_list_title h2 {
    font-weight: 500;
    font-size: 36px;
    line-height: 44px;
}

/* ТЗ 4: блок по макету Figma «врачи» (RK-Dubai). Карточка 324×504 на десктопе, 256×504 на мобильном;
   высота уменьшается на невысоких экранах, чтобы кнопка «Вся команда» помещалась в экран (ТЗ 4.4). */
.doctors_list .grid_container_width {
    gap: 20px;
    margin-top: 47px;
}

.doctors_item_content {
    flex: none;
    width: 324px;
}

.doctor_card {
    --doctor-card-radius: 38px;
    position: relative;
    display: block;
    height: 440px;
    height: clamp(400px, calc(100vh - 264px), 504px);
    overflow: hidden;
    isolation: isolate; /* Safari: обрезка по скруглению и при анимации фото */
    border-radius: var(--doctor-card-radius);
    background: #e9e4e1; /* пока грузится фото */
    color: #fff;
}

.doctor_card:hover,
.doctor_card:focus {
    color: #fff;
}

.doctor_card_img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 15%;
}

/* затемнение низа фото — под стеклянной плашкой текст читается на светлом халате */
.doctor_card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    height: 174px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
}

/* Плашка: скругление верхних углов = скруглению карточки (ТЗ 4.3), нижние обрезает сама карточка */
.doctor_card_info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 24px;
    border-radius: var(--doctor-card-radius) var(--doctor-card-radius) 0 0;
    background: rgba(190, 198, 207, 0.1);
    -webkit-backdrop-filter: blur(26.5px);
    backdrop-filter: blur(26.5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.doctor_card_position,
.doctor_card_label {
    font-weight: 300;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: 0.04em;
}

.doctor_card_name {
    margin-top: 8px;
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 24px;
    line-height: 28px;
}

.doctor_card_facts {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.doctor_card_label,
.doctor_card_value {
    white-space: nowrap;
}

.doctor_card_value {
    font-weight: 400;
    font-size: 20px;
    line-height: 28px;
}

/* Десктоп с мышью: стаж и стоимость выезжают при наведении. Двигаются только transform и opacity —
   без пересчёта раскладки и перерисовки на каждом кадре (раньше анимировались bottom, padding
   и размеры фото — отсюда тормоза, ТЗ 4.1). На сенсорных экранах плашка видна сразу (ТЗ 4.2). */
@media (hover: hover) and (pointer: fine) and (min-width: 992px) {
    .doctor_card_img {
        transition: transform 0.5s cubic-bezier(0.2, 0.6, 0.2, 1);
        will-change: transform;
    }

    .doctor_card_info.has-facts {
        transform: translate3d(0, 74px, 0); /* прячем строку фактов (22 + 28) и нижний отступ (24) */
        transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
        will-change: transform;
    }

    .doctor_card_facts {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .doctor_card:hover .doctor_card_img,
    .doctor_card:focus-visible .doctor_card_img {
        transform: scale(1.05);
    }

    .doctor_card:hover .doctor_card_info,
    .doctor_card:focus-visible .doctor_card_info {
        transform: translate3d(0, 0, 0);
    }

    .doctor_card:hover .doctor_card_facts,
    .doctor_card:focus-visible .doctor_card_facts {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .doctor_card_img,
    .doctor_card_info,
    .doctor_card_facts {
        transition: none !important;
    }
}

/* Стрелки (десктоп), точки (мобильный) и кнопка «Вся команда» */
.doctors_list_footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 42px;
}

.doctors_list_footer .navigation-buttons {
    margin-top: 0;
}

.doctors_list_fits .navigation-buttons {
    visibility: hidden; /* все карточки и так видны */
}

.doctors_list_dots {
    display: none;
}

.doctors_list_all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 343px;
    max-width: 100%;
    height: 52px;
    margin-left: auto;
    padding: 14px 24px;
    border-radius: 40px;
    background: #f2e0c5;
    color: #031979;
    font-weight: 300;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: 0.04em;
    transition: background-color 0.2s ease;
}

.doctors_list .doctors_list_all:hover,
.doctors_list .doctors_list_all:focus {
    background: #ebd3ae;
    color: #031979;
}

.doctors_list_all:focus-visible {
    outline: 2px solid #031979;
    outline-offset: 2px;
}

@media (max-width: 991px) {
    .doctors_list_title {
        padding-bottom: 20px;
    }

    .doctors_list_title h2 {
        font-size: var(--heading-font-size);
        line-height: var(--heading-line-height);
    }

    .doctors_list_description {
        font-size: 16px;
    }

    .doctors_list .container {
        padding: 0px;
    }

    .doctors_list .grid_container_scroll {
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
    }

    .doctors_list .grid_container_width {
        gap: 16px;
        margin-top: 24px;
    }

    .doctors_item_content {
        width: 256px;
        scroll-snap-align: start;
    }

    /* ТЗ 4.4: заголовок (≈85) + карточка + точки и кнопка (≈114) + шапка (60) + поля помещаются
       в видимую высоту экрана (svh — без панелей браузера). Первое значение — для браузеров без svh. */
    .doctor_card {
        --doctor-card-radius: 24px;
        height: 400px;
        height: clamp(340px, calc(100svh - 275px), 504px);
    }

    .doctor_card_value {
        font-size: 16px;
        line-height: 22px;
    }

    /* на карточке 256 px «Стаж 23 года» и «Стоимость приема» должны поместиться в одну строку */
    .doctor_card_facts {
        gap: 4px;
    }

    .doctor_card_label {
        letter-spacing: 0.02em;
    }

    .doctors_list_footer {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
        margin-top: 24px;
        padding: 0 16px;
    }

    .doctors_list_dots {
        display: flex;
        align-items: center;
        gap: 4px;
        height: 14px;
    }

    .doctors_list_fits .doctors_list_dots {
        display: none;
    }

    .doctors_list_dot {
        flex: none;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #e2d9dc;
        transition: background-color 0.2s ease;
    }

    .doctors_list_dot.is-active {
        width: 14px;
        height: 14px;
        background: #031979;
    }

    .doctors_list_dot.is-far {
        width: 8px;
        height: 8px;
    }

    .doctors_list_all {
        width: 100%;
        margin-left: 0;
    }
}
