/* The cart drawer, drawn by the theme in the cart page's language: the same rows, quantity
   control, summary rail, buttons and empty state. Woo keeps the behavior; its drawer sheet is
   not loaded (inc/mini-cart.php), so everything the drawer looks like is here. */

/* Overlay and panel. The panel enters from the inline end and leaves the same way. */
.wc-block-components-drawer__screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgb(13 13 13 / .4);
  opacity: 1;
  visibility: visible;
}
.wc-block-components-drawer__screen-overlay--is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.wc-block-mini-cart__drawer {
  --mc-ink: #0d0d0d;
  --mc-line: #e5e5e5;
  --mc-muted: #737373;
  --mc-rail: #f5f5f5;
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(400px, 100%);
  height: 100dvh;
  margin: 0;
  background: #fff;
  box-shadow: 0 0 40px rgb(13 13 13 / .12);
  color: var(--mc-ink);
  font-family: 'IBM Plex Sans Arabic', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  text-align: start;
  -webkit-font-smoothing: antialiased;
  transform: none;
}
.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-mini-cart__drawer { transform: translateX(100%); }
.wc-block-components-drawer__screen-overlay--is-hidden .wc-block-mini-cart__drawer:dir(rtl) { transform: translateX(-100%); }
.admin-bar .wc-block-mini-cart__drawer { top: var(--wp-admin--admin-bar--height, 0px); height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); }
.wc-block-mini-cart__drawer *,
.wc-block-mini-cart__drawer *::before,
.wc-block-mini-cart__drawer *::after { box-sizing: border-box; }
.wc-block-mini-cart__drawer :is(h2, a, button, input) { font-family: inherit; letter-spacing: normal; text-transform: none; }

/* Column: title, then the items (they scroll), then the summary directly after them. */
.wc-block-mini-cart__drawer :is(.wc-block-components-drawer__content, .wc-block-mini-cart__template-part, .wp-block-woocommerce-mini-cart-contents) {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}
.wc-block-mini-cart__drawer .wp-block-woocommerce-filled-mini-cart-contents-block:not([hidden]) { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--mc-rail); }
.wc-block-mini-cart__drawer .wp-block-woocommerce-filled-mini-cart-contents-block > :not(.wc-block-mini-cart__footer) { background: #fff; }

/* Close: a quiet icon button at the title's inline end. */
.wc-block-mini-cart__drawer .wc-block-components-drawer__close-wrapper { position: absolute; top: 14px; inset-inline-end: 16px; z-index: 2; }
.wc-block-mini-cart__drawer .wc-block-components-drawer__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--mc-ink);
  box-shadow: none;
  cursor: pointer;
}
.wc-block-mini-cart__drawer .wc-block-components-drawer__close:hover { background: #f3f3f3; }
.wc-block-mini-cart__drawer .wc-block-components-drawer__close svg { display: block; width: 22px; height: 22px; fill: currentColor; }

/* Title row, as the cart page heading: name and a muted count. */
.wc-block-mini-cart__drawer .wc-block-mini-cart__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: none;
  margin: 0;
  padding: 21px 24px 17px;
  padding-inline-end: 72px;
  border-bottom: 1px solid var(--mc-line);
  color: var(--mc-ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
}
.wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-title-label-block { color: inherit; font: inherit; }
.wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-title-items-counter-block { color: var(--mc-muted); font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; }

/* Store notices (stock, limits) keep Woo's notice component, inset to the drawer's gutter. */
.wc-block-mini-cart__drawer .wc-block-components-notices { margin: 0; padding: 0 24px; }
.wc-block-mini-cart__drawer .wc-block-components-notice-banner { margin: 12px 0 0; }

/* Items: the cart page's rows. */
.wc-block-mini-cart__drawer .wc-block-mini-cart__items { flex: 0 1 auto; min-height: 0; margin: 0; padding: 0 24px; overflow-y: auto; overscroll-behavior: contain; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__items:focus,
.wc-block-mini-cart__drawer .wc-block-mini-cart-items:focus,
.wc-block-mini-cart__drawer .wc-block-cart-items__row:focus { outline: none; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__products-table { margin: 0; padding: 0; }
.wc-block-mini-cart__drawer table.wc-block-mini-cart-items { display: block; width: 100%; margin: 0; padding: 0; border: 0; border-collapse: collapse; background: none; }
.wc-block-mini-cart__drawer table.wc-block-mini-cart-items thead { display: none; }
.wc-block-mini-cart__drawer table.wc-block-mini-cart-items tbody { display: block; }
.wc-block-mini-cart__drawer .wc-block-cart-items__row:not([hidden]) {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) max-content;
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-top: 1px solid var(--mc-line);
  background: none;
}
.wc-block-mini-cart__drawer .wc-block-cart-items__row:first-of-type { border-top: 0; }
.wc-block-mini-cart__drawer .wc-block-cart-items__row td { display: block; min-width: 0; margin: 0; padding: 0; border: 0; background: none; vertical-align: top; text-align: start; }
.wc-block-mini-cart__drawer .wc-block-cart-item__image { grid-column: 1; grid-row: 1; padding-inline-end: 16px; }
.wc-block-mini-cart__drawer .wc-block-cart-item__image a { display: block; width: 72px; }
.wc-block-mini-cart__drawer .wc-block-cart-item__image img:not([hidden]) {
  display: block;
  width: 72px;
  height: 108px;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  background: #fafafa;
  object-fit: cover;
  object-position: top center;
}
.wc-block-mini-cart__drawer .wc-block-cart-item__product { grid-column: 2; grid-row: 1; padding-inline-end: 16px; }
.wc-block-mini-cart__drawer .wc-block-cart-item__wrap { display: flex; flex-direction: column; align-items: stretch; min-height: 108px; margin: 0; padding: 1px 0; }
.wc-block-mini-cart__drawer .wc-block-components-product-name:not([hidden]) {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--mc-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.wc-block-mini-cart__drawer a.wc-block-components-product-name:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Unit price under the name only when the line holds more than one copy; the line total sits at the end. */
.wc-block-mini-cart__drawer .wc-block-cart-item__prices { order: 2; margin: 4px 0 0; padding: 0; color: #666; font-size: 12.16px; line-height: 1.55; }
/* Woo disables "minus" at the minimum (one copy); its value attribute does not follow the quantity. */
.wc-block-mini-cart__drawer .wc-block-cart-items__row:has(.wc-block-components-quantity-selector__button--minus:disabled) .wc-block-cart-item__prices { display: none; }
.wc-block-mini-cart__drawer .wc-block-cart-item__prices .wc-block-components-product-price:not([hidden]) { display: inline-flex; align-items: baseline; gap: 4px; color: inherit; font-size: inherit; }
.wc-block-mini-cart__drawer .wc-block-components-product-price__regular { color: var(--mc-muted); font-size: 11px; }
.wc-block-mini-cart__drawer .wc-block-components-product-price__value { color: inherit; background: none; text-decoration: none; }
.wc-block-mini-cart__drawer .wc-block-components-formatted-money-amount { direction: rtl; unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wc-block-mini-cart__drawer .wc-block-components-product-metadata { order: 1; margin: 4px 0 0; padding: 0; color: var(--mc-muted); font-size: 12px; line-height: 1.65; }
.wc-block-mini-cart__drawer .wc-block-components-product-metadata__description { display: none; }
.wc-block-mini-cart__drawer .wc-block-components-product-details__name { color: var(--mc-muted); font-weight: 400; }
.wc-block-mini-cart__drawer .wc-block-components-product-details__value { color: #595959; font-weight: 400; }
.wc-block-mini-cart__drawer .wc-block-components-product-badge:not([hidden]) {
  display: inline-flex;
  align-self: flex-start;
  margin: 6px 0 0;
  padding: 1px 8px;
  border: 1px solid #d6d6d6;
  border-radius: 999px;
  background: #fff;
  color: #595959;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
}
.wc-block-mini-cart__drawer .wc-block-components-sale-badge:not([hidden]) { border-color: #0a663440; background: #e6f4ea; color: #0a6634; }

/* Quantity and remove, placed as on the cart page. */
.wc-block-mini-cart__drawer .wc-block-cart-item__quantity { order: 3; display: flex; align-items: center; margin: 0; margin-block-start: auto; padding: 14px 0 0; }
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector:not([hidden]) {
  display: inline-flex;
  align-items: center;
  direction: rtl;
  width: 106px;
  min-width: 106px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__input {
  flex: 1;
  width: 36px;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--mc-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  direction: ltr;
  unicode-bidi: isolate;
  appearance: textfield;
}
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__input::-webkit-inner-spin-button,
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__button:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--mc-ink);
  font-size: 0;
  cursor: pointer;
}
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__button::after { content: ""; display: block; width: 13px; height: 13px; background: currentColor; mask: center / contain no-repeat; }
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__button--minus::after { mask-image: url(icons/minus.svg); }
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__button--plus::after { mask-image: url(icons/plus.svg); }
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__button:hover:not(:disabled) { background: #f3f3f3; }
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__button:disabled { opacity: .35; cursor: default; }
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link:not([hidden]) {
  position: absolute;
  bottom: 20px;
  inset-inline-end: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--mc-muted);
  cursor: pointer;
}
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link svg { display: none; }
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link::after { content: ""; display: block; width: 16px; height: 16px; background: currentColor; mask: url(icons/trash-2.svg) center / contain no-repeat; }
.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link:hover { background: #fef2f2; color: #d92d20; }
.wc-block-mini-cart__drawer .wc-block-cart-item__total { grid-column: 3; grid-row: 1; padding-top: 1px; text-align: end; white-space: nowrap; }
.wc-block-mini-cart__drawer .wc-block-cart-item__total-price-and-sale-badge-wrapper { display: flex; flex-direction: column; align-items: flex-end; font-size: 14px; font-weight: 500; line-height: 1.35; }
.wc-block-mini-cart__drawer .wc-block-cart-item__total .wc-block-components-product-price { color: var(--mc-ink); }

/* Summary: the cart page's grey rail. It starts right after the items and fills the drawer's
   bottom; with a long cart the items scroll above it. */
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer {
  position: static;
  flex: 1 0 auto;
  margin: 0;
  padding: 20px 24px max(24px, env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid var(--mc-line);
  border-radius: 0;
  background: var(--mc-rail);
  box-shadow: none;
}
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-subtotal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
}
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__label { color: var(--mc-ink); font-size: 14px; font-weight: 500; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__value { color: var(--mc-ink); font-size: 20px; font-weight: 600; line-height: 1.4; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__value.is-loading { opacity: .45; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__description { grid-column: 1 / -1; margin: 0; padding: 0; color: var(--mc-muted); font-size: 12px; line-height: 1.6; }
/* Two actions side by side: checkout first (inline start), then the cart page. */
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0 0; padding: 0; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin: 0;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  text-decoration: none;
  box-shadow: none;
}
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-checkout { order: -1; min-height: 48px; border: 1px solid #000; background: #000; color: #fff; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-checkout:hover { border-color: #222; background: #222; color: #fff; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-checkout::after { content: ""; flex: none; width: 17px; height: 17px; background: currentColor; mask: url(icons/arrow-left.svg) center / contain no-repeat; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-checkout[aria-disabled="true"] { opacity: .6; cursor: progress; }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-cart { min-height: 48px; border: 1px solid #d6d6d6; background: #fff; color: var(--mc-ink); }
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-cart:hover { border-color: #bdbdbd; background: #ebebeb; color: var(--mc-ink); }

/* Empty: the cart page's empty state. */
.wc-block-mini-cart__drawer .wp-block-woocommerce-empty-mini-cart-contents-block:not([hidden]) { display: flex; flex-direction: column; justify-content: center; flex: 1; padding: 72px 24px 24px; }
.wc-block-mini-cart__drawer .asfar-cart-empty-state { margin: 0; padding: 48px 20px; border: 1px dashed #d6d6d6; border-radius: 8px; text-align: center; }
.wc-block-mini-cart__drawer .asfar-cart-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 50%; background: var(--mc-rail); }
.wc-block-mini-cart__drawer .asfar-cart-empty-icon img { display: block; width: 20px; height: 20px; }
.wc-block-mini-cart__drawer .asfar-cart-empty-state h2 { margin: 0 0 6px; color: var(--mc-ink); font-size: 16px; font-weight: 500; line-height: 1.55; }
.wc-block-mini-cart__drawer .asfar-cart-empty-state p { margin: 0 0 18px; color: #595959; font-size: 14px; line-height: 1.6; }
.wc-block-mini-cart__drawer .asfar-cart-empty-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; border: 0; border-radius: 6px; background: #000; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.wc-block-mini-cart__drawer .asfar-cart-empty-button:hover { background: #222; color: #fff; }

/* Keyboard focus is the ink ring used across the theme. */
.wc-block-mini-cart__drawer :is(a, button, input):focus-visible { outline: 2px solid var(--mc-ink); outline-offset: 2px; }
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector__input:focus-visible { outline-offset: -2px; }

@media (max-width: 480px) {
  .wc-block-mini-cart__drawer { inset-inline: 0; width: auto; box-shadow: none; }
  .wc-block-mini-cart__drawer .wc-block-mini-cart__title { padding-inline-start: 20px; }
  .wc-block-mini-cart__drawer .wc-block-mini-cart__items { padding-inline: 20px; }
  .wc-block-mini-cart__drawer .wc-block-mini-cart__footer { padding-inline: 20px; }
  .wc-block-mini-cart__drawer .wc-block-components-quantity-selector__input { font-size: 16px; }
}
/* Motion only for those who have not asked to reduce it. */
@media (prefers-reduced-motion: no-preference) {
  .wc-block-components-drawer__screen-overlay { transition: opacity 220ms ease, visibility 0s; }
  .wc-block-components-drawer__screen-overlay--is-hidden { transition: opacity 220ms ease, visibility 0s linear 260ms; }
  .wc-block-mini-cart__drawer { transition: transform 260ms cubic-bezier(.2, .8, .2, 1); }
  .wc-block-mini-cart__drawer .wc-block-components-drawer__close,
  .wc-block-mini-cart__drawer .wc-block-cart-item__remove-link { transition: background-color 140ms ease, color 140ms ease; }
  .wc-block-mini-cart__drawer .wc-block-mini-cart__footer-subtotal .wc-block-components-totals-item__value { transition: opacity 140ms ease; }
  .wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions a { transition: background-color 150ms ease, border-color 150ms ease; }
}
