/* Slide-out cart drawer + floating cart button. Injected by cart-drawer.js on
   product + cart pages. Uses the storefront-base --pc-* tokens. */

/* Prevent body scroll while the drawer is open. */
.pc-drawer-lock { overflow: hidden; }

.pc-drawer-backdrop {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(40, 40, 42, 0.45);
  animation: pc-drawer-fade .18s ease;
}
.pc-drawer-backdrop[hidden] { display: none; }

.pc-drawer {
  position: fixed; top: 0; right: 0; z-index: 9999;
  height: 100vh; width: 420px; max-width: 92vw;
  background: var(--pc-color-surface, #fff);
  box-shadow: -4px 0 24px rgba(40, 40, 42, 0.18);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .24s ease;
  /* Sit below the WP admin bar for logged-in users. */
  padding-top: var(--wp-admin--admin-bar--height, 0px);
}
.pc-drawer--open { transform: translateX(0); }

.pc-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--pc-space-4, 24px) var(--pc-space-4, 24px) var(--pc-space-3, 16px);
  border-bottom: 1px solid var(--pc-color-border, #e4e2e6);
}
.pc-drawer__title {
  margin: 0; color: var(--pc-color-text, #28282a);
  font-family: var(--pc-font-heading, inherit); font-weight: 600; font-size: 18px;
}
.pc-drawer__close {
  background: none; border: none; cursor: pointer;
  font-size: 28px; line-height: 1; color: var(--pc-color-muted, #6b6b70);
  padding: 0 4px;
}
.pc-drawer__close:hover { color: var(--pc-color-text, #28282a); }

/* The body flexes to fill; its cart root splits into a scrolling item list and a
   pinned footer so "Checkout" is always visible without scrolling. */
.pc-drawer__body {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding: 0;
}
#pc-drawer-cart {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
#pc-drawer-cart .pc-cart__items {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: var(--pc-space-3, 16px) var(--pc-space-4, 24px);
}
#pc-drawer-cart .pc-cart__foot {
  border-top: 1px solid var(--pc-color-border, #e4e2e6);
  padding: var(--pc-space-4, 24px);
  background: var(--pc-color-surface, #fff);
}
#pc-drawer-cart .pc-cart__empty { padding: var(--pc-space-6, 48px) var(--pc-space-4, 24px); }

/* Floating cart button. */
.pc-cart-fab {
  position: fixed; z-index: 9997;
  right: 24px; bottom: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--pc-color-accent, #28282a); color: var(--pc-color-accent-ink, #fff);
  border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(40, 40, 42, 0.28);
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.pc-cart-fab[hidden] { display: none; }
.pc-cart-fab:hover { transform: translateY(-2px); }
.pc-cart-fab__icon { font-size: 22px; line-height: 1; }
.pc-cart-fab__badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: #d64545; color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}

@keyframes pc-drawer-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 767px) {
  .pc-drawer { width: 100vw; max-width: 100vw; }
  .pc-cart-fab { right: 16px; bottom: 16px; }
}
