/**
 * The header mini-cart exists on every storefront page, not only WC routes.
 * Scoped, fragment-safe presentation: the theme keeps all dialog/focus behavior.
 */
body.zcu-drawer-ui #cart-drawer {
  --zcu-drawer-navy: var(--zomu-header, #0a2236);
  --zcu-drawer-forest: var(--zcu-forest, var(--zomu-forest, #17462b));
  --zcu-drawer-plum: var(--zcu-plum, var(--zomu-plum, #421d25));
  --zcu-drawer-paper: var(--zomu-paper, #f6f4ef);
  --zcu-drawer-line: rgb(10 34 54 / 12%);
  --zcu-drawer-toolbar: 0px;
  display: flex;
  flex-direction: column;
  width: min(100vw, 440px);
  max-width: 100%;
  height: calc(100vh - var(--zcu-drawer-toolbar));
  height: calc(100dvh - var(--zcu-drawer-toolbar));
  padding: 0;
  overflow: hidden;
  border-inline-start: 1px solid var(--zcu-drawer-line);
  color: var(--zcu-drawer-navy);
  background: #fff;
  box-shadow: -18px 0 80px rgb(10 34 54 / 18%);
  font-family: var(--zomu-sans, Inter, ui-sans-serif, system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.5;
}
body.zcu-drawer-ui #cart-drawer[hidden] { display: none; }
body.zcu-drawer-ui.admin-bar #cart-drawer { --zcu-drawer-toolbar: 32px; }
body.zcu-drawer-ui #cart-drawer,
body.zcu-drawer-ui #cart-drawer *,
body.zcu-drawer-ui #cart-drawer *::before,
body.zcu-drawer-ui #cart-drawer *::after { box-sizing: border-box; }

body.zcu-drawer-ui #cart-drawer .cart-drawer__header {
  position: relative;
  flex: 0 0 auto;
  min-height: 88px;
  padding: 22px 26px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  color: #fff;
  background: var(--zcu-drawer-navy);
}
body.zcu-drawer-ui #cart-drawer .cart-drawer__header h2 {
  margin: 0;
  color: #fff;
  font-family: var(--zomu-serif, Georgia, serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.025em;
}
body.zcu-drawer-ui #cart-drawer .js-cart-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
  color: var(--zomu-accent, #d9e6a1);
  background: transparent;
  transition: background-color .2s ease, border-color .2s ease;
}
body.zcu-drawer-ui #cart-drawer .js-cart-close:hover { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 45%); }

/* Only the item list scrolls; native totals and checkout links remain reachable. */
body.zcu-drawer-ui #cart-drawer .widget_shopping_cart_content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding: 0 24px max(22px, env(safe-area-inset-bottom));
  overflow: hidden;
  background: #fff;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart {
  flex: 1 1 auto;
  min-height: 0;
  width: auto;
  margin: 0 -12px;
  padding: 8px 12px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdc6bd transparent;
  list-style: none;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 126px;
  margin: 0;
  padding: 24px 34px 24px 96px;
  border: 0;
  border-bottom: 1px solid var(--zcu-drawer-line);
  background: transparent;
  color: var(--zcu-drawer-navy);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item:last-child { border-bottom: 0; }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item > a:not(.remove) {
  display: block;
  padding: 0;
  margin: 0 0 7px;
  color: var(--zcu-drawer-navy);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
  text-align: start;
  text-decoration: none;
  text-transform: none;
  transition: color .2s ease;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item > a:not(.remove):hover { color: var(--zcu-drawer-forest); text-decoration: underline; text-underline-offset: 3px; }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item img {
  position: absolute;
  inset: 24px auto auto 0;
  float: none;
  width: 78px;
  height: 82px;
  max-width: 78px;
  margin: 0;
  padding: 6px;
  border: 1px solid rgb(10 34 54 / 5%);
  border-radius: 10px;
  object-fit: contain;
  background: var(--zcu-drawer-paper);
  box-shadow: none;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item .quantity {
  display: block;
  width: auto;
  margin: 7px 0 0;
  padding: 0;
  color: #647168;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
body.zcu-drawer-ui #cart-drawer .quantity .amount { color: var(--zcu-drawer-forest); font-size: 14px; font-weight: 600; }
body.zcu-drawer-ui #cart-drawer .amount { white-space: nowrap; }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item .remove_from_cart_button {
  position: absolute;
  inset: 23px -3px auto auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #758078 !important;
  background: transparent !important;
  font-family: Arial, sans-serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item .remove_from_cart_button:hover {
  color: var(--zcu-drawer-plum) !important;
  border-color: rgb(66 29 37 / 12%);
  background: #f8f0f1 !important;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item dl.variation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 5px;
  margin: 6px 0;
  padding: 0;
  border: 0;
  color: #647168;
  font-size: 12px;
  line-height: 1.5;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item dl.variation :is(dt, dd, p) { float: none; clear: none; margin: 0; padding: 0; line-height: inherit; }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item dl.variation dt { font-weight: 500; }

body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__total {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0;
  padding: 22px 0 18px;
  border-top: 1px solid var(--zcu-drawer-line);
  color: var(--zcu-drawer-navy);
  background: #fff;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__total strong { font-size: 12px; font-weight: 600; letter-spacing: .055em; text-transform: uppercase; }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__total .amount { color: var(--zcu-drawer-plum); font-family: var(--zomu-serif, Georgia, serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__buttons {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__buttons .button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 13px 18px;
  border: 1px solid #d7ded6;
  border-radius: 8px;
  color: var(--zcu-drawer-forest);
  background: #f8f9f5;
  box-shadow: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__buttons .checkout { border-color: var(--zcu-drawer-forest); color: #fff; background: var(--zcu-drawer-forest); }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__buttons .button:hover { border-color: var(--zcu-drawer-forest); background: #edf1e7; box-shadow: 0 3px 12px rgb(23 70 43 / 8%); transform: none; }
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__buttons .checkout:hover { color: #fff; background: var(--zcu-drawer-navy); border-color: var(--zcu-drawer-navy); }
body.zcu-drawer-ui #cart-drawer :is(a, button):focus-visible { outline: 2px solid var(--zomu-accent, #d9e6a1); outline-offset: 3px; box-shadow: 0 0 0 4px var(--zcu-drawer-forest); }

body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__empty-message {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 200px;
  margin: 0;
  padding: 40px 24px;
  color: var(--zcu-drawer-plum);
  font-family: var(--zomu-serif, Georgia, serif);
  font-size: 23px;
  line-height: 1.45;
  text-align: center;
}
body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__empty-message::before {
  content: "";
  display: block;
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  border: 1px solid #e0e6d7;
  border-radius: 50%;
  background: #f3f6eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64' fill='none' stroke='%2317462b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 23h32l4 32H12l4-32Z'/%3E%3Cpath d='M23 27V18a9 9 0 0 1 18 0v9'/%3E%3C/svg%3E") center / 58px no-repeat;
}

/* WC fragment replacement needs no re-binding: all styles match the fresh markup. */
@media (max-width: 782px) { body.zcu-drawer-ui.admin-bar #cart-drawer { --zcu-drawer-toolbar: 46px; } }
@media (max-width: 480px) {
  body.zcu-drawer-ui #cart-drawer { width: 100vw; border-inline-start: 0; }
  body.zcu-drawer-ui #cart-drawer .cart-drawer__header { min-height: 78px; padding: 18px 20px; }
  body.zcu-drawer-ui #cart-drawer .cart-drawer__header h2 { font-size: 28px; }
  body.zcu-drawer-ui #cart-drawer .widget_shopping_cart_content { padding-inline: 18px; }
  body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item { padding-inline-start: 88px; }
  body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart-item img { width: 72px; max-width: 72px; height: 80px; }
}
/* Landscape/virtual-keyboard fallback: the full content can scroll if necessary. */
@media (max-height: 500px) {
  body.zcu-drawer-ui #cart-drawer .cart-drawer__header { min-height: 62px; padding-block: 12px; }
  body.zcu-drawer-ui #cart-drawer .widget_shopping_cart_content { display: block; overflow-y: auto; }
  body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart { overflow-y: visible; }
  body.zcu-drawer-ui #cart-drawer .woocommerce-mini-cart__total { padding-block: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  body.zcu-drawer-ui #cart-drawer,
  body.zcu-drawer-ui #cart-drawer * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
body.zcu-drawer-ui:is(.zcu-drawer-motion-none, .zomu-commerce-ui--motion-none, .zomu-reduce-motion) #cart-drawer,
body.zcu-drawer-ui:is(.zcu-drawer-motion-none, .zomu-commerce-ui--motion-none, .zomu-reduce-motion) #cart-drawer * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
