/* Обновленные стили для модального окна с фиксированным заголовком */

/* Контейнер модального окна с измененной структурой */
.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background-color: #fff;
    border-radius: 25px;
    z-index: 1001;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Убираем общий скролл контейнера */
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.modal-container.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Фиксированный заголовок */
.modal-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    padding: 30px 30px 0;
    z-index: 1003;
    border-radius: 25px 25px 0 0;
    /* Добавляем тень для визуального отделения при скролле */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Кнопка закрытия теперь в header */
.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 1004;
    transition: transform 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--purple-accent, #7272ec);
    border-radius: 1px;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

/* Стили заголовка */
.policy-modal-title {
    color: var(--dark-purple, #4a4a8d);
    font-family: var(--h1-font-family, "Circe-Bold", sans-serif);
    font-size: 36px;
    line-height: 1.3;
    margin-bottom: 15px;
    padding-right: 40px; /* Отступ для кнопки закрытия */
}

.policy-modal-date {
    color: var(--extra-dark-purple, #2c2c62);
    opacity: 0.7;
    font-family: var(--body-font-family, "Comfortaa-Regular", sans-serif);
    font-size: 14px;
    margin-bottom: 20px;
    text-align: right;
}

/* Контейнер для прокрутки содержимого */
.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 30px 30px;
}

/* Стили содержимого */
.policy-modal-section {
    margin-bottom: 30px;
}

.policy-modal-section:last-child {
    margin-bottom: 0;
}

.policy-modal-section-title {
    color: var(--purple-accent, #7272ec);
    font-family: var(--h3-font-family, "Circe-Bold", sans-serif);
    font-size: 22px;
    margin-bottom: 15px;
}

.policy-modal-section p {
    color: var(--extra-dark-purple, #2c2c62);
    font-family: var(--body-3-font-family, "Comfortaa-Regular", sans-serif);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.policy-modal-list {
    padding-left: 15px;
    margin-bottom: 15px;
}

.policy-modal-list li {
    color: var(--extra-dark-purple, #2c2c62);
    font-family: var(--body-3-font-family, "Comfortaa-Regular", sans-serif);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 8px;
    position: relative;
    padding-left: 22px;
}

.policy-modal-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    background-color: var(--purple-accent, #7272ec);
    border-radius: 50%;
}

.policy-modal-list li strong {
    color: var(--dark-purple, #4a4a8d);
    font-weight: 700;
}

.policy-modal-link {
    color: var(--purple-accent, #7272ec);
    text-decoration: none;
    border-bottom: 1px solid var(--purple-accent, #7272ec);
    transition: all 0.3s ease;
}

.policy-modal-link:hover {
    color: #5a5ad9;
    border-bottom-color: #5a5ad9;
}

/* Стилизация полосы прокрутки в модальном окне */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--purple-accent, #7272ec);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #5a5ad9;
}

/* Адаптивные стили */
@media screen and (max-width: 767px) {
    .modal-header {
        padding: 20px 20px 0;
    }

    .modal-content {
        padding: 0 20px 20px;
    }

    .modal-close {
        top: 20px;
        right: 20px;
    }

    .policy-modal-title {
        font-size: 28px;
    }

    .policy-modal-section-title {
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .modal-header {
        padding: 15px 15px 0;
    }

    .modal-content {
        padding: 0 15px 15px;
    }

    .modal-close {
        top: 15px;
        right: 15px;
        width: 28px;
        height: 28px;
    }

    .policy-modal-title {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .policy-modal-date {
        margin-bottom: 15px;
        font-size: 12px;
    }

    .policy-modal-section-title {
        font-size: 18px;
    }
}

/* Оверлей модального окна и другие стили без изменений */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: block;
    opacity: 1;
}

/* Предотвращение прокрутки основной страницы */
body.modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px);
}