.warely-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(92vw, 400px);
  background: var(--wp--preset--color--surface, #ffffff);
  color: var(--wp--preset--color--contrast, #3d2430);
  box-shadow: -8px 0 40px rgba(61, 36, 48, 0.14);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}
.warely-drawer.is-open {
  transform: translateX(0);
}
/* Keep all drawer content inside the panel padding (buttons/total were
   overflowing the right edge without border-box). */
.warely-drawer,
.warely-drawer * {
  box-sizing: border-box;
}
.warely-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 1.7rem;
  border-bottom: 1px solid rgba(61, 36, 48, 0.1);
}
.warely-drawer__title {
  font-family: var(--wp--preset--font-family--display, Georgia, serif);
  font-size: 1.3rem;
}
.warely-drawer__close {
  background: none;
  border: 0;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
}
/* WooCommerce's default fragment for `div.widget_shopping_cart_content` replaces
   this element on every cart refresh and drops the `warely-drawer__body` class,
   so the padding must hang off `.widget_shopping_cart_content` (which survives)
   — otherwise the items/total/buttons go flush to the drawer edges. */
.warely-drawer__body,
.warely-drawer .widget_shopping_cart_content {
  padding: 1.6rem 1.7rem calc(1.6rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  flex: 1;
}
.warely-drawer__body .woocommerce-mini-cart__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}
.warely-drawer__body .woocommerce-mini-cart__buttons .button {
  width: 100%;
  text-align: center;
}
.warely-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 36, 48, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
  z-index: 9998;
}
.warely-drawer-overlay.is-open {
  opacity: 1;
}
html.warely-cart-open {
  overflow: hidden;
}

/* Header cart icon + count badge */
.warely-cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  text-decoration: none;
  color: inherit;
}
.warely-cart-count:empty {
  display: none;
}
.warely-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--wp--preset--color--primary, #d2567b);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* Mini-cart line items inside the drawer (WooCommerce widget markup). The
   product thumbnail ships unconstrained, so pin it small and lay the row out. */
.warely-drawer ul.cart_list,
.warely-drawer ul.woocommerce-mini-cart {
  list-style: none;
  margin: 0;
  padding: 0;
}
.warely-drawer .woocommerce-mini-cart-item {
  position: relative;
  list-style: none;
  min-height: 64px;
  margin: 0;
  /* !important beats WooCommerce core's .woocommerce ul.product_list_widget li rules. */
  padding: 0.95rem 1.7rem 0.95rem 80px !important;
  border-bottom: 1px solid rgba(61, 36, 48, 0.1);
}
.warely-drawer .woocommerce-mini-cart-item::before,
.warely-drawer .woocommerce-mini-cart-item::marker {
  content: none;
}
.warely-drawer .woocommerce-mini-cart-item img {
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 64px !important;
  height: 64px !important;
  float: none !important;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 !important;
}
.warely-drawer .woocommerce-mini-cart-item a:not(.remove) {
  display: block;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.35;
  color: var(--wp--preset--color--contrast);
}
.warely-drawer .woocommerce-mini-cart-item a:not(.remove):hover {
  color: var(--wp--preset--color--primary);
}
.warely-drawer .woocommerce-mini-cart-item .quantity {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--wp--preset--color--tertiary);
}
.warely-drawer .woocommerce-mini-cart-item a.remove {
  position: absolute;
  top: 0.95rem;
  right: 0;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.45rem;
  text-align: center;
  border-radius: 50%;
  font-size: 1rem;
  text-decoration: none;
  color: var(--wp--preset--color--primary) !important;
  background: rgba(210, 86, 123, 0.08);
}
.warely-drawer .woocommerce-mini-cart__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
  padding: 1rem 0;
  font-size: 1.05rem;
  border-bottom: 1px solid rgba(61, 36, 48, 0.1);
}
.warely-drawer .woocommerce-mini-cart__total .amount {
  /* Transactional amount reads in high-contrast plum, not low-contrast gold. */
  color: var(--wp--preset--color--contrast);
  font-weight: 700;
}
.warely-drawer .woocommerce-mini-cart__buttons {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem;
  margin: 1.25rem 0 0;
}
.warely-drawer .woocommerce-mini-cart__buttons .button {
  width: 100%;
  text-align: center;
}
.warely-drawer .woocommerce-mini-cart__buttons .button:not(.checkout) {
  background: transparent;
  border: 1.5px solid var(--wp--preset--color--primary);
  color: var(--wp--preset--color--primary);
}
.warely-drawer .woocommerce-mini-cart__buttons .button.checkout {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--surface);
}
.warely-drawer .woocommerce-mini-cart__empty-message {
  margin: 0;
  padding: 1.5rem 0;
  color: var(--wp--preset--color--tertiary);
}
