/* Owned cart, drawer and inline checkout.
   Loaded after the production stylesheet and deliberately built on the page's
   own custom properties (--bg, --text, --accent, --f-body, --f-display), so it
   inherits the brand rather than restating it. Everything is namespaced .bod-*
   so nothing here can collide with production classes. */

.bod-staging-flag {
  background: #1a1205;
  color: #ffcc66;
  font-family: var(--f-body), system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 12px;
  position: relative;
  z-index: 2000;
}

/* ── Buy button, standing where the Shoprocket widget stood ─────────────── */
.bod-buy { margin: 0; }

.bod-add-to-cart {
  width: 100%;
  padding: 18px 24px;
  background: #000;
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-family: var(--f-body), system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.18s ease, opacity 0.18s ease;
}
.bod-add-to-cart:hover:not(:disabled) { filter: brightness(0.85); }
.bod-add-to-cart:disabled { opacity: 0.35; cursor: not-allowed; }
.bod-add-to-cart.is-busy { opacity: 0.6; cursor: progress; }

.bod-buy-status {
  font-family: var(--f-body), system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted, #555);
  margin-top: 10px;
  min-height: 1.1em;
}
.bod-buy-status.is-warn { color: var(--accent, #ff003c); font-weight: 600; }

/* ── Scrim + drawer ─────────────────────────────────────────────────────── */
.bod-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.24s ease;
}
.bod-scrim[hidden] { display: none; }
.bod-scrim.is-open { opacity: 1; }

.bod-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  background: var(--bg, #faf8f4);
  color: var(--text, #111);
  z-index: 3010;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.14);
  font-family: var(--f-body), system-ui, sans-serif;
}
.bod-drawer[hidden] { display: none; }
.bod-drawer.is-open { transform: none; }

.bod-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.bod-drawer-head h2 {
  font-family: var(--f-display), Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}
.bod-drawer-close {
  background: none;
  border: 0;
  font-size: 30px;
  line-height: 1;
  color: var(--text-muted, #555);
  cursor: pointer;
  padding: 0 4px;
}
.bod-drawer-close:hover { color: var(--text, #111); }

.bod-drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px 20px; }
.bod-drawer-foot { border-top: 1px solid rgba(0, 0, 0, 0.1); padding: 18px 24px 24px; }

.bod-empty {
  text-align: center;
  color: var(--text-muted, #555);
  padding: 60px 16px;
  font-size: 0.95rem;
}

/* ── Cart lines ─────────────────────────────────────────────────────────── */
.bod-line {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  align-items: start;
}
.bod-line img { width: 66px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 6px; display: block; }
.bod-line-name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.bod-line-meta { color: var(--text-muted, #555); font-size: 0.78rem; margin-top: 4px; }
.bod-line-price { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.bod-line-remove {
  background: none;
  border: 0;
  padding: 6px 0 0;
  color: var(--text-muted, #555);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}
.bod-line-remove:hover { color: var(--accent, #ff003c); }

/* ── Totals ─────────────────────────────────────────────────────────────── */
.bod-totals { font-size: 0.88rem; }
.bod-totals > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.bod-totals .bod-grand {
  font-size: 1.1rem;
  font-weight: 700;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  margin-top: 10px;
  padding-top: 14px;
}
.bod-free { color: #1d8a4e; font-weight: 700; }

.bod-cta {
  width: 100%;
  margin-top: 16px;
  padding: 17px 24px;
  border: 0;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.18s ease;
}
.bod-cta:hover:not(:disabled) { filter: brightness(0.85); }
.bod-cta:disabled { opacity: 0.4; cursor: not-allowed; }

.bod-cta-secondary {
  width: 100%;
  margin-top: 10px;
  padding: 14px 24px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  background: none;
  color: var(--text, #111);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.bod-cta-secondary:hover { border-color: var(--text, #111); }

.bod-trust {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.72rem;
  color: var(--text-muted, #555);
}

/* ── Checkout ───────────────────────────────────────────────────────────── */
.bod-field { margin-bottom: 14px; }
.bod-field label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted, #555);
  margin-bottom: 7px;
  font-weight: 600;
}
.bod-field input {
  width: 100%;
  padding: 14px 15px;
  border: 1.5px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--text, #111);
  font-family: inherit;
  font-size: 1rem;
}
.bod-field input:focus { outline: 0; border-color: var(--text, #111); }

#bodAddressElement, #bodPaymentElement { margin: 16px 0; }

.bod-error {
  background: rgba(255, 0, 60, 0.07);
  border: 1px solid rgba(255, 0, 60, 0.3);
  color: #a8002a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.85rem;
  margin: 12px 0;
  line-height: 1.45;
}
.bod-error[hidden] { display: none; }

.bod-note { font-size: 0.78rem; color: var(--text-muted, #555); line-height: 1.5; margin-top: 8px; }
.bod-center { text-align: center; }

/* ── Consent ────────────────────────────────────────────────────────────── */
.bod-consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 540px;
  margin: 0 auto;
  z-index: 4000;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  font-family: var(--f-body), system-ui, sans-serif;
}
.bod-consent[hidden] { display: none; }
.bod-consent p { flex: 1 1 240px; font-size: 0.82rem; color: var(--text-muted, #555); margin: 0; line-height: 1.5; }
.bod-consent-actions { display: flex; gap: 8px; }
.bod-consent button {
  border-radius: 999px;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.bod-consent .bod-accept { background: #000; color: #fff; }
.bod-consent .bod-decline { background: none; color: var(--text-muted, #555); border-color: rgba(0, 0, 0, 0.18); }

@media (max-width: 520px) {
  .bod-drawer { width: 100%; }
  .bod-consent { left: 10px; right: 10px; bottom: 10px; padding: 16px; }
}

/* Footer legal row. Inherits the surrounding footer's colour so it works on
   both the dark PDPs and the light shared design system. */
.bod-footer-legal { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.bod-footer-legal a,
.bod-footer-legal button {
  color: inherit; opacity: 0.7; font: inherit; font-size: 13px;
  background: none; border: 0; padding: 6px 0; margin: 0;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.bod-footer-legal a:hover,
.bod-footer-legal button:hover { opacity: 1; }

/* The PDP's mobile buy bar is `position: fixed; bottom: 0` at <=768px. The
   consent banner is also bottom-fixed and outranks it (z-index 4000 vs 900),
   so left alone it covers Add to cart on exactly the viewport paid Instagram
   traffic arrives on. Sit above the bar instead of over it.

   Measured: the bar renders 109px tall at 390x844 (price row + 54px button +
   padding), so the offset has to clear that, not the 82px the padding values
   suggest on their own. env() is added on top because the bar grows by the
   safe-area inset on notched devices. */
@media (max-width: 768px) {
  body:has(.mobile-buy-bar) .bod-consent { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  .bod-scrim, .bod-drawer { transition: none; }
}

/* ── Cart trigger injected on pages that had none ────────────────────────── */
/* The product pages ship their own .nav-cart; this is the equivalent for the
   rest of the site, styled to sit beside the existing menu toggle. */
.bod-nav-cart {
  position: relative;
  background: none;
  border: 0;
  padding: 6px;
  margin-right: 4px;
  color: var(--text, #111);
  cursor: pointer;
  line-height: 0;
  align-self: center;
}
.bod-nav-cart svg { width: 22px; height: 22px; }
.bod-nav-cart:hover { opacity: 0.65; }

.bod-nav-cart-count {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  background: var(--accent, #ff003c);
  color: #fff;
  font-family: var(--f-body), system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
}
.bod-nav-cart-count.is-empty { display: none; }

/* The shared design system's nav is a two-child flex row; the cart button
   becomes a third child and must not push the toggle off the end. */
.nav { display: flex; align-items: center; }
.nav .bod-nav-cart { margin-left: auto; }
.nav .bod-nav-cart + .nav-toggle { margin-left: 14px; }
