/* EpoxyMart cart drawer (owner, 23 Oct 10:35). Markup: inc/cart-drawer.php; body: WooCommerce mini-cart.
   Desktop: 420 px panel from the right. Phones: 92 % of the width, so the page edge stays visible.
   Brand tokens only; the checkout button keeps the magenta of commerce-controls. */

html.em26-cart-open { overflow: hidden; }

.em26-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100000;
}
.em26-cart-drawer[hidden] { display: none; }

.em26-cart-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(22, 53, 61, 0.42);
  opacity: 0;
  transition: opacity 220ms ease;
}

.em26-cart-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(420px, 92vw);
  height: 100%;
  height: 100dvh;
  padding-top: var(--wp-admin--admin-bar--height, 0px);
  background: var(--em26-paper, #f7f4ec);
  color: var(--em26-ink, #16353d);
  box-shadow: -18px 0 48px rgba(22, 53, 61, 0.18);
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  outline: none;
  font-family: var(--em26-font-sans, Manrope, system-ui, sans-serif);
}
.em26-cart-drawer.is-open .em26-cart-drawer__scrim { opacity: 1; }
.em26-cart-drawer.is-open .em26-cart-drawer__panel { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .em26-cart-drawer__scrim,
  .em26-cart-drawer__panel { transition: none; }
}

.em26-cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(22, 53, 61, 0.14);
  background: var(--em26-surface, #fffefa);
}
.em26-cart-drawer__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.em26-cart-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(22, 53, 61, 0.18);
  border-radius: 0.625rem;
  background: var(--em26-surface, #fffefa);
  color: var(--em26-ink, #16353d);
  cursor: pointer;
}
.em26-cart-drawer__close:hover { border-color: var(--em26-ink, #16353d); }
.em26-cart-drawer__close:focus-visible { outline: 3px solid var(--em26-cobalt, #1d5dbb); outline-offset: 2px; }
/* the panel takes focus only to start the focus trap; it is not a control, so it draws no ring */
.em26-cart-drawer__panel:focus { outline: none; }

.em26-cart-drawer__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}
.em26-cart-drawer__body .widget_shopping_cart_content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}
/* waiting for the first fragments */
.em26-cart-drawer__body .widget_shopping_cart_content:empty {
  margin: 2rem auto;
  width: 28px;
  height: 28px;
  flex: none;
  border: 3px solid rgba(22, 53, 61, 0.14);
  border-top-color: var(--em26-turquoise, #129a9a);
  border-radius: 50%;
  animation: em26-cart-spin 800ms linear infinite;
}
@keyframes em26-cart-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .em26-cart-drawer__body .widget_shopping_cart_content:empty { animation: none; }
}

/* lines */
#em26-cart-drawer .woocommerce-mini-cart {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0.75rem 1rem;
  list-style: none;
}
#em26-cart-drawer .woocommerce-mini-cart-item {
  position: relative;
  display: block;
  min-height: 72px;
  margin: 0 0 0.75rem;
  padding: 0.75rem 3.5rem 0.75rem 5.75rem;
  border: 1px solid rgba(22, 53, 61, 0.12);
  border-radius: 0.75rem;
  background: var(--em26-surface, #fffefa);
  font-size: 0.9375rem;
  line-height: 1.35;
  list-style: none;
}
#em26-cart-drawer .woocommerce-mini-cart-item > a:not(.remove) {
  display: block;
  color: var(--em26-ink, #16353d);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: break-word;
}
#em26-cart-drawer .woocommerce-mini-cart-item > a:not(.remove):hover { text-decoration: underline; text-underline-offset: 0.18em; }
#em26-cart-drawer .woocommerce-mini-cart-item img {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  width: 4.25rem !important;
  height: 4.25rem !important;
  margin: 0 !important;
  border-radius: 0.5rem;
  object-fit: cover;
  background: #ece7da;
}
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation {
  display: block;
  margin: 0.3rem 0 0;
  padding: 0;
  border: 0;
  color: #4d6268;
  font-size: 0.8125rem;
}
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation :is(dt, dd, p) { float: none; clear: none; margin: 0; padding: 0; }
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation dt { display: inline; font-weight: 600; }
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation dd { display: inline; margin-left: 0.2rem; color: var(--em26-ink, #16353d); }
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation dd p { display: inline; }
/* one «label: value» pair per line; long labels (artboard options) wrap as text instead of squeezing the value */
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation dd::after { content: ""; display: block; margin-bottom: 0.15rem; }
#em26-cart-drawer .woocommerce-mini-cart-item .quantity {
  display: block;
  margin-top: 0.4rem;
  color: #4d6268;
  font-size: 0.875rem;
}
#em26-cart-drawer .woocommerce-mini-cart-item .quantity .amount { color: var(--em26-ink, #16353d); font-weight: 800; }
#em26-cart-drawer .woocommerce-mini-cart-item a.remove {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px !important;
  height: 44px !important;
  margin: -22px 0 0 !important;
  border: 0;
  border-radius: 50%;
  background: transparent !important;
  color: #4d6268 !important;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
}
#em26-cart-drawer .woocommerce-mini-cart-item a.remove:hover { background: rgba(179, 19, 104, 0.08) !important; color: var(--em26-magenta, #b31368) !important; }
#em26-cart-drawer .woocommerce-mini-cart-item a.remove:focus-visible { outline: 3px solid var(--em26-cobalt, #1d5dbb); outline-offset: -3px; }
#em26-cart-drawer .woocommerce-mini-cart-item.em26-is-removing,
#em26-cart-drawer .blockUI.blockOverlay { opacity: 0.5; }

/* total and buttons stay at the bottom */
#em26-cart-drawer .woocommerce-mini-cart__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 1rem 1.25rem 0.5rem;
  border-top: 1px solid rgba(22, 53, 61, 0.14);
  background: var(--em26-surface, #fffefa);
  font-size: 1rem;
}
#em26-cart-drawer .woocommerce-mini-cart__total strong { font-weight: 700; }
#em26-cart-drawer .woocommerce-mini-cart__total .amount { font-size: 1.25rem; font-weight: 800; white-space: nowrap; }
#em26-cart-drawer .woocommerce-mini-cart__buttons {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--em26-surface, #fffefa);
}
#em26-cart-drawer .woocommerce-mini-cart__buttons a.button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 48px;
  margin: 0 !important;
  box-sizing: border-box;
}

/* empty cart */
#em26-cart-drawer .woocommerce-mini-cart__empty-message {
  margin: 2.5rem 1.25rem;
  color: #4d6268;
  font-size: 1rem;
  text-align: center;
}

/* WooCommerce adds a «Переглянути кошик» link next to the button after an AJAX add; the drawer replaces it */
.single_add_to_cart_button ~ a.added_to_cart,
ul.products li.product a.added_to_cart.wc-forward { display: none !important; }

@media (max-width: 30rem) {
  #em26-cart-drawer .woocommerce-mini-cart { padding: 0.75rem; }
  #em26-cart-drawer .woocommerce-mini-cart-item { padding-left: 5.25rem; }
  #em26-cart-drawer .woocommerce-mini-cart-item img { width: 3.75rem !important; height: 3.75rem !important; }
}

/* screen-reader status inside the drawer (the shared .em26-sr-only rule is scoped to the header) */
#em26-cart-drawer .em26-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* refused add: WooCommerce's message right above the button (cart-drawer.js showError) */
.em26-cart-inline-notice { margin: 0 0 0.75rem; }
.em26-cart-inline-notice > * { margin: 0 0 0.5rem !important; }
.em26-cart-inline-notice > *:last-child { margin-bottom: 0 !important; }
/* inside the narrow buy box the notice button always sits under the text, full width */
.em26-cart-inline-notice :is(.woocommerce-message, .woocommerce-info) { display: flex !important; flex-direction: column; align-items: stretch; gap: 0.6rem; }
.em26-cart-inline-notice :is(.woocommerce-message, .woocommerce-info) > a.button,
.em26-cart-inline-notice .woocommerce-error li > a.button { order: 2; align-self: stretch; display: flex; justify-content: center; width: auto; float: none !important; margin: 0 !important; }
/* WooCommerce's clearfix pseudo-elements on the dl (they broke the earlier grid layout) */
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation::before,
#em26-cart-drawer .woocommerce-mini-cart-item dl.variation::after { content: none !important; display: none !important; }

/* quantity under the line (owner, 25 Oct): − / + with the number between, 44 px targets */
#em26-cart-drawer .woocommerce-mini-cart-item .em26-mini-qty {
  display: inline-flex;
  align-items: center;
  margin-top: 0.4rem;
  border: 1px solid rgba(22, 53, 61, 0.25);
  border-radius: 0.5rem;
  background: var(--em26-surface, #fffefa);
}
#em26-cart-drawer .woocommerce-mini-cart-item .em26-mini-qty button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--em26-ink, #16353d);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
#em26-cart-drawer .woocommerce-mini-cart-item .em26-mini-qty button:hover:not(:disabled) { background: rgba(22, 53, 61, 0.07); }
#em26-cart-drawer .woocommerce-mini-cart-item .em26-mini-qty button:disabled { color: rgba(22, 53, 61, 0.3); cursor: default; }
#em26-cart-drawer .woocommerce-mini-cart-item .em26-mini-qty button:focus-visible { outline: 3px solid var(--em26-cobalt, #1d5dbb); outline-offset: -3px; }
#em26-cart-drawer .woocommerce-mini-cart-item .em26-mini-qty output { min-width: 2rem; text-align: center; font-weight: 800; color: var(--em26-ink, #16353d); }
#em26-cart-drawer .woocommerce-mini-cart-item .em26-mini-qty + .quantity { display: inline-block; margin-left: 0.5rem; }
#em26-cart-drawer .woocommerce-mini-cart-item.em26-is-updating { opacity: 0.55; pointer-events: none; }
