.is-hidden {
    display: none;
}

.doctor-age-icon {
    vertical-align: middle;
    margin-right: 4px;
}

body.hidden {
    overflow: hidden;
}
.doctors-wrapper {
    position: relative;
}

.doctors-content-wrapper {
    display: flex;
    gap: 20px;
}

.appointment-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.appointment-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Затемнение остальных карточек при открытой панели записи */
.doctors-container:has(.doctor-card.expanded) .doctor-card:not(.expanded) {
    opacity: 0.4;
    filter: grayscale(30%);
    transition: opacity 0.3s ease, filter 0.3s ease;
    pointer-events: none;
}

.doctors-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
    padding-right: calc(250px + 10px); /* Меню (250px) + отступ от меню (10px) */
    width: 100%;
    box-sizing: border-box;
}

.doctor-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.4s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 1;
    transform: scale(1);
    min-width: 300px;
    width: 100%;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
    z-index: 1;
    align-items: stretch;
    min-height: 200px;
}

.doctor-card.expanded {
    border-color: #1BA1F2;
    box-shadow: 0 0 20px rgba(27, 161, 242, 0.4), 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    border-radius: 8px 8px 0 0;
}


.doctor-card-content {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    align-content: flex-start;
}

.doctor-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.doctor-card.expanded:hover {
    box-shadow: 0 0 20px rgba(27, 161, 242, 0.4), 0 4px 12px rgba(0,0,0,0.15);
}

.doctor-card {
    transition: opacity 0.4s ease, transform 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

.doctor-card.hidden {
    display: none !important;
}



@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.doctor-photo.lazy-load {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.doctor-photo.lazy-loaded {
    opacity: 1;
}

.doctor-photo {
    width: 120px;
    height: 150px;
    border-radius: 8px;
    object-fit: contain;
    object-position: center top;
    margin-left: 15px;
    margin-top: 0;
    flex-shrink: 0;
    align-self: flex-start;
    background: #f5f5f5;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.doctor-photo:hover {
    transform: scale(1.05);
}

.doctor-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 0;
    padding-top: 0;
    align-self: flex-start;
    min-height: 150px;
    width: 100%;
    box-sizing: border-box;
}

.doctor-name {
    font-size: 18px;
    font-weight: normal;
    color: #000;
    margin: 0 0 8px 0;
    padding: 10px 12px;
    background-color: rgba(27, 161, 242, 0.5);
    border-radius: 5px;
    display: block;
    line-height: 1.3;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 60px;
    box-sizing: border-box;
}

.doctor-detail-link {
    color: inherit;
    text-decoration: none;
}

.doctor-detail-link:hover {
    color: inherit;
    text-decoration: none;
}

.doctor-name:hover {
    background-color: #4DC160;
}

.doctor-position {
    font-size: 14px;
    color: #666;
    margin-bottom: 3px;
}

.doctor-experience {
    font-size: 13px;
    color: #888;
    margin-bottom: 3px;
}

.doctor-patient-age {
    font-size: 13px;
    color: #888;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.doctor-patient-age .doctor-age-icon {
    flex-shrink: 0;
}

.doctor-next-appointment {
    font-size: 11px;
    color: #000;
    min-height: 16px;
    margin-top: 2px;
}

.next-appointment-label {
    color: #000;
}

.next-appointment-loading {
    color: #666;
    font-style: italic;
}

.next-appointment-date {
    color: #1BA1F2;
    font-weight: bold;
}

.next-appointment-time {
    color: #1BA1F2;
    font-weight: 500;
}

.next-appointment-none {
    color: #666;
    font-style: italic;
}

.doctor-appointment-button {
    width: calc(100% + 30px);
    margin: 15px -15px -15px -15px;
    padding: 12px 20px;
    text-align: center;
    cursor: pointer;
    background-color: #1BA1F2;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 0 0 8px 8px;
    transition: background-color 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.doctor-appointment-button:hover {
    background-color: #4DC160;
}


.doctor-appointment-expanded {
    position: absolute;
    top: 100%;
    left: -2px; /* Компенсируем границу плашки */
    right: -2px; /* Компенсируем границу плашки */
    background: #fff;
    border: 2px solid #1BA1F2;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                padding 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    z-index: 101;
    margin-top: -2px; /* Перекрываем нижнюю границу карточки */
    pointer-events: none; /* Отключаем события мыши когда скрыта */
}

.doctor-card.expanded .doctor-appointment-expanded {
    max-height: 80vh;
    opacity: 1;
    padding: 20px;
    transform: translateY(0);
    pointer-events: auto; /* Включаем события мыши когда видима */
    overflow-y: auto;
}

.doctor-appointment-expanded-content {
    padding-top: 0;
}

.doctor-appointment-date {
    font-size: 16px;
    font-weight: bold;
    color: #041520;
    margin-bottom: 15px;
}

.doctor-appointment-time {
    font-size: 18px;
    color: #1BA1F2;
    font-weight: bold;
    margin-bottom: 20px;
}

.doctor-appointment-submit-btn {
    width: 100%;
    padding: 15px;
    background-color: #1BA1F2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.doctor-appointment-submit-btn:hover:not(:disabled) {
    background-color: #4DC160;
}

.doctor-appointment-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Форма записи на прием */
.appointment-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.appointment-error {
    padding: 15px;
    background-color: #ffebee;
    color: #c62828;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.appointment-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.appointment-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #041520;
    margin-bottom: 12px;
}

/* Карточки услуг */
.appointment-services-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.appointment-service-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    margin-bottom: 3px;
}

.appointment-services-list .appointment-service-card:last-child {
    margin-bottom: 0;
}

.appointment-service-card:hover {
    border-color: #1BA1F2;
    background: #f0f8ff;
}

.appointment-service-card.selected {
    border-color: #1BA1F2;
    background: #e3f2fd;
}

.appointment-service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.appointment-service-name {
    font-size: 15px;
    font-weight: 600;
    color: #041520;
    flex: 1;
    margin-right: 10px;
}

.appointment-service-price {
    font-size: 16px;
    font-weight: 600;
    color: #1BA1F2;
    white-space: nowrap;
}

.appointment-service-info {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

.appointment-service-duration {
    color: #666;
}

.appointment-service-slots {
    color: #1BA1F2;
    font-weight: 500;
}

/* Раскрывающиеся секции дат */
.appointment-dates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.appointment-date-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.appointment-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.appointment-date-header:hover {
    background-color: #f5f5f5;
}

.appointment-date-title {
    font-size: 15px;
    font-weight: 600;
    color: #041520;
}

.appointment-date-slots-count {
    font-size: 13px;
    color: #666;
    margin-left: 10px;
}

.appointment-date-arrow {
    font-size: 18px;
    color: #666;
    transition: transform 0.3s ease;
}

.appointment-date-section.expanded .appointment-date-arrow {
    transform: rotate(180deg);
}

.appointment-date-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 15px;
}

.appointment-date-section.expanded .appointment-date-content {
    max-height: 500px;
    padding: 15px;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.appointment-times-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
}

.appointment-time-item {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.appointment-time-item:hover {
    border-color: #1BA1F2;
    color: #1BA1F2;
    background-color: #f0f8ff;
}

.appointment-time-item.selected {
    background-color: #1BA1F2;
    border-color: #1BA1F2;
    color: #fff;
}

.appointment-time-item:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

/* Кнопка Записаться рядом со временем */
.appointment-time-submit-btn {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 22px;
    background-color: #1BA1F2;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 130px;
    opacity: 0;
    animation: submitBtnAppear 0.3s ease forwards;
    box-shadow: 0 0 10px rgba(27, 161, 242, 0.4);
    z-index: 10000;
    pointer-events: auto;
}

@keyframes submitBtnAppear {
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
        box-shadow: 0 0 15px rgba(27, 161, 242, 0.6);
    }
}

.appointment-time-submit-btn:hover {
    background-color: #4DC160;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 0 20px rgba(77, 193, 96, 0.7);
}

.appointment-time-submit-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.appointment-time-item-wrapper {
    display: inline-flex;
    position: relative;
    align-items: center;
    flex-shrink: 0;
}

/* Модальное окно для формы записи */
.appointment-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.appointment-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.appointment-modal-content {
    background-color: #fff;
    padding: 20px 25px;
    border-radius: 12px;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.appointment-modal.active .appointment-modal-content {
    transform: scale(1);
}

.appointment-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.appointment-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.appointment-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #041520;
    margin-bottom: 10px;
    padding-right: 30px;
    width: 100%;
    box-sizing: border-box;
}

.appointment-modal-info {
    padding: 8px 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.4;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.appointment-modal-info-inner {
    flex: 1;
    min-width: 0;
}

.appointment-modal-doctor-photo {
    flex-shrink: 0;
    width: 120px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
}

.appointment-modal-doctor-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.appointment-modal-doctor {
    color: #041520;
    font-weight: 600;
    margin-bottom: 3px;
}

.appointment-modal-doctor-position {
    color: #666;
    font-size: 13px;
    margin-bottom: 4px;
}

.appointment-modal-datetime {
    color: #1BA1F2;
    font-weight: 500;
    padding-top: 6px;
    margin-top: 4px;
    border-top: 1px solid #e0e0e0;
    margin-bottom: 4px;
}

.appointment-modal-service {
    color: #041520;
    font-size: 13px;
    margin-top: 4px;
    margin-bottom: 2px;
}

.appointment-modal-service-price {
    color: #1BA1F2;
    font-weight: 600;
    font-size: 14px;
    margin-top: 2px;
}

.appointment-modal-doctor-experience {
    color: #666;
    font-size: 13px;
    margin-bottom: 4px;
}

.appointment-modal-doctor-patient-age {
    color: #666;
    font-size: 13px;
    margin-bottom: 4px;
}

.appointment-form-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.appointment-form-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-top: 9px;
}

.appointment-form-label {
    font-size: 14px;
    font-weight: 500;
    color: #041520;
    margin: 0;
    display: inline-block;
    width: auto;
    max-width: 100%;
    line-height: 1.2;
    position: absolute;
    top: 0;
    left: 10px;
    z-index: 1;
    background: #fff;
    padding: 0 6px;
    pointer-events: none;
}

.appointment-form-label .required-star {
    color: #d32f2f;
    margin-left: 2px;
}

.appointment-form-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    margin-top: 0;
    margin-bottom: 0;
    height: auto;
    min-height: 38px;
    min-width: 0;
}

.appointment-form-input:focus {
    outline: none;
    border-color: #1BA1F2;
    box-shadow: 0 0 0 2px rgba(27, 161, 242, 0.1);
}

.appointment-form-input.empty {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.appointment-form-input.empty:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}

.appointment-form-row {
    display: flex;
    gap: 6px;
}

.appointment-form-row .appointment-form-group {
    flex: 1;
    width: 100%;
    min-width: 0;
}

.appointment-form-submit {
    width: 100%;
    padding: 10px;
    background-color: #1BA1F2;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 4px;
    box-sizing: border-box;
}

.appointment-form-submit:hover:not(:disabled) {
    background-color: #4DC160;
}

.appointment-form-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.appointment-form-note {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 6px;
    margin-bottom: 0;
    line-height: 1.3;
}

.appointment-age-reminder {
    margin-top: 7px;
    padding: 9px 10px;
    border: 1px solid #1BA1F2;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
}

.appointment-age-reminder.is-invalid {
    border-color: #d32f2f;
    color: #d32f2f;
    background: #fff6f6;
}

/* Поле поиска */
.doctors-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.doctors-search-wrapper {
    position: relative;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-width: 0;
}

.doctors-search-input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.doctors-search-input:focus {
    outline: none;
    border-color: #1BA1F2;
}

.doctors-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    color: #999;
}

.doctors-search-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.doctors-search-clear {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    color: #999;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.doctors-search-clear:hover {
    background-color: #f0f0f0;
    color: #333;
}

.doctors-gender-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.doctors-gender-filter-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #d7dce2;
    border-radius: 10px;
    background: #fff;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8b96a3;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.doctors-gender-filter-btn svg {
    width: 24px;
    height: 24px;
}

.doctors-gender-filter-btn:hover {
    transform: translateY(-1px);
}

.doctors-gender-filter-btn.is-female:hover,
.doctors-gender-filter-btn.is-female.active {
    border-color: #e91e8f;
    color: #e91e8f;
    background: #fff4fa;
}

.doctors-gender-filter-btn.is-male:hover,
.doctors-gender-filter-btn.is-male.active {
    border-color: #1b9ff2;
    color: #1b9ff2;
    background: #f1f9ff;
}

/* Плавающее меню должностей */
.doctors-filter-menu {
    position: fixed;
    right: 10px;
    top: 240px; /* Начинается ниже верхней панели */
    transform: none; /* Убираем translateY, так как используем фиксированный top */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    min-width: 200px;
    max-width: 250px;
    max-height: calc(100vh - 270px); /* Учитываем отступ сверху и снизу */
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1; /* Минимальный z-index, чтобы не закрывать верхнюю панель */
    bottom: 20px; /* Ограничиваем снизу */
}

/* Заголовок меню удален */

.doctors-filter-item {
    display: block;
    padding: 8px 12px;
    margin: 5px 0;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #041520;
    text-decoration: none;
}

.doctors-filter-item:hover {
    background: #E3F2FD;
    border-color: #1BA1F2;
    color: #1BA1F2;
}

.doctors-filter-item.active {
    background: #1BA1F2;
    border-color: #1BA1F2;
    color: #fff;
    font-weight: bold;
}

.doctors-filter-item.all {
    background: #fff;
    border-color: #e0e0e0;
    color: #041520;
    font-weight: bold;
    margin-bottom: 10px;
}

.doctors-filter-item.all:hover {
    background: #E3F2FD;
    border-color: #1BA1F2;
    color: #1BA1F2;
}

.doctors-filter-item.all.active {
    background: #1BA1F2;
    border-color: #1BA1F2;
    color: #fff;
}

/* Модальное окно */
.doctor-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0);
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.doctor-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    background-color: rgba(0,0,0,0.6);
}

.doctor-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.85) translateY(30px);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform-origin: center center;
    overflow: hidden;
}

.doctor-modal.active .doctor-modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.doctor-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.doctor-modal-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.doctor-modal-header {
    display: flex;
    flex-direction: row-reverse;
    padding: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.doctor-modal-photo {
    width: 150px;
    height: 188px;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    margin-left: 20px;
    margin-top: -10px;
    flex-shrink: 0;
    background: #f5f5f5;
}

.doctor-modal-info {
    flex: 1;
}

.doctor-modal-name {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    padding: 8px 15px;
    background-color: #1BA1F2;
    border-radius: 5px;
    display: inline-block;
}

.doctor-modal-position {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.doctor-modal-experience {
    font-size: 14px;
    color: #888;
}

.doctor-modal-patient-age {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.doctor-modal-patient-age .doctor-age-icon {
    color: #1BA1F2;
}

.doctor-modal-body {
    padding: 0 30px 30px 30px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.doctor-modal-section {
    margin-bottom: 25px;
}

.doctor-modal-section h3 {
    font-size: 18px;
    color: #041520;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #1BA1F2;
}

.doctor-education,
.doctor-accreditation {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doctor-education li,
.doctor-accreditation li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.6;
}

.doctor-education li:last-child,
.doctor-accreditation li:last-child {
    border-bottom: none;
}

.doctor-education li strong,
.doctor-accreditation li strong {
    color: #1BA1F2;
    margin-right: 8px;
}

@media (max-width: 1024px) {
    .doctors-filter-menu {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        margin-bottom: 20px;
        max-height: 300px;
    }
    
    .doctors-content-wrapper {
        flex-direction: column;
    }
    
    .doctors-container {
        grid-template-columns: 1fr;
        padding-right: 20px; /* Небольшой отступ на планшетах */
    }
}

@media (max-width: 768px) {
    .doctors-search-row {
        gap: 8px;
    }

    .doctors-gender-filter-btn {
        width: 40px;
        height: 40px;
    }

    .doctors-gender-filter-btn svg {
        width: 22px;
        height: 22px;
    }

    .doctors-container {
        grid-template-columns: 1fr;
        padding-right: 20px; /* Отступ на мобильных */
    }
    
    .doctor-modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .doctor-modal-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .doctor-modal-photo {
        margin-right: 0;
        margin-bottom: 15px;
    }
}
