﻿/* Юридические страницы (Условия продажи, GDPR — Views/Home/Legal.cshtml) */
:root {
    --legal-primary: #0d6efd;
    --legal-primary-dark: #0a58ca;
    --legal-soft: #eaf2ff;
    --legal-text: #2b3a4a;
}

html {
    scroll-padding-top: 20px;
}

/* Оглавление */
.legal-toc {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 1rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(13, 110, 253, .08);
    scrollbar-width: thin;
}

    .legal-toc ol {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .legal-toc a {
        display: flex;
        gap: .5rem;
        padding: .45rem .7rem;
        border-radius: 8px;
        color: var(--legal-text);
        font-size: .9rem;
        line-height: 1.35;
        text-decoration: none;
    }

        .legal-toc .legal-toc-num {
            flex-shrink: 0;
            min-width: 1.4em;
            color: var(--legal-primary);
            font-weight: 700;
        }

        .legal-toc a:hover {
            background: var(--legal-soft);
            color: var(--legal-primary);
        }

        .legal-toc a.active {
            background: var(--legal-primary);
            color: #fff;
        }

            .legal-toc a.active .legal-toc-num {
                color: #fff;
            }

.legal-toc-toggle {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .4rem .2rem;
    border: 0;
    background: none;
    color: var(--legal-primary);
    font-weight: 700;
}

/* Текст */
.legal-text {
    padding: clamp(1.25rem, .8rem + 2vw, 2.25rem);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(13, 110, 253, .08);
    color: var(--legal-text);
    line-height: 1.7;
    text-align: justify;
    overflow-wrap: break-word;
}

    .legal-text p {
        margin-bottom: .9rem;
    }

    .legal-text .legal-intro {
        color: #6c757d;
        font-weight: 600;
    }

    /* Заголовки разделов */
    .legal-text h2,
    .legal-text h3,
    .legal-text .legal-section {
        position: relative;
        margin: 2.25rem 0 1rem;
        padding: .2rem 0 .2rem 1rem;
        color: var(--legal-primary);
        font-size: 1.2rem;
        font-weight: 700;
        text-align: left;
    }

        .legal-text .legal-section::before {
            content: "";
            position: absolute;
            left: 0;
            top: .2em;
            bottom: .2em;
            width: 5px;
            border-radius: 3px;
            background: var(--legal-primary);
        }

    .legal-text ul,
    .legal-text ol {
        margin: 0 0 1rem 1.25rem;
        padding-left: 1rem;
    }

    .legal-text ol ol,
    .legal-text ol ul {
        margin-top: .5rem;
    }

    .legal-text li {
        margin-bottom: .4rem;
    }

        .legal-text li::marker {
            color: var(--legal-primary);
            font-weight: 700;
        }

    .legal-text a {
        color: var(--legal-primary);
    }

.legal-table-wrap {
    margin: 1rem 0 1.5rem;
    overflow-x: auto;
}

/* Кнопка «наверх» */
.legal-top {
    position: fixed;
    right: 32px;
    bottom: 104px; /* над кнопкой чата */
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--legal-primary);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 6px 16px rgba(13, 110, 253, .35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s;
}

    .legal-top.show {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .legal-top:hover {
        color: #fff;
        background: var(--legal-primary-dark);
    }

@media (max-width: 991.98px) {
    .legal-toc {
        position: static;
        max-height: none;
        padding: .75rem 1rem;
    }

        .legal-toc ol {
            margin-top: .5rem;
        }
}

@media (max-width: 575px) {
    .legal-text {
        text-align: left;
    }

    .legal-top {
        right: 14px;
        bottom: 90px;
    }
}
