/* ============================================================================
   Custom cart drawer (replaces Snipcart) — matches the old Allegory/Shopify cart.
   Right off-canvas, monochrome (#0d0d0d/#fff), Archivo. Slides via `right`
   (layout-based) so it animates reliably regardless of compositor quirks.
   Driven by the `cart-drawer-open` class on <html> (allegory-cart-state.js).
   ========================================================================== */

.cart-drawer-root { font-family: "Archivo", -apple-system, BlinkMacSystemFont, sans-serif; }

/* Backdrop */
.cart-drawer__overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0; padding: 0; border: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.35s ease;
  cursor: pointer;
}
html.cart-drawer-open .cart-drawer__overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Panel: off-screen right by default, slides in on open */
.cart-drawer {
  position: fixed;
  top: 0;
  right: calc(-1 * min(92vw, 44rem));
  width: 92vw;
  max-width: 44rem;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #0d0d0d;
  box-shadow: -0.4rem 0 2.4rem rgba(0, 0, 0, 0.18);
  z-index: 1001;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
html.cart-drawer-open .cart-drawer { right: 0; }
html.cart-drawer-open { overflow: hidden; }

/* Header */
.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 2rem;
  border-bottom: 1px solid #e7e7e7;
  flex: 0 0 auto;
}
.cart-drawer__title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}
.cart-drawer__close {
  background: none; border: 0; padding: 0.4rem; cursor: pointer; color: #0d0d0d;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Body (scrollable) */
.cart-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cart-drawer__empty {
  padding: 4rem 2rem;
  text-align: center;
  color: #6b6b6b;
  font-size: 1.3rem;
}

/* Free-shipping progress bar */
.cart-drawer__shipbar {
  padding: 1.4rem 2rem;
  border-bottom: 1px solid #e7e7e7;
}
.cart-drawer__shipbar-text { font-size: 1.2rem; line-height: 1.4; margin-bottom: 0.8rem; }
.cart-drawer__shipbar-text strong { font-weight: 700; }
.cart-drawer__shipbar-track { height: 4px; width: 100%; background: #e7e7e7; overflow: hidden; }
.cart-drawer__shipbar-fill { height: 100%; background: #0d0d0d; transition: width 0.35s ease; }
.cart-drawer__shipbar.is-done .cart-drawer__shipbar-fill { background: #1a7f37; }
.cart-drawer__shipbar.is-done .cart-drawer__shipbar-text { color: #1a7f37; }

/* Line items */
.cart-drawer__items { list-style: none; margin: 0; padding: 0; }
.cart-line {
  display: flex;
  gap: 1.4rem;
  padding: 1.6rem 2rem;
  border-bottom: 1px solid #efefef;
}
.cart-line__media { flex: 0 0 6.4rem; width: 6.4rem; height: 8rem; overflow: hidden; background: #f6f6f6; display: block; }
.cart-line__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__info { flex: 1 1 auto; min-width: 0; }
.cart-line__title { display: block; font-size: 1.3rem; font-weight: 600; line-height: 1.3; color: #0d0d0d; text-decoration: none; }
.cart-line__variant { font-size: 1.1rem; color: #6b6b6b; margin-top: 0.2rem; }
.cart-line__qty { display: inline-flex; align-items: center; gap: 0; margin-top: 1rem; border: 1px solid #e7e7e7; }
.cart-line__qty-btn {
  width: 3rem; height: 3rem; background: #fff; border: 0; cursor: pointer; color: #0d0d0d;
  font-size: 1.6rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.cart-line__qty-num { min-width: 3rem; text-align: center; font-size: 1.3rem; }
.cart-line__right { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-line__remove { background: none; border: 0; padding: 0.2rem; cursor: pointer; color: #9a9a9a; }
.cart-line__remove:hover { color: #0d0d0d; }
.cart-line__price { font-size: 1.3rem; font-weight: 600; }

/* Footer */
.cart-drawer__footer {
  flex: 0 0 auto;
  border-top: 1px solid #e7e7e7;
  padding: 1.6rem 2rem 2rem;
}
.cart-drawer__summary { margin-bottom: 1.4rem; }
.cart-drawer__summary-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.2rem; margin-bottom: 0.4rem; }
.cart-drawer__summary-row span:first-child { text-transform: uppercase; letter-spacing: 0.04em; }
.cart-drawer__summary-row--muted { color: #6b6b6b; }
.cart-drawer__subtotal { font-size: 1.6rem; font-weight: 700; }
.cart-drawer__checkout {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 5rem;
  background: #0d0d0d; color: #fff;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; font-size: 1.3rem;
  text-decoration: none; border: 0; cursor: pointer;
}
.cart-drawer__checkout:hover { background: #2a2a2a; }
.cart-drawer__continue {
  display: block; width: 100%; margin-top: 1rem; padding: 0.8rem;
  background: none; border: 0; cursor: pointer;
  font-size: 1.2rem; text-decoration: underline; color: #0d0d0d;
}

/* Header cart badge: never show an empty bubble */
.cart-count-bubble__count[data-cart-count].is-empty { /* still shows "0" like Shopify */ }
