/* ==========================================================================
   legal.css — страницы правовых документов
   ========================================================================== */

:root {
  --legal-red: #b22222;
  --legal-red-dark: #8b0000;
  --legal-ink: #222222;
  --legal-muted: #6b6b6b;
  --legal-line: #e5e5e5;
  --legal-bg: #f3f3f3;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.legal-body {
  min-width: 320px;
  margin: 0;
  padding: 0;
  color: var(--legal-ink);
  background: var(--legal-bg);
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

.legal-body img {
  max-width: 100%;
  border: 0;
}

.legal-body a {
  color: var(--legal-red);
}

.legal-body a:hover {
  color: var(--legal-red-dark);
}

.legal-header {
  color: #ffffff;
  background: #111111;
}

.legal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 13px 24px;
}

.legal-header__logo {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  background: #ffffff;
  border-radius: 8px;
  line-height: 0;
  text-decoration: none;
}

.legal-header__logo img {
  display: block;
  width: auto;
  height: 38px;
}

.legal-header__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.legal-header__link {
  color: #d7d7d7;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-header__link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.legal-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 28px;
  align-items: start;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 34px 24px 60px;
}

.legal-doc {
  min-width: 0;
  padding: 46px 54px 50px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.legal-doc__eyebrow {
  margin: 0 0 10px;
  color: var(--legal-red);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-doc h1 {
  margin: 0 0 12px;
  color: #111111;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
}

.legal-doc__meta {
  margin: 0 0 30px;
  padding: 0 0 20px;
  color: var(--legal-muted);
  font-size: 14px;
  border-bottom: 1px solid var(--legal-line);
}

.legal-doc h2 {
  margin: 38px 0 14px;
  color: #111111;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
}

.legal-doc h3 {
  margin: 26px 0 10px;
  color: #111111;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.legal-doc p {
  margin: 0 0 14px;
}

.legal-doc p:last-child {
  margin-bottom: 0;
}

.legal-doc ul,
.legal-doc ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

.legal-doc ul {
  list-style: disc;
}

.legal-doc ol {
  list-style: decimal;
}

.legal-doc li {
  margin: 0 0 8px;
  padding-left: 2px;
}

.legal-doc li:last-child {
  margin-bottom: 0;
}

.legal-doc strong {
  color: #111111;
  font-weight: 700;
}

.legal-doc a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-doc a:hover {
  text-decoration-thickness: 2px;
}

.legal-table-wrap {
  width: 100%;
  margin: 18px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--legal-line);
  border-radius: 8px;
}

.legal-doc table {
  width: 100%;
  min-width: 620px;
  margin: 0;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.legal-doc th,
.legal-doc td {
  padding: 11px 14px;
  vertical-align: top;
  text-align: left;
  border-right: 1px solid var(--legal-line);
  border-bottom: 1px solid var(--legal-line);
}

.legal-doc th:last-child,
.legal-doc td:last-child {
  border-right: 0;
}

.legal-doc tr:last-child td,
.legal-doc tr:last-child th {
  border-bottom: 0;
}

.legal-doc thead th {
  color: #ffffff;
  background: var(--legal-red);
  font-weight: 600;
}

.legal-doc tbody th {
  width: 34%;
  background: #fafafa;
  font-weight: 600;
}

.legal-note {
  margin: 22px 0;
  padding: 15px 18px;
  background: #fff6f6;
  border-left: 4px solid var(--legal-red);
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
}

.legal-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 16px;
  color: var(--legal-red) !important;
  background: #fff6f6;
  border: 1px solid rgba(178, 34, 34, 0.25);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.legal-download:hover {
  background: #ffecec;
  border-color: var(--legal-red);
}

.legal-aside {
  position: sticky;
  top: 20px;
  padding: 22px 20px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.legal-aside__title {
  margin: 0 0 12px;
  color: var(--legal-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legal-aside__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-aside__link {
  display: block;
  padding: 10px 12px;
  color: #333333;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.legal-aside__link:hover {
  color: var(--legal-red);
  background: #f7f7f7;
}

.legal-aside__link[aria-current="page"] {
  color: #ffffff;
  background: var(--legal-red);
}

.legal-aside__link[aria-current="page"]:hover {
  color: #ffffff;
  background: var(--legal-red-dark);
}

.legal-aside__settings {
  width: 100%;
  margin-top: 14px;
  padding: 11px 12px;
  color: var(--legal-red);
  background: #fff6f6;
  border: 1px solid rgba(178, 34, 34, 0.25);
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.legal-aside__settings:hover {
  background: #ffecec;
  border-color: var(--legal-red);
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  padding: 26px 24px;
  color: #aaaaaa;
  background: #111111;
  font-size: 13.5px;
}

.legal-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
}

.legal-footer p {
  margin: 0;
}

.legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
}

.legal-footer a,
.legal-footer .tcs-cookie-settings {
  color: #cccccc;
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal-footer a:hover,
.legal-footer .tcs-cookie-settings:hover {
  color: #ffffff;
  text-decoration: underline;
}

@media (max-width: 960px) {
  .legal-main {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 24px;
  }

  .legal-aside {
    position: static;
    order: 2;
  }

  .legal-aside__nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .legal-header__inner {
    padding: 11px 16px;
  }

  .legal-header__logo img {
    height: 32px;
  }

  .legal-header__nav {
    gap: 14px;
  }

  .legal-header__link {
    font-size: 13px;
  }

  .legal-main {
    gap: 18px;
    padding: 18px 14px 40px;
  }

  .legal-doc {
    padding: 28px 20px 32px;
    border-radius: 10px;
  }

  .legal-doc h1 {
    font-size: 26px;
  }

  .legal-doc h2 {
    margin-top: 30px;
    font-size: 20px;
  }

  .legal-doc h3 {
    font-size: 17px;
  }

  .legal-doc__meta {
    margin-bottom: 24px;
    padding-bottom: 16px;
  }

  .legal-aside {
    padding: 18px 16px;
    border-radius: 10px;
  }

  .legal-aside__nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-footer {
    padding: 22px 16px;
  }

  .legal-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .legal-header__nav .legal-header__link:first-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .legal-body *,
  .legal-body *::before,
  .legal-body *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  body.legal-body {
    background: #ffffff;
  }

  .legal-header,
  .legal-aside,
  .legal-footer,
  #cookie-notification {
    display: none !important;
  }

  .legal-main {
    display: block;
    max-width: none;
    padding: 0;
  }

  .legal-doc {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .legal-doc a {
    color: #000000;
  }

  .legal-table-wrap {
    overflow: visible;
  }

  .legal-doc table {
    min-width: 0;
  }
}
