/* شريط السلة فالموبايل فوق الـ bottom-nav */
#mobile-cart-bar {
  position: fixed; left: 8px; right: 8px; bottom: 60px;
  background: linear-gradient(to right, #fecb56, #fba833);
  color:#422100; font-weight:700; padding: .9rem 1rem;
  border-radius: 16px; box-shadow: 0 -2px 6px rgba(0,0,0,.2);
  display:flex; align-items:center; justify-content:space-between;
  transform: translateY(100%); opacity:0; pointer-events:none;
  transition: all .35s ease;
  z-index: 1041;
}
#mobile-cart-bar.show { transform: translateY(0); opacity:1; pointer-events:auto; z-index: 1031;}
#mobile-cart-bar .btn-view-cart{ background:#239e6b; color:#fff; border-radius:30px; padding:.6rem 1.25rem; }

/* عناصر السلة */
.cart-item img{ width:100px; height:100px; border-radius:8px; object-fit:cover; }
.subtotal-text{ min-width: 90px; text-align: end; }

/* أزرار دائرية بسيطة باستعمال Bootstrap */
.btn-round { width:34px; height:34px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size: 16px; font-weight: 700;}

/* خلي السلة ديما فاليمين مهما كان dir=rtl أو ltr */
.offcanvas-fixed-right{
  left: auto !important;
  right: 0 !important;
  transform: translateX(100%);          /* خارج الشاشة يمين */
}
.offcanvas-fixed-right.show,
.offcanvas-fixed-right[aria-modal="true"]{
  transform: none;                      /* تدخل للشاشة */
}

/* اختياري: ضمن العرض */
@media (min-width: 992px){
  .offcanvas-fixed-right{ width: 380px; }
}

#clear-cart{
  padding: 4px 8px;
  border-radius: 6px;
}
#clear-cart:hover{
  background-color: #dc3545;
  color: white;
}

.modal-content {
  border-radius: 12px;
}
.modal-header {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* ===== Mobile Bottom-Sheet with smooth animation ===== */
#mobile-cart-overlay{
  position:fixed; inset:0; z-index:11000;
  opacity:0; visibility:hidden; pointer-events:none;
  transition: opacity .3s ease;
}
#mobile-cart-overlay.open{ opacity:1; visibility:visible; pointer-events:auto; }

/* الخلفية */
.mobile-cart-backdrop{ position:absolute; inset:0; background:rgba(0,0,0,.35); opacity:0; transition:opacity .3s; }

#mobile-cart-overlay.open .mobile-cart-backdrop{ opacity: 1; }

/* الشيت */
.mobile-cart-sheet{
  display:flex; flex-direction:column;
  position:absolute; left:50%; bottom:0;
  transform: translateX(-50%) translateY(100%);
  width:99%; height:89dvh;
  max-width: none; max-height: none;
  background:#fff; border-radius:16px 16px 0 0;
  box-shadow:0 -8px 24px rgba(0,0,0,.25);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  overflow:hidden;
  z-index: 1050;
  /* مسافات داخلية عامة */
  padding: 14px 14px 0;
}
#mobile-cart-overlay.open .mobile-cart-sheet{ transform: translateX(-50%) translateY(0); }




/* المحتوى القابل للسكرول */
.sheet-body{
  flex:1 1 auto;
  overflow:auto;
  /* 120px تقريباً (علو الفوتر + مارچن بسيط) */
  max-height: calc(85vh - 120px);
  padding-right: 4px;
}

.sheet-footer{
  flex:0 0 auto;
  position: sticky; bottom: 0;
  background:#fff;
  padding: 6px 0 30px;
  border-top: 1px solid #eee;
}
/* ديسكتوب: مخفي */
@media (min-width: 992px){
  #mobile-cart-overlay{ opacity:0 !important; visibility:hidden !important; pointer-events:none !important; }
}

.sheet-actions {
  padding-top: 16px;   /* زيد/نقص على حساب رغبتك */
  padding-bottom: 20px; /* زيد/نقص على حساب رغبتك */
}

/* خلي الـ body ديال الأوفكانفاس عمودياً بارتفاع كامل */
#cartOffcanvas .offcanvas-body{ display:flex; flex-direction:column; height:100%; }

/* لائحة العناصر كتسكرول بوحدها */
#cartOffcanvas .cart-scroll{ overflow:auto; }

/* الفوتر ديما باين تحت */
#cartOffcanvas .cart-footer{
  position: sticky; bottom: 0;
  background: #fff;
  padding-bottom: .5rem;
  box-shadow: 0 -6px 12px rgba(0,0,0,.06);
}

/* إخفاء السكرول فكل المتصفحات */
.cart-scroll, 
.sheet-body {
  scrollbar-width: none; /* Firefox */
}

.cart-scroll::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar {
  display: none; /* Chrome, Edge, Safari */
}

#cart-toggle-footer {
  display: none !important;
}
