/* ===========================
   Digibaby Quick Cart (RTL)
   Modern UI — no JS changes
   =========================== */

/* کمک به یکپارچگی رنگ‌بندی (با کلاس‌های فعلی مثل bg-Black, bg-White, bg-button) */
:root{
  --dg-radius: 14px;
  --dg-radius-sm: 10px;
  --dg-border: rgba(0,0,0,.08);
  --dg-shadow: 0 14px 45px rgba(0,0,0,.12);
  --dg-shadow-soft: 0 8px 25px rgba(0,0,0,.10);
  --dg-text: rgba(0,0,0,.85);
  --dg-muted: rgba(0,0,0,.55);
  --dg-danger: #e11d48;
  --dg-success: #16a34a;
  --dg-bg: #fff;
}

/* اسکرول بار ظریف */
.shopping-cart-holder ::-webkit-scrollbar { width: 6px; }
.shopping-cart-holder ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 999px; }
.shopping-cart-holder ::-webkit-scrollbar-track { background: rgba(0,0,0,.06); border-radius: 999px; }

/* آیکن سبد (کلیک) */
.cart-dgbaby{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  transition: transform .15s ease, box-shadow .2s ease;
}
.cart-dgbaby:hover{
  transform: translateY(-1px);
  box-shadow: var(--dg-shadow-soft);
}

/* شمارنده (counter) */
span.counterCardMenu{
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  top: -10px;
  right: -10px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  border: 2px solid rgba(255,255,255,.9);
}

/* هولدر اصلی (Dropdown) */
.shopping-cart-holder{
  left: 0;
  top: calc(100% + 10px);
  z-index: 50;

  width: min(420px, 92vw);
  border-radius: var(--dg-radius);
  background: var(--dg-bg);
  border: 1px solid var(--dg-border);

  overflow: hidden;

  /* حالت بسته */
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px) scale(.98);
  pointer-events: none;

  transition: max-height .35s ease, opacity .2s ease, transform .25s ease;
  box-shadow: var(--dg-shadow);
}

/* حالت باز (JS فقط کلاس active می‌زند) */
.shopping-cart-holder.active{
  max-height: 34rem;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* محتوای داخلی */
.shopping-cart{
  padding: 14px 14px 12px 14px !important;
}

/* هدر */
.shopping-cart-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
}

.shopping-cart-header .cart-count{
  font-size: 13px;
  font-weight: 800;
  color: var(--dg-text);
  background: rgba(0,0,0,.05);
  padding: 6px 10px;
  border-radius: 999px;
}

.shopping-cart-header .viewcart{
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  color: var(--dg-text);
  opacity: .9;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.8);
  transition: background .15s ease, transform .15s ease;
}
.shopping-cart-header .viewcart:hover{
  background: rgba(0,0,0,.04);
  transform: translateY(-1px);
}

.shopping-cart-holder hr{
  margin: 0;
  padding: 0;
  border: 0;
  height: 1px;
  background: rgba(0,0,0,.06);
}

/* لیست آیتم‌ها */
.shopping-cart-items{
  margin: 0;
  padding: 10px 0 0 0;
  list-style: none;

  max-height: 19.5rem;
  overflow: auto;
}

/* آیتم */
.shopping-cart-items li{
  list-style: none;
  padding: 10px 8px;
  border-radius: var(--dg-radius-sm);
  transition: background .15s ease;
}
.shopping-cart-items li:hover{
  background: rgba(0,0,0,.03);
}

/* تصویر */
.shopping-cart-list-item-image a{
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(0,0,0,.02);
}
.shopping-cart-list-item-image img{
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* عنوان و لینک */
.shopping-cart-list-item-title a{
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  overflow: hidden;
  text-decoration: none;
  color: var(--dg-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

/* فوتر آیتم: تعداد + حذف */
.shopping-cart-list-item-footer{
  margin-top: 6px;
}

.shopping-cart-list-item-props-item{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dg-muted);
  background: rgba(0,0,0,.05);
  padding: 6px 10px;
  border-radius: 999px;
}

/* دکمه حذف */
.delete-product-hover-cart{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 34px;
  height: 34px;
  border-radius: 12px;

  background: rgba(225, 29, 72, .10);
  border: 1px solid rgba(225, 29, 72, .20);

  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  cursor: pointer;
}
.delete-product-hover-cart:hover{
  background: rgba(225, 29, 72, .14);
  border-color: rgba(225, 29, 72, .30);
  transform: translateY(-1px);
}

/* آیکن سطل (ماسک SVG موجود) */
.shopping-cart-recyclebin{
  -webkit-mask: url(icon/RecycleBin.svg) no-repeat 50% 50%;
  mask: url(icon/RecycleBin.svg) no-repeat 50% 50%;
  -webkit-mask-size: 18px 18px;
  mask-size: 18px 18px;

  background-color: var(--dg-danger);
  width: 18px;
  height: 18px;
  display: inline-block;
}

/* فوتر کلی: جمع + دکمه ثبت سفارش */
.shopping-cart-footer{
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(0,0,0,.06);
}

.shopping-cart-total .lighter-text{
  font-size: 12.5px;
  font-weight: 800;
  color: var(--dg-muted);
}

.shopping-cart-info-total-amount-number{
  font-size: 14px;
  font-weight: 900;
  color: var(--dg-text);
}

/* دکمه CTA (با کلاس‌های فعلی bg-button و ... هم سازگار است) */
.shopping-cart-info-submit{
  border-radius: 14px !important;
  font-weight: 900;
  letter-spacing: .1px;
  transition: transform .15s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
  text-decoration: none;
}
.shopping-cart-info-submit:hover{
  transform: translateY(-1px);
  filter: brightness(0.98);
}

/* حالت سبد خالی */
.shopping-cart-holder p{
  margin: 0;
  padding: 18px 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--dg-muted);
  text-align: center;
  background: rgba(0,0,0,.02);
  border-radius: 14px;
}

/* Overlay (همان ایده قبلی، با کمی بهبود) */
body:has(.shopping-cart-holder) .dng-main:after{
  content: '';
  transition: opacity .25s ease;
  opacity: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: rgba(0,0,0,0.55);
  position: fixed;
  inset: 0;
}
body:has(.shopping-cart-holder.active) .dng-main:after{
  opacity: 1;
  z-index: 49;
}

/* ریسپانسیو */
@media (max-width: 768px){
  .shopping-cart-holder{
    width: min(520px, 96vw);
    top: calc(100% + 8px);
  }
  .shopping-cart-items{
    max-height: 18rem;
  }
}