/* ============================================
   الصفحات القانونية (شروط، خصوصية، استرجاع)
   ✅ تصميم One UI أنيق + قابل للقراءة
   ============================================ */

/* ✅ إصلاح ارتفاع الصفحة (تجاوز common.css) */
html:has(body.legal-page) {
  height: auto !important;
  min-height: 100vh !important;
  overflow-y: auto !important;
}

body.legal-page {
  height: auto !important;
  min-height: 100vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #f5f5f5;
  padding: 20px 16px 40px;
  margin: 0;
  direction: inherit;
  box-sizing: border-box;
  display: block;
}

.legal-wrapper {
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

/* ══════════════════════════════════════════
   رأس الصفحة
   ══════════════════════════════════════════ */
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.legal-back {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #171717;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.legal-back:hover {
  background: #e5e5e5;
  transform: scale(1.05);
}

.legal-back i {
  font-size: 15px;
}

[dir="rtl"] .legal-back i {
  transform: scaleX(-1);
}

.legal-title {
  flex: 1;
  font-size: 20px;
  font-weight: 800;
  color: #171717;
  margin: 0;
  text-align: center;
}

.legal-spacer {
  width: 40px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   التاريخ
   ══════════════════════════════════════════ */
.legal-meta {
  padding: 16px 24px 0;
}

.legal-meta p {
  font-size: 13px;
  color: #a3a3a3;
  margin: 0;
  font-style: italic;
  text-align: start;
}

/* ══════════════════════════════════════════
   المحتوى
   ══════════════════════════════════════════ */
.legal-content {
  padding: 16px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ══════════════════════════════════════════
   قسم
   ══════════════════════════════════════════ */
.legal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-section h2 {
  font-size: 16px;
  font-weight: 800;
  color: #171717;
  margin: 0;
  text-align: start;
  line-height: 1.4;
}

.legal-section p {
  font-size: 15px;
  color: #404040;
  line-height: 1.8;
  margin: 0;
  text-align: start;
}

.legal-section ul {
  margin: 0;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legal-section li {
  font-size: 15px;
  color: #404040;
  line-height: 1.7;
  text-align: start;
}

.legal-section a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}

.legal-section a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

/* ══════════════════════════════════════════
   الفوتر
   ══════════════════════════════════════════ */
.legal-footer {
  padding: 20px 24px 24px;
  border-top: 1px solid #f0f0f0;
  text-align: center;
}

.legal-footer p {
  font-size: 13px;
  color: #a3a3a3;
  margin: 0;
}

/* ══════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════ */
@media (max-width: 480px) {
  body.legal-page {
    padding: 12px 8px 32px;
  }

  .legal-wrapper {
    border-radius: 20px;
  }

  .legal-header {
    padding: 16px 18px;
  }

  .legal-title {
    font-size: 18px;
  }

  .legal-meta {
    padding: 14px 18px 0;
  }

  .legal-content {
    padding: 14px 18px 24px;
    gap: 24px;
  }

  .legal-section h2 {
    font-size: 15px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 14px;
    line-height: 1.75;
  }

  .legal-footer {
    padding: 16px 18px 20px;
  }
}