/* شريط السلة فالموبايل فوق الـ 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;
  font-size: clamp(.9rem, .2vw + .85rem, 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{
  min-height: 42px;
  background:#239e6b;
  color:#fff;
  border-radius:30px;
  padding:.62rem 1.25rem;
  font-size: .92rem;
}

/* عناصر السلة */
.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:40px;
  height:40px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 19px;
  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;
}

/* ===== Options Bottom‑Sheet (مثل السلة فالموبايل) ===== */
#options-overlay{
  position:fixed; inset:0; z-index:11000;
  opacity:0; visibility:hidden; pointer-events:none;
  transition: opacity .3s ease;
}
#options-overlay.open{ opacity:1; visibility:visible; pointer-events:auto; }

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

/* الشيت */
.options-sheet{
  display:flex; flex-direction:column;
  position:absolute; left:50%; bottom:0;
  transform:translate(-50%, 100%);
  width:min(520px, calc(100% - 16px));
  max-height: 85vh;
  background:#fff;
  border-radius: 20px 20px 0 0;
  padding: 12px 12px 14px;
  box-shadow: 0 -20px 50px rgba(0,0,0,.22);
  transition: transform .3s ease;
}
#options-overlay.open .options-sheet{ transform:translate(-50%, 0); }

/* خيارات المنتج (قائمة) */
.opt-product-img{
  width:54px; height:54px;
  border-radius:12px; object-fit:cover;
}
.opt-list{ display:flex; flex-direction:column; gap:10px; }
.opt-item{
  display:flex; align-items:center; justify-content:space-between;
  width:100%;
  border:1px solid #eee;
  border-radius:14px;
  padding: 12px;
  background:#fff;
  text-align: start;
}
.opt-left{ display:flex; flex-direction:column; gap:2px; }
.opt-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.opt-add-btn{
  min-height: 40px;
  border-radius: 12px;
  padding-inline: 12px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .2px;
  white-space: nowrap;
}
.opt-qty{ min-width: 24px; text-align:center; font-weight:800; }
.opt-item:active{ transform: scale(.995); }
.opt-name{ font-weight:700; }
.opt-sub{ font-size: 18px; font-weight:800; color: #244b68;}

/* عناصر الخيارات بحال السلة */
.options-item{
  display:flex; gap:12px; align-items:flex-start;
  border:1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 10px;
}
.options-item img{
  width:90px; height:90px; object-fit:cover;
  border-radius: 10px; flex-shrink:0; background:#fff;
}

/* الأزرار ديما ملونين (ماشي غير وقت الضغط) */
button.add-to-cart,
a.add-to-cart,
button.options-btn,
a.options-btn,
button.opt-add-btn,
.btn-add{
  border:0 !important;
  border-radius: 14px !important;
  font-weight: 900 !important;
  letter-spacing: .2px;
  background: linear-gradient(90deg, var(--brand-2, #00a86b), var(--brand-3, #0ea5e9)) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 28px rgba(0,168,107,.22);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
button.add-to-cart:hover,
button.options-btn:hover,
button.opt-add-btn:hover,
.btn-add:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(0,168,107,.26);
}

@media (max-width: 420px){
  #mobile-cart-bar{
    left: 6px;
    right: 6px;
    bottom: 58px;
    padding: .78rem .86rem;
  }
  #mobile-cart-bar .btn-view-cart{
    min-height: 40px;
    padding: .54rem 1rem;
    font-size: .87rem;
  }
  .btn-round{
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .opt-add-btn{
    min-height: 38px;
    padding-inline: 10px;
    font-size: 14px;
  }
  .cart-item img{
    width: 88px;
    height: 88px;
  }
}
