/* ==========================================================
   السلة الجانبية — تنزلق من اليسار
   ========================================================== */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: rgba(17, 17, 17, 0.4);
  visibility: hidden;
  opacity: 0;
}
.cart-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;               /* RTL: الطرف الأيسر */
  z-index: 150;
  width: min(100vw, 440px);
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  visibility: hidden;            /* الحركة بـ GSAP (xPercent) */
}
.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-inline: var(--space-lg) var(--space-sm);
  border-bottom: 1px solid var(--c-line);
}
.cart-drawer__title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
}
.cart-drawer__title small {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  color: var(--c-muted);
  margin-inline-start: 6px;
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-sm) var(--space-lg);
}

/* عنصر في السلة */
.cart-line {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: var(--space-md);
  padding-block: var(--space-md);
  border-bottom: 1px solid var(--c-line);
  overflow: hidden;
}
.cart-line__img {
  aspect-ratio: 3 / 4;
  background: var(--c-nude);
  overflow: hidden;
}
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-xs);
}
.cart-line__name { font-size: var(--fs-sm); font-weight: 500; line-height: 1.5; }
.cart-line__remove {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: -6px;
  color: var(--c-muted);
}
.cart-line__remove:hover { color: var(--c-ink); }
.cart-line__remove .icon { width: 16px; height: 16px; }
.cart-line__meta {
  font-size: var(--fs-xs);
  color: var(--c-muted);
  line-height: 1.8;
}
.cart-line__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-xs);
}
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--c-line);
}
.qty button {
  width: 36px;
  height: 36px;
  font-size: 1.125rem;
  line-height: 1;
}
.qty button:hover { background: var(--c-nude); }
.qty output {
  min-width: 28px;
  text-align: center;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  display: inline-block;
}
.cart-line__price { font-size: var(--fs-sm); font-weight: 500; }

/* السلة الفارغة */
.cart-empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: var(--space-sm);
  padding-block: var(--space-2xl);
}
.cart-empty__mark { width: 64px; opacity: 0.25; }
.cart-empty p { font-family: var(--font-display); font-size: var(--fs-h3); }
.cart-empty span { font-size: var(--fs-sm); color: var(--c-muted); }

/* الأسفل */
.cart-drawer__foot {
  padding: var(--space-md) var(--space-lg) calc(var(--space-md) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-line);
  background: var(--c-white);
}
.cart-perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: var(--space-sm);
  font-size: var(--fs-xs);
  color: var(--c-muted);
}
.cart-perks span { display: inline-flex; align-items: center; gap: 6px; }
.cart-perks span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c-rose);
}
.cart-note {
  margin-bottom: var(--space-sm);
  padding: 8px 12px;
  font-size: var(--fs-xs);
  background: var(--c-nude);
  color: var(--c-ink);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-sm);
}
.cart-total span { font-size: var(--fs-sm); }
.cart-total strong {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cart-drawer__foot .btn { width: 100%; }
.cart-drawer__view {
  display: block;
  text-align: center;
  margin-top: var(--space-xs);
  min-height: 40px;
  line-height: 40px;
  font-size: var(--fs-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* عرض الكمية داخل السلة */
.cart-discount { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: var(--fs-sm); color: var(--c-wine); font-weight: 500; }
.cart-upsell { margin-bottom: var(--space-sm); padding: 8px 12px; border: 1px dashed var(--c-rose); border-radius: 8px; font-size: var(--fs-xs); }

/* ---------- «إطلالة كاملة»: القطع المضافة معًا ---------- */
.cart-bundle {
  position: relative;
  margin-block: var(--space-md);
  padding: 12px 14px 10px;
  border: 1.5px solid var(--c-rose);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(243, 234, 229, 0.7), rgba(243, 234, 229, 0) 70%);
}
.cart-bundle__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-bundle__badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--c-ink);
  color: var(--c-white);
  font-size: 11px;
  font-weight: 500;
}
.cart-bundle__title { flex: 1; font-family: var(--font-display); font-size: 1.05rem; }
.cart-bundle__remove { font-size: var(--fs-xs); color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.cart-bundle__remove:hover { color: var(--c-wine); }
/* خيط متقطع يربط قطع الإطلالة */
.cart-bundle__lines { position: relative; padding-inline-start: 14px; }
.cart-bundle__lines::before {
  content: "";
  position: absolute;
  inset-inline-start: 3px;
  top: 18px;
  bottom: 18px;
  border-inline-start: 1.5px dashed var(--c-rose);
}
.cart-bundle .cart-line { position: relative; border-bottom-style: dashed; }
.cart-bundle .cart-line:last-child { border-bottom: 0; }
.cart-bundle__sum { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--c-line); font-size: var(--fs-sm); color: var(--c-muted); }
.cart-bundle__sum strong { color: var(--c-ink); font-weight: 500; }

/* تغليف الهدية داخل السلة */
.cart-gift[hidden] { display: none; }
.cart-gift { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: var(--fs-sm); }
.cart-gift__label { flex: 1; display: inline-flex; align-items: center; gap: 6px; color: var(--c-wine); font-weight: 500; }
.cart-gift__label svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cart-gift__remove { font-size: var(--fs-xs); color: var(--c-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
