/* Shared layout for the privacy policy and terms pages. */
:root {
    --primary: #7C3AED;
    --primary-light: #8B5CF6;
    --primary-dark: #6D28D9;
    --secondary: #EC4899;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--white);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.main-container {
    margin-top: 72px;
    display: flex;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
    gap: 60px;
    min-height: calc(100vh - 72px);
}
.sidebar-content:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}
.toc-item {
    margin-bottom: 8px;
}
.toc-link {
    display: block;
    padding: 8px 12px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
}
.toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}
.toc-link:hover {
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary);
    padding-left: 20px;
}
.toc-link:hover::before {
    transform: translateX(0);
}
.toc-link.active {
    background: var(--primary);
    color: var(--white);
}
.toc-link.active::before {
    transform: translateX(0);
}
.content {
    flex: 1;
    padding: 40px 0;
    max-width: none;
}
.content-header {
    margin-bottom: 48px;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 16px;
}
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}
.page-title {
    font-size: 48px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 16px;
    line-height: 1.1;
}
.page-subtitle {
    font-size: 20px;
    color: var(--gray-600);
    margin-bottom: 8px;
}
.last-updated {
    font-size: 14px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    display: inline-block;
}
.article-section {
    margin-bottom: 48px;
    scroll-margin-top: 120px;
}
.article-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}
.article-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 32px 0 16px 0;
}
.article-section p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 16px;
}
.article-section ul {
    margin: 16px 0;
    padding-left: 20px;
}
.article-section li {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 8px;
}
.article-section strong {
    color: var(--gray-900);
    font-weight: 600;
}
.article-section em {
    color: var(--primary);
    font-style: normal;
    font-weight: 500;
}
.contact-card {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
    border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin: 48px 0;
}
.contact-card h3 {
    color: var(--primary);
    margin-bottom: 16px;
}
.contact-value a {
    color: var(--primary);
    text-decoration: none;
}
.mobile-toc {
    display: none;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 10px;
    margin-bottom: 32px;
    margin-top: 32px;
    overflow: hidden;
}
.mobile-toc-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    transition: color 0.2s ease;
}
.mobile-toc-toggle svg {
    transition: transform 0.3s ease;
}
.mobile-toc-toggle.active {
    color: var(--primary);
}
.mobile-toc-toggle.active svg {
    transform: rotate(180deg);
}
.mobile-toc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.mobile-toc-content.show {
    max-height: 600px;
    padding-top: 16px;
}
.mobile-toc-content .toc-list {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 12px;
}
.mobile-toc-content .toc-item {
    margin-bottom: 4px;
}
.mobile-toc-content .toc-link {
    padding: 10px 14px;
    font-size: 15px;
}
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        gap: 0;
    }
    .mobile-toc {
        display: block;
    }
    .content {
        padding: 0 0 40px 0;
    }
    .page-title {
        font-size: 36px;
    }
}
@media (max-width: 768px) {
    .page-title {
        font-size: 28px;
    }
    .article-section h2 {
        font-size: 24px;
    }
}
/* Privacy-policy-specific layout. */
body.legal-page--privacy .sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 40px 0;
    position: sticky;
    top: 112px;
    height: fit-content;
}
body.legal-page--privacy .sidebar-content {
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.3s ease;
}
body.legal-page--privacy .sidebar h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
}
body.legal-page--privacy .toc-list {
    list-style: none;
}
body.legal-page--privacy .contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}
body.legal-page--privacy .contact-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}
body.legal-page--privacy .contact-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
body.legal-page--privacy .contact-value {
    font-size: 16px;
    color: var(--gray-900);
}
@media (max-width: 1024px) {
    body.legal-page--privacy .sidebar {
        position: relative;
        width: 100%;
        top: 0;
        padding: 20px 0;
        display: none;
    }
}
@media (max-width: 768px) {
    body.legal-page--privacy .contact-info {
        grid-template-columns: 1fr;
    }
}
/* Terms-specific layout. */
body.legal-page--terms .sidebar {
    width: 280px;
    flex-shrink: 0;
    padding: 80px 0px 80px 0px;
    /* Классическое sticky поведение */
    position: sticky;
    top: 30px;
    /* 72px (header) + 20px (отступ) */
    height: fit-content;
    align-self: start;
}
body.legal-page--terms .sidebar-content {
    background: var(--gray-50);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 132px);
    /* Ограничиваем высоту для корректной работы скролла */
}
body.legal-page--terms .sidebar h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 16px;
    flex-shrink: 0;
}
body.legal-page--terms .toc-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    margin-right: -8px;
    padding-right: 8px;
}
body.legal-page--terms .toc-list::-webkit-scrollbar {
    width: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}
body.legal-page--terms .sidebar-content:hover .toc-list::-webkit-scrollbar {
    opacity: 1;
}
body.legal-page--terms .toc-list::-webkit-scrollbar-track {
    background: transparent;
}
body.legal-page--terms .toc-list::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 2px;
    transition: background 0.2s;
}
body.legal-page--terms .sidebar-content:hover .toc-list::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
}
body.legal-page--terms .toc-list::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}
body.legal-page--terms .toc-list {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
body.legal-page--terms .sidebar-content:hover .toc-list {
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}
body.legal-page--terms .notice-card {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin: 32px 0;
}
body.legal-page--terms .notice-card p {
    margin: 0;
    color: var(--gray-900);
    font-weight: 500;
}
body.legal-page--terms .contact-info {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
body.legal-page--terms .contact-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-bottom: 1px solid var(--gray-200);
}
body.legal-page--terms .contact-row:last-child {
    border-bottom: none;
}
body.legal-page--terms .contact-label {
    padding: 20px;
    background: var(--gray-50);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid var(--gray-200);
}
body.legal-page--terms .contact-value {
    padding: 20px;
    font-size: 16px;
    color: var(--gray-900);
    display: flex;
    align-items: center;
}
body.legal-page--terms .contact-value a:hover {
    text-decoration: underline;
}
@media (max-width: 1024px) {
    body.legal-page--terms .sidebar {
        position: relative;
        top: auto;
        width: 100%;
        padding: 20px 0;
        display: none;
        height: auto;
    }
}
@media (max-width: 768px) {
    body.legal-page--terms .contact-row {
        grid-template-columns: 1fr;
    }
    body.legal-page--terms .contact-label {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
}
