/* ===== HERO ===== */
.page-hero {
    background-color: var(--bg-light-gray);
    padding: 60px 0;
    text-align: center;
    position: relative;
    z-index: 2;
}

.page-title {
    font-size: 42px;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -1px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-gray);
    max-width: 500px;
    margin: 0 auto;
}

/* ===== ОСНОВНАЯ СЕКЦИЯ ===== */
.terms-main-section {
    background-color: var(--bg-white);
    padding: 80px 0 120px;
    position: relative;
}

/* Отступ контенту сверху, чтобы текст не прилипал к волне */
.terms-main-section .container {
    position: relative;
    z-index: 3;
    padding-top: 50px;
}

.wave-top, .wave-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-top { top: -1px; }
.wave-bottom { bottom: -1px; transform: rotate(180deg); }

.wave-top svg, .wave-bottom svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-top .shape-fill { fill: var(--bg-light-gray); }
.wave-bottom .shape-fill { fill: var(--text-dark); }

/* ===== СЕТКА ТЕРМИНОВ ===== */
.terms-grid {
    column-count: 2;
    column-gap: 80px;
    position: relative;
    z-index: 3;
}

.terms-grid.few-items {
    column-count: 1;
}

.terms-item {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 60px;
    min-width: 0;
}

.terms-item h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.terms-placeholder {
    margin-bottom: 50px;
}

.terms-placeholder p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
    line-height: 1.8;
}

/* ===== ФОРМАТИРОВАНИЕ КОНТЕНТА ===== */
.formatted-content p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: var(--text-gray);
    font-size: 16px;
}

.formatted-content strong,
.formatted-content b {
    font-weight: 700;
    color: var(--text-dark);
}

.formatted-content ul,
.formatted-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.formatted-content ul { list-style-type: disc; }
.formatted-content ol { list-style-type: decimal; }

.formatted-content li {
    margin-bottom: 8px;
    line-height: 1.7;
    color: var(--text-gray);
    font-size: 16px;
}

.formatted-content a {
    color: var(--text-dark);
    text-decoration: underline;
}

/* ===== ПЛАНШЕТ (≤992px) ===== */
@media (max-width: 992px) {
    .terms-main-section .container { padding-top: 40px; }
    .terms-grid {
        column-count: 1;
        column-gap: 0;
    }
    .terms-item {
        margin-bottom: 50px;
    }
    /* page-title остаётся 42px — как в каталоге на этом разрешении */
}

/* ===== ТЕЛЕФОН (≤768px) ===== */
@media (max-width: 768px) {
    .page-hero { padding: 40px 0; }
    .page-title { font-size: 32px; letter-spacing: -0.5px; margin-bottom: 10px; } /* размер как в каталоге на мобилке */
    .page-subtitle { font-size: 14px; padding: 0 15px; }

    .terms-main-section { padding: 60px 0 90px; }
    .terms-main-section .container { padding-top: 30px; }

    .terms-item {
        margin-bottom: 40px;
    }

    .terms-item h2 {
        font-size: 24px;
        margin-bottom: 18px;
        padding-bottom: 12px;
    }

    .terms-placeholder {
        margin-bottom: 30px;
    }

    .terms-placeholder p,
    .formatted-content p,
    .formatted-content li {
        font-size: 15px;
        line-height: 1.75;
    }

    .formatted-content ul,
    .formatted-content ol {
        padding-left: 22px;
    }

    .wave-top svg, .wave-bottom svg {
        height: 40px;
    }
}

/* ===== МАЛЕНЬКИЙ ТЕЛЕФОН (≤480px) ===== */
@media (max-width: 480px) {
    .page-hero { padding: 30px 0; }
    /* page-title остаётся 32px — как в каталоге */

    .terms-main-section { padding: 40px 0 70px; }
    .terms-main-section .container { padding-top: 25px; }

    .terms-item h2 {
        font-size: 22px;
    }

    .terms-placeholder p,
    .formatted-content p,
    .formatted-content li {
        font-size: 14px;
        line-height: 1.7;
    }

    .formatted-content {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}