/**
 * Absolute last, checkout / cart page law for ALL Ready themes (T1–T1000).
 * Full Secure-checkout stage must never live in a mini side drawer.
 * Also kills word-break shredding on checkout titles.
 */

/* Page shell for every batch cart wrapper */
body.atelier[class*="theme-t"] :is(
  .b02-cart--page,
  .b03-cart--page,
  .b04-cart--page,
  .b05-cart,
  .b06-cart,
  .b07-cart,
  .b08-cart,
  .b09-cart,
  .b10-cart
) {
  width: min(90vw, 100%) !important;
  max-width: 100% !important;
  margin-inline: auto !important;
  position: relative !important;
  min-height: 0 !important;
}

/* Safety: if any drawer still wraps the full stage, explode it to a page */
body.atelier[class*="theme-t"] :is(
  .b02-cart,
  .b03-cart,
  .b04-cart
):has(.an-checkout-stage) > :is(
  .b02-cart__backdrop,
  .b03-cart__backdrop,
  .b04-cart__backdrop
) {
  display: none !important;
}

body.atelier[class*="theme-t"] :is(
  .b02-cart__panel,
  .b03-cart__panel,
  .b04-cart__panel
):has(.an-checkout-stage) {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: min(90vw, 100%) !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  overflow: visible !important;
  z-index: auto !important;
  display: block !important;
}

body.atelier[class*="theme-t"] :is(
  .b02-cart__panel,
  .b03-cart__panel,
  .b04-cart__panel
):has(.an-checkout-stage) > :is(
  .b02-cart__head,
  .b03-cart__head,
  .b04-cart__head
) {
  display: none !important;
}

/* Checkout copy: never vertical shred / break mid-word */
body.atelier[class*="theme-t"] .an-checkout-stage :is(
  h1, h2, h3, p, span, strong, small, label, li, dt, dd,
  .an-kicker,
  .an-checkout-stage__title,
  .an-checkout-stage__sub,
  .an-checkout-stage__rail,
  .an-chrome-note,
  .an-checkout-summary__brand,
  .an-checkout-ship__copy
) {
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  max-width: 100% !important;
}

body.atelier[class*="theme-t"] .an-checkout-stage__title {
  font-size: clamp(2rem, 4.5vw, 3.4rem) !important;
  line-height: 1.05 !important;
}

body.atelier[class*="theme-t"] .an-checkout-stage__grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body.atelier[class*="theme-t"] .an-checkout-stage__main,
body.atelier[class*="theme-t"] .an-checkout-summary,
body.atelier[class*="theme-t"] .an-checkout-summary__card {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (min-width: 1020px) {
  body.atelier[class*="theme-t"] .an-checkout-stage__grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(18rem, 0.85fr) !important;
  }
}
