/* Document styles (для страниц оферты и политики) */

.document {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    background: white;
    line-height: 1.3;
}

.document h1 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 2rem;
}

.document-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border);
}

.document-meta {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    font-size: 0.95rem;
    color: var(--gray);
}

.document h2 {
    color: var(--primary);
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.document h3 {
    color: var(--dark);
    margin-top: 30px;
    margin-bottom: 15px;
}

.document p {
    margin-bottom: 15px;
    text-align: justify;
}

.document ul, .document ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.document li {
    margin-bottom: 10px;
}

.highlight-box {
    background: #f0f9ff;
    border-left: 4px solid var(--primary);
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.requisites {
    background: var(--light);
    padding: 30px;
    border-radius: 10px;
    margin: 40px 0;
}

.requisites h3 {
    color: var(--primary);
    margin-bottom: 20px;
}

.requisites-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 15px;
}

.requisites-grid dt {
    font-weight: 600;
    color: var(--gray);
}

.requisites-grid dd {
    margin: 0;
    color: var(--dark);
}

.version-info {
    text-align: right;
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.toc {
    background: var(--light);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 40px;
}

.toc h3 {
    margin-top: 0;
    color: var(--primary);
}

.toc ol {
    margin-bottom: 0;
}

.toc a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s;
}

.toc a:hover {
    color: var(--primary);
}

.signature-block {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    text-decoration: none;
    margin-bottom: 30px;
    transition: gap 0.3s;
}

.back-link:hover {
    gap: 15px;
}

        /* Стили для политики конфиденциальности */
        .important-box {
            background: #fef3c7;
            border-left: 4px solid #f59e0b;
            padding: 20px;
            margin: 30px 0;
            border-radius: 0 8px 8px 0;
        }
    
        .info-box {
            background: #dbeafe;
            border-left: 4px solid var(--primary);
            padding: 20px;
            margin: 30px 0;
            border-radius: 0 8px 8px 0;
        }
    
        .contact-box {
            background: var(--light);
            padding: 30px;
            border-radius: 10px;
            margin: 40px 0;
            text-align: center;
        }
    
        .contact-box h3 {
            color: var(--primary);
            margin-bottom: 20px;
        }
    
        .data-table {
            overflow-x: auto;
            margin: 20px 0;
        }
    
        table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }
    
        th,
        td {
            border: 1px solid var(--border);
            padding: 12px;
            text-align: left;
        }
    
        th {
            background-color: var(--light);
            font-weight: 600;
        }

/* Стили для реквизитов исполнителя (десктоп) */
dl,
.requisites-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px 20px;
    align-items: start;
    margin: 20px 0;
    padding: 25px;
    background: var(--light);
    border-radius: 12px;
    border: 1px solid var(--border);
}

dt {
    font-weight: 600;
    color: var(--dark);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

dd {
    margin: 0;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    word-break: break-word;
}

dd a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

dd a:hover {
    text-decoration: underline;
}

/* Мобильная адаптация для документов */
@media (max-width: 768px) {
    .document {
        padding: 30px 15px;
    }
    
    .document h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .document h2 {
        font-size: 1.3rem;
        margin-top: 30px;
        margin-bottom: 15px;
    }
    
    .document h3 {
        font-size: 1.1rem;
        margin-top: 25px;
        margin-bottom: 12px;
    }
    
    .document p {
        font-size: 0.95rem;
        line-height: 1.5;
        text-align: left;
    }
    
    .toc {
        padding: 15px;
    }
    
    .toc ol {
        font-size: 0.9rem;
    }
    
    .important-box,
    .info-box {
        padding: 15px;
        margin: 20px 0;
    }
    
    .contact-box {
        padding: 20px;
        margin: 30px 0;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        font-size: 0.9rem;
    }
    
    .print-button {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .document {
        padding: 20px 10px;
    }
    
    .document h1 {
        font-size: 1.4rem;
    }
    
    .document h2 {
        font-size: 1.2rem;
    }
    
    .document h3 {
        font-size: 1rem;
    }
    
    .document p,
    .document li {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .version-info {
        font-size: 0.8rem;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 8px;
    }
    
    /* Реквизиты исполнителя - адаптация для мобильных */
    dl,
    .requisites-grid {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    dt {
        display: block;
        font-weight: 600;
        color: var(--dark);
        margin-bottom: 5px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-bottom: none;
        padding: 8px 0;
    }
    
    dd {
        display: block;
        margin: 0 0 15px 0;
        padding: 12px 15px;
        background: #f8fafc;
        border-radius: 8px;
        border-left: 3px solid var(--primary);
        word-break: break-word;
        word-wrap: break-word;
        overflow-wrap: break-word;
        position: relative;
        cursor: pointer;
        transition: background-color 0.2s;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        white-space: normal;
    }
    
    dd:hover {
        background: #e2e8f0;
    }
    
    dd:active {
        background: #cbd5e1;
    }
    
    dd a {
        color: var(--primary);
        text-decoration: none;
    }
    
    dd a:hover {
        text-decoration: underline;
    }
}

/* Дополнительные стили для реквизитов на планшетах */
@media (max-width: 768px) and (min-width: 481px) {
    dl,
    .requisites-grid {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
    }
}

/* Для больших планшетов можно оставить 2 колонки */
@media (max-width: 968px) and (min-width: 769px) {
    dl,
    .requisites-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
    }
    
    dt {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    dd {
        font-size: 0.9rem;
        padding: 10px 12px;
        line-height: 1.4;
    }
    
    /* Подсказка для копирования на мобильных */
    dl::after,
    .requisites-grid::after {
        content: "💡 Нажмите на любое значение, чтобы скопировать его";
        display: block;
        font-size: 0.8rem;
        color: var(--gray);
        text-align: center;
        margin-top: 15px;
        padding: 10px;
        background: #fff3cd;
        border-radius: 6px;
        border: 1px solid #ffeaa7;
    }
    
    /* Переопределяем базовые стили для списка реквизитов на мобильных */
    .requisites-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }
    
    .requisites-grid dt {
        display: block !important;
        width: auto !important;
        margin-bottom: 5px !important;
        border-bottom: none !important;
        grid-column: unset !important;
        grid-row: unset !important;
    }
    
    .requisites-grid dd {
        display: block !important;
        width: 100% !important;
        margin: 0 0 15px 0 !important;
        grid-column: unset !important;
        grid-row: unset !important;
    }
}

/* Стили для мобильной версии реквизитов */
.requisites-mobile {
    margin: 20px 0;
    padding: 25px;
    background: var(--light);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.req-item {
    margin-bottom: 20px;
}

.req-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.req-value {
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    word-break: break-word;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
    line-height: 1.4;
}

.req-value:hover {
    background: #e2e8f0;
}

.req-value:active {
    background: #cbd5e1;
}

.req-value a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.req-value a:hover {
    text-decoration: underline;
}

.req-hint {
    font-size: 0.8rem;
    color: var(--gray);
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    background: #fff3cd;
    border-radius: 6px;
    border: 1px solid #ffeaa7;
}

/* Стили для печати документов */
@media print {
    /* Скрываем элементы, не нужные для печати */
    .header,
    .mobile-menu,
    .print-button,
    .back-link,
    .toc,
    .req-hint,
    .mobile-menu-toggle,
    .nav-menu,
    .header-actions,
    footer {
        display: none !important;
    }
    
    /* Базовые настройки печати */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body {
        background: white !important;
        color: black !important;
        font-family: "Times New Roman", serif !important;
        font-size: 12pt !important;
        line-height: 1.4 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Настройки страницы */
    @page {
        size: A4;
        margin: 2cm 1.5cm;
    }
    
    /* Контейнер документа */
    .document {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    /* Заголовки */
    .document h1 {
        font-size: 16pt !important;
        font-weight: bold !important;
        text-align: center !important;
        margin-bottom: 12pt !important;
        page-break-after: avoid;
    }
    
    .document h2 {
        font-size: 14pt !important;
        font-weight: bold !important;
        margin-top: 18pt !important;
        margin-bottom: 6pt !important;
        page-break-after: avoid;
    }
    
    .document h3 {
        font-size: 12pt !important;
        font-weight: bold !important;
        margin-top: 12pt !important;
        margin-bottom: 6pt !important;
        page-break-after: avoid;
    }
    
    /* Параграфы */
    .document p {
        margin-bottom: 6pt !important;
        text-align: justify !important;
        orphans: 2;
        widows: 2;
    }
    
    /* Списки */
    .document ul,
    .document ol {
        margin: 6pt 0 !important;
        padding-left: 18pt !important;
    }
    
    .document li {
        margin-bottom: 3pt !important;
        orphans: 2;
        widows: 2;
    }
    
    /* Таблицы */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 12pt 0 !important;
        page-break-inside: avoid;
    }
    
    th, td {
        border: 1pt solid black !important;
        padding: 6pt !important;
        font-size: 10pt !important;
        text-align: left !important;
    }
    
    th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
    }
    
    /* Реквизиты для печати - исправление для десктопа */
    .requisites dl,
    .requisites .requisites-grid,
    .requisites-mobile {
        display: block !important;
        border: 1pt solid black !important;
        margin: 12pt 0 !important;
        padding: 0 !important;
        background: white !important;
        page-break-inside: avoid;
        width: 100% !important;
    }
    
    .requisites dt,
    .requisites dd,
    .req-item {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        page-break-inside: avoid;
    }
    
    .requisites dt,
    .req-label {
        background: #f8f8f8 !important;
        font-weight: bold !important;
        padding: 6pt !important;
        border-bottom: 1pt solid black !important;
        border-top: 1pt solid black !important;
        margin: 0 !important;
    }
    
    .requisites dt:first-of-type {
        border-top: none !important;
    }
    
    .requisites dd,
    .req-value {
        background: white !important;
        padding: 6pt !important;
        border-bottom: 1pt solid black !important;
        margin: 0 !important;
        cursor: default !important;
        word-wrap: break-word !important;
        white-space: normal !important;
    }
    
    .req-item:first-child .req-label {
        border-top: none !important;
    }
    
    /* Мета-информация */
    .document-meta {
        display: flex !important;
        justify-content: space-between !important;
        margin: 12pt 0 !important;
        font-size: 10pt !important;
    }
    
    .version-info {
        font-size: 10pt !important;
        margin: 6pt 0 !important;
    }
    
    /* Подпись */
    .signature-block {
        margin-top: 24pt !important;
        padding-top: 12pt !important;
        border-top: 1pt solid black !important;
        page-break-inside: avoid;
    }
    
    /* Информационные блоки */
    .important-box,
    .info-box {
        border: 1pt solid black !important;
        padding: 6pt !important;
        margin: 12pt 0 !important;
        background: #f8f8f8 !important;
        page-break-inside: avoid;
    }
    
    /* Контактные данные */
    .contact-box {
        border: 1pt solid black !important;
        padding: 12pt !important;
        margin: 12pt 0 !important;
        background: white !important;
        text-align: center !important;
        page-break-inside: avoid;
    }
    
    /* Ссылки */
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    /* Предотвращение разрыва страниц */
    .document-header {
        page-break-after: avoid;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    /* Убираем фоновые изображения и эффекты */
    * {
        background-image: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        filter: none !important;
        -webkit-filter: none !important;
    }
    
    /* Дополнительные настройки для лучшей печати */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    /* Настройки для длинных URL */
    a[href^="http"]:after {
        word-wrap: break-word;
        word-break: break-all;
    }
    
    /* Настройки для содержания (если TOC не скрыто) */
    .toc {
        page-break-after: always;
    }
    
    
    /* Номера страниц */
    @page {
        @bottom-center {
            content: "Страница " counter(page) " из " counter(pages);
            font-size: 10pt;
            color: #666;
        }
    }
}