/* ─── Legal Pages (Privacy, Oferta, Cookie) ────────────────────────────────── */

.legal-section { background: var(--white); }

.legal-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 0 60px;
}

.legal-date {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 24px;
  padding: 10px 16px;
  background: var(--gray-100);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.legal-intro {
  font-size: 1.05rem;
  color: var(--dark);
  line-height: 1.7;
  margin-bottom: 40px;
  padding: 24px;
  background: var(--gray-100);
  border-radius: var(--radius);
}

.legal-intro p { margin: 0 0 10px; }
.legal-intro p:last-child { margin-bottom: 0; }

.legal-content { color: var(--dark); }

.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  margin: 40px 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content p {
  line-height: 1.75;
  color: var(--text-light);
  margin: 0 0 14px;
}

.legal-content ul {
  padding-left: 20px;
  margin: 0 0 16px;
}

.legal-content ul li {
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 6px;
}

.legal-content ul li::marker { color: var(--accent); }

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
}
.legal-content a:hover { color: var(--accent); }

/* Реквизиты в оферте */
.legal-requisites {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 8px;
}
.legal-requisites p {
  margin: 0 0 8px;
  color: var(--dark) !important;
}
.legal-requisites p:last-child { margin-bottom: 0; }

/* Таблица Cookie */
.legal-table-wrap { overflow-x: auto; margin: 0 0 24px; }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.legal-table th {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}
.legal-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
  color: var(--dark);
  vertical-align: top;
}
.legal-table tr:last-child td { border-bottom: none; }
.legal-table tr:nth-child(even) td { background: var(--gray-100); }


/* ─── Documents Page ─────────────────────────────────────────────────────────── */

.docs-section { background: var(--white); }

.docs-intro {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 720px;
  margin: 0 0 48px;
}

.docs-group { margin-bottom: 56px; }
.docs-group:last-child { margin-bottom: 0; }

.docs-group-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent);
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.doc-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: var(--radius);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.doc-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--gray-100);
  border-radius: 8px;
  color: var(--primary);
}
.doc-card__icon--jpg,
.doc-card__icon--jpeg,
.doc-card__icon--png  { color: #16a34a; }
.doc-card__icon--doc,
.doc-card__icon--docx { color: #2563eb; }

.doc-card__ext {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: inherit;
  text-transform: uppercase;
}

.doc-card__body {
  flex: 1;
  min-width: 0;
}

.doc-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0 0 4px;
  line-height: 1.4;
}

.doc-card__desc {
  font-size: 0.84rem;
  color: var(--text-light);
  margin: 0 0 6px;
  line-height: 1.5;
}

.doc-card__date {
  font-size: 0.8rem;
  color: var(--text-light);
  opacity: 0.8;
}

.doc-card__dl {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff !important;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
  min-height: 44px;
  align-self: center;
}
.doc-card__dl:hover { background: var(--accent); color: #fff !important; }

/* Empty state (shared) */
.docs-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}
.docs-empty svg {
  display: block;
  margin: 0 auto 16px;
  opacity: 0.35;
}
.docs-empty p {
  font-size: 1rem;
  margin: 0 0 20px;
  color: var(--text-light);
}


/* ─── Licenses Page ──────────────────────────────────────────────────────────── */

.lic-section  { background: var(--white); }

.lic-intro {
  font-size: 1.05rem;
  color: var(--text-light);
  line-height: 1.7;
  max-width: 720px;
  margin: 0 0 48px;
}

.lic-group { margin-bottom: 56px; }
.lic-group:last-child { margin-bottom: 0; }

.lic-group-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent);
}

.lic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* Карточка — это <button> для a11y */
.lic-card {
  background: none;
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.lic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.lic-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lic-card__img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--gray-100);
}

.lic-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.lic-card:hover .lic-card__img { transform: scale(1.04); }

.lic-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.lic-card:hover .lic-card__overlay {
  opacity: 1;
  background: rgba(0,0,0,0.35);
}

.lic-card__body {
  padding: 14px 16px;
  flex: 1;
}

.lic-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0 0 4px;
  line-height: 1.4;
}

.lic-card__meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin: 0 0 2px;
}


/* ─── Лайтбокс ───────────────────────────────────────────────────────────────── */

.lic-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lic-lightbox[hidden] { display: none; }

.lic-lb-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  cursor: zoom-out;
}

.lic-lb-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
  gap: 12px;
}

.lic-lb-img {
  max-width: 80vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lic-lb-caption { text-align: center; color: #fff; }
.lic-lb-title { font-size: 1rem; font-weight: 600; margin: 0 0 4px; }
.lic-lb-desc  { font-size: 0.85rem; opacity: 0.75; margin: 0; }

.lic-lb-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.lic-lb-close:hover { background: rgba(255,255,255,0.25); }
.lic-lb-close:focus-visible { outline: 2px solid var(--accent); }

.lic-lb-arr {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.lic-lb-arr:hover { background: rgba(255,255,255,0.25); }
.lic-lb-arr:focus-visible { outline: 2px solid var(--accent); }
.lic-lb-arr--prev { left: 16px; }
.lic-lb-arr--next { right: 16px; }


/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .docs-grid {
    grid-template-columns: 1fr;
  }
  .doc-card {
    flex-wrap: wrap;
  }
  .doc-card__dl {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
  .lic-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .lic-lb-arr--prev { left: 8px; }
  .lic-lb-arr--next { right: 8px; }
  .lic-lb-img { max-width: 96vw; }
}

@media (max-width: 480px) {
  .legal-wrap { padding: 0 0 40px; }
  .docs-group-title,
  .lic-group-title { font-size: 1.1rem; }
  .lic-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
