/* تنسيق الحاوية الرئيسية */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  font-family: inherit; /* يأخذ خط الموقع */
}

.faq-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
  font-weight: bold;
}

/* تنسيق عنصر السؤال الواحد */
.faq-item {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-item[open] {
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-color: #000; /* لون الحدود عند الفتح */
}

/* تنسيق رأس السؤال (Summary) */
.faq-question {
  list-style: none; /* إخفاء السهم الافتراضي */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  background-color: #f9f9f9;
  transition: background 0.2s;
}

.faq-question:hover {
  background-color: #f1f1f1;
}

/* إخفاء سهم المتصفح الافتراضي في كروم وسفاري */
.faq-question::-webkit-details-marker {
  display: none;
}

/* تنسيق الأيقونة (+ / -) */
.faq-icon {
  position: relative;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline-start: 10px; /* مسافة تلقائية حسب اللغة */
}

/* رسم علامة الزائد بالكود فقط */
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  background-color: #333;
  transition: transform 0.3s ease;
}

.faq-icon::before {
  width: 2px;
  height: 12px;
}

.faq-icon::after {
  width: 12px;
  height: 2px;
}

/* حركة الأيقونة عند الفتح (تتحول لعلامة ناقص) */
details[open] .faq-icon::before {
  transform: rotate(90deg); /* يخفي الخط العمودي */
}
/* إذا أردتها علامة X بدلاً من ناقص، اجعل الدوران 45deg للعمودي والافقي */

/* تنسيق الإجابة */
.faq-answer {
  padding: 0 20px 20px 20px;
  background-color: #fff;
  line-height: 1.6;
  color: #555;
  font-size: 15px;
  border-top: 1px solid transparent;
}

details[open] .faq-answer {
  border-top-color: #f0f0f0;
  padding-top: 15px;
  animation: fadeIn 0.4s ease-in-out;
}

/* تأثير ظهور ناعم للإجابة */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}