/* ============================================================
   BERUNDA — Cart drawer (shared across all pages)
   A right-side velvet panel that opens over any page. Classes are
   .bcart-*, built and wired by berunda-cart.js, populated from the
   Shopify AJAX cart. Surface matches the locked nav drawer (#1c0408).
   Ceremonial, gold-on-velvet. (The nav count badge is the shared
   .bn-cart-count in berunda-chrome.css — not duplicated here.)
   ============================================================ */

/* ---- Root / scrim ------------------------------------------- */
.bcart-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  visibility: hidden;
  pointer-events: none;
}
.bcart-root[data-open="true"] {
  visibility: visible;
  pointer-events: auto;
}
.bcart-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 1, 4, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.5s var(--ease-standard, ease);
}
.bcart-root[data-open="true"] .bcart-scrim { opacity: 1; }

/* ---- Panel -------------------------------------------------- */
.bcart-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  background: #1c0408;
  border-left: 1px solid rgba(198, 135, 27, 0.22);
  box-shadow: -32px 0 80px rgba(2, 1, 4, 0.55);
  transform: translateX(100%);
  transition: transform 0.56s var(--ease-entrance, cubic-bezier(0.16, 1, 0.3, 1));
  will-change: transform;
}
.bcart-root[data-open="true"] .bcart-panel { transform: translateX(0); }

/* faint vertical gold sheen along the leading edge */
.bcart-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg,
    transparent,
    rgba(227, 189, 110, 0.55) 18%,
    rgba(198, 135, 27, 0.18) 50%,
    rgba(227, 189, 110, 0.45) 82%,
    transparent);
  pointer-events: none;
}

/* ---- Header ------------------------------------------------- */
.bcart-head {
  position: relative;
  flex: none;
  padding: 30px clamp(22px, 4vw, 32px) 0;
}
.bcart-eyebrow {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 9px;
  color: var(--gold-300, #e3bd6e);
}
.bcart-title {
  margin: 9px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 21px;
  color: var(--ivory-200, #ece0c9);
  line-height: 1;
}
.bcart-count-word {
  margin: 6px 0 0;
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ivory-400, #c4b79a);
}
.bcart-x {
  position: absolute;
  top: 24px;
  right: clamp(16px, 3vw, 26px);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(198, 135, 27, 0.26);
  border-radius: 50%;
  color: var(--ivory-400, #c4b79a);
  cursor: pointer;
  transition: none;
}
.bcart-x:hover {
  color: var(--gold-300, #e3bd6e);
  border-color: rgba(198, 135, 27, 0.6);
}
.bcart-rule {
  flex: none;
  height: 1px;
  margin: 22px clamp(22px, 4vw, 32px) 0;
  background: linear-gradient(90deg, rgba(198, 135, 27, 0.4), rgba(198, 135, 27, 0.08));
}

/* ---- Body / line items -------------------------------------- */
.bcart-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px clamp(22px, 4vw, 32px) 12px;
  -webkit-overflow-scrolling: touch;
}
.bcart-lines {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bcart-line {
  display: flex;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(198, 135, 27, 0.12);
  animation: bcart-line-in 0.5s var(--ease-entrance, ease) both;
}
@keyframes bcart-line-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.bcart-thumb {
  flex: none;
  width: 66px;
  height: 82px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(198, 135, 27, 0.22);
  background: #2a0508;
  cursor: pointer;
  transition: border-color var(--dur-normal, 0.24s) var(--ease-standard, ease);
}
.bcart-thumb:hover { border-color: rgba(198, 135, 27, 0.55); }
.bcart-thumb:focus-visible,
.bcart-line-name:focus-visible { outline: 2px solid var(--gold-300, #e3bd6e); outline-offset: 2px; }
.bcart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bcart-line-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bcart-line-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.bcart-line-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 15px;
  color: var(--ivory-200, #ece0c9);
  line-height: 1.2;
  cursor: pointer;
  transition: color var(--dur-normal, 0.24s) var(--ease-standard, ease);
}
.bcart-line-name:hover { color: var(--gold-300, #e3bd6e); }
.bcart-line-format {
  display: block;
  margin-top: 5px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 8.5px;
  white-space: nowrap;
  color: var(--ivory-400, #c4b79a);
}
/* line-item property (e.g. chosen Brew Method) — gold accent */
.bcart-line-prop {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 8.5px;
  color: var(--gold-300, #e3bd6e);
}
.bcart-remove {
  flex: none;
  width: 24px;
  height: 24px;
  margin: -3px -4px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ivory-500, #a89a7c);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur-normal, 0.24s) var(--ease-standard, ease);
}
.bcart-remove:hover { color: var(--gold-300, #e3bd6e); }
.bcart-line-bottom {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Quantity stepper */
.bcart-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(198, 135, 27, 0.26);
  border-radius: 999px;
}
.bcart-step {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ivory-300, #ddccac);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 999px;
  transition: color var(--dur-normal, 0.24s) var(--ease-standard, ease);
}
.bcart-step:hover { color: var(--gold-300, #e3bd6e); }
.bcart-step:disabled { color: rgba(168, 154, 124, 0.4); cursor: default; }
.bcart-qty {
  min-width: 22px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ivory-200, #ece0c9);
}
.bcart-line-price {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 14px;
  color: var(--gold-300, #e3bd6e);
  white-space: nowrap;
}
/* discounted line — original struck, price due in gold (drip pair offer) */
.bcart-line-was {
  font-size: 12px;
  font-weight: 500;
  color: var(--ivory-500, #a89a7c);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.65;
  margin-right: 4px;
}
.bcart-line-now { color: var(--gold-300, #e3bd6e); }

/* ---- Empty state -------------------------------------------- */
.bcart-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(60px, 18vh, 120px) 18px;
}
.bcart-root[data-empty="true"] .bcart-empty { display: flex; }
.bcart-empty-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  color: rgba(198, 135, 27, 0.5);
}
.bcart-empty-mark svg { width: 100%; height: 100%; display: block; }
.bcart-empty-line {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ivory-400, #c4b79a);
  margin: 0 0 18px;
  max-width: 24ch;
}
.bcart-empty-link {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 10px;
  color: var(--gold-300, #e3bd6e);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(198, 135, 27, 0.45);
  transition: color var(--dur-slow, 0.4s) var(--ease-standard, ease),
              border-color var(--dur-slow, 0.4s) var(--ease-standard, ease);
}
.bcart-empty-link:hover {
  color: var(--gold-200, #efd9a6);
  border-bottom-color: var(--gold-300, #e3bd6e);
}

/* ---- Footer ------------------------------------------------- */
.bcart-foot {
  flex: none;
  padding: 20px clamp(22px, 4vw, 32px) calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(198, 135, 27, 0.18);
  background: linear-gradient(180deg, rgba(40, 6, 11, 0), rgba(0, 0, 0, 0.22));
}
.bcart-root[data-empty="true"] .bcart-foot { display: none; }
.bcart-subtotal {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.bcart-subtotal-label {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 10px;
  color: var(--ivory-300, #ddccac);
}
.bcart-subtotal-val {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 20px;
  color: var(--ivory-100, #f4ecdc);
}
/* discounted subtotal — original struck beside the amount due */
.bcart-subtotal-was {
  font-size: 14px;
  font-weight: 500;
  color: var(--ivory-500, #a89a7c);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  opacity: 0.65;
  margin-right: 6px;
}
.bcart-subtotal-now { color: var(--ivory-100, #f4ecdc); }
.bcart-note {
  margin: 8px 0 18px;
  font-family: var(--font-body);
  font-size: 13.5px;
  letter-spacing: 0.01em;
  color: var(--ivory-400, #c4b79a);
}
.bcart-checkout {
  width: 100%;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--gold-500, #c6871b);
  border: 1px solid var(--gold-400, #d6a23f);
  border-radius: 2px;
  color: #1c0408;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 11px;
  cursor: pointer;
  transition: background var(--dur-slow, 0.4s) var(--ease-standard, ease),
              transform var(--dur-slow, 0.4s) var(--ease-standard, ease);
}
.bcart-checkout:hover {
  background: var(--gold-400, #d6a23f);
  transform: translateY(-1px);
}
.bcart-checkout:active { transform: translateY(0); }
.bcart-checkout[disabled] { opacity: 0.6; cursor: default; transform: none; }
.bcart-checkout-arrow {
  font-size: 13px;
  transition: transform var(--dur-slow, 0.4s) var(--ease-standard, ease);
}
.bcart-checkout:hover .bcart-checkout-arrow { transform: translateX(4px); }

/* busy state while talking to the Shopify cart */
.bcart-root[data-busy="true"] .bcart-body { opacity: 0.6; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .bcart-panel, .bcart-scrim, .bcart-line,
  .bcart-x, .bcart-checkout, .bcart-checkout-arrow {
    transition: none;
    animation: none;
  }
  .bcart-x:hover { transform: none; }
}
