/* ==========================================================================
   Cart drawer · overlay · toast
   ========================================================================== */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(10, 10, 12, 0.52);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t) ease, visibility 0s linear var(--t);
}
.drawer-overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

/* the drawer opens from the end side of the screen: the right in English, the left in
   Arabic (where the cart icon sits), via logical offsets and the --dx direction number */
.cart-drawer {
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  bottom: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  background: var(--white);
  box-shadow: calc(-30px * var(--dx)) 0 60px -34px rgba(0, 0, 0, 0.55);
  transform: translateX(calc(100% * var(--dx)));
  visibility: hidden;
  transition: transform 0.45s var(--ease), visibility 0s linear 0.45s;
}
.cart-drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.cart-drawer:focus { outline: none; }

/* ---------- header ---------- */
.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem;
  padding-inline-start: 1.4rem;                    /* the close button sits at the end, with less room */
  border-bottom: 1px solid var(--line);
}
.cart-drawer__title { font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.cart-drawer__count { font-weight: 400; color: var(--muted); }

/* ---------- body ---------- */
.cart-drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 1.4rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  animation: cart-item-in 0.45s var(--ease) both;
}
.cart-item:last-child { border-bottom: 0; }

@keyframes cart-item-in {
  from { opacity: 0; transform: translateX(calc(14px * var(--dx))); }
}

.cart-item__thumb {
  position: relative;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(85% 75% at 50% 30%, #fff 0%, var(--tile) 65%, #ebeae7 100%);
}
.cart-item__thumb .bottle { --w: 42%; bottom: 9%; }
.cart-item__thumb .bottle:hover { transform: none; }

.cart-item__info { display: flex; flex-direction: column; min-width: 0; }

.cart-item__brand {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.cart-item__name { font-size: 0.86rem; font-weight: 500; line-height: 1.35; color: var(--ink); }

.cart-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.6rem;
}

.qty {
  display: inline-flex;
  direction: ltr;                  /* numbers run left to right in Arabic too: "− 1 +" */
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.qty button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  transition: background-color var(--t-fast) ease;
}
.qty button:hover { background: #f0f0f2; }
.qty__num { min-width: 24px; text-align: center; font-size: 0.84rem; font-weight: 500; }

.cart-item__price { font-size: 0.92rem; font-weight: 700; color: var(--ink); }

.cart-item__remove {
  margin-top: 0.45rem;
  align-self: flex-start;
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cart-item__remove:hover { color: var(--ink); }

/* ---------- empty ---------- */
.cart-empty { padding: 4rem 0.5rem; text-align: center; }
.cart-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}
.cart-empty__icon svg { width: 28px; height: 28px; }
.cart-empty__title { font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.cart-empty__text { margin: 0.4rem auto 1.5rem; max-width: 30ch; font-size: 0.86rem; color: var(--muted); }

/* ---------- footer ---------- */
.cart-drawer__foot {
  display: grid;
  gap: 0.7rem;
  padding: 1.1rem 1.4rem 1.4rem;
  border-top: 1px solid var(--line);
  background: var(--white);
}
.cart-total { display: flex; align-items: baseline; justify-content: space-between; }
.cart-total__label { font-size: 0.88rem; color: var(--muted); }
.cart-total__value { font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.cart-note { font-size: 0.74rem; color: var(--muted); }
.cart-note__link {
  white-space: nowrap;                  /* "WhatsApp +20 109 225 9033" moves to the next line as one piece */
  font-weight: 500;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cart-note__link:hover { text-decoration-thickness: 2px; }
.cart-note strong { font-weight: 600; color: var(--ink); }   /* "Cash on Delivery" stands out in the note */

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: var(--z-toast);
  max-width: calc(100% - 32px);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.84rem;
  text-align: center;
  box-shadow: 0 16px 36px -16px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity var(--t) ease, transform var(--t) var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Arabic ---------- */
html[lang="ar"] .cart-drawer__title { font-size: 1.1rem; }
html[lang="ar"] .cart-note,
html[lang="ar"] .cart-item__remove { font-size: 0.82rem; }
html[lang="ar"] .cart-empty__text { font-size: 0.92rem; }
html[lang="ar"] .toast { font-size: 0.92rem; }
