.asp-popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.45);
  z-index: 99999;
  align-items: stretch;
  justify-content: flex-end;
  transition: opacity .25s ease;
  opacity: 0;
}

.asp-popup.left { justify-content: flex-start; }

.asp-popup.asp-show {
  display: flex;
  opacity: 1;
  animation: asp-fadein 0.3s ease forwards;
}

.asp-popup-content {
  width: 420px;
  max-width: 90%;
  height: calc(100% - 40px);
  margin: 20px 0;
  position: relative;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow .3s ease, opacity .3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  overflow-y: auto;
  border-radius: 12px 0 0 12px;
  opacity: 0;
  background: #fff;
}

/* ✅ عند الفتح من اليسار */
.asp-popup.left .asp-popup-content {
  transform: translateX(-100%);
  border-radius: 0 12px 12px 0;
  box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  direction: rtl;               /* يجعل شريط التمرير على اليسار */
  text-align: left;             /* يعيد النصوص للاتجاه الطبيعي */
}

/* ✅ عند تفعيل النافذة */
.asp-popup.asp-show.right .asp-popup-content {
  transform: translateX(0);
  opacity: 1;
  animation: asp-slidein-right 0.35s ease forwards;
}

.asp-popup.asp-show.left .asp-popup-content {
  transform: translateX(0);
  opacity: 1;
  animation: asp-slidein-left 0.35s ease forwards;
}

/* زر الإغلاق */
.asp-close {
  position: absolute;
  top: 14px;
  left: 14px;
  background: transparent;
  border: none;
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}
.asp-close:hover { color: #e74c3c; }

/* المحتوى الداخلي */
.asp-inner { padding: 60px 20px 20px; }

/* ✅ أنيميشن اليمين */
@keyframes asp-slidein-right {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* ✅ أنيميشن اليسار */
@keyframes asp-slidein-left {
  0% { transform: translateX(-100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

/* خلفية عند الظهور */
@keyframes asp-fadein {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* ✅ شريط تمرير مخصص */
.asp-popup-content::-webkit-scrollbar {
  width: 8px;
}
.asp-popup-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.asp-popup-content::-webkit-scrollbar-thumb {
  background: #aaa;
  border-radius: 10px;
}
.asp-popup-content::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* ✅ تحسين العرض على الجوال */
@media(max-width:768px){
  .asp-popup-content {
    width: calc(100% - 20px);
    margin: 10px;
    height: calc(100% - 20px);
  }
}
