/* Cart drawer line-item styling for the headless clone (matches Dawn tone). */
cart-drawer .drawer__inner { padding: 0; }

/* A CLOSED cart drawer must not blanket the page. base.css's `.drawer` is
   position:fixed; width:100vw; height:100%; z-index:1000 and only flips to
   `visibility:visible` on `.active` — it never sets the hidden default, so a
   closed drawer captured every click (overlay intercepted pointer events).
   enhance.js/cart.js add `.active` to open; hide it otherwise. */
cart-drawer.drawer:not(.active) { visibility: hidden; }
cart-drawer.drawer:not(.active) .cart-drawer__overlay { pointer-events: none; }

/* Once cart.js takes over, hide every native drawer panel (empty state +
   custom header/body/footer with upsells); our .pl-cart-root renders both
   the empty and filled states, so no leftover products show. */
cart-drawer.pl-managed .drawer__inner > :not(.pl-cart-root) {
  display: none !important;
}
.pl-cart-root { display: flex; flex-direction: column; height: 100%; position: relative; }
/* Close (X) anchored to the TOP-right of the drawer (Dawn centers it by default) */
.pl-cart-root .drawer__close {
  position: absolute;
  top: 1.4rem;
  right: 1.4rem;
  left: auto;
  transform: none;
  min-width: 4.4rem;
  min-height: 4.4rem;
  z-index: 3;
}
.pl-cart-head { padding-right: 5rem; }

.pl-cart-empty {
  flex: 1 1 auto;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2rem;
  text-align: center; padding: 2.5rem;
}
.pl-cart-empty__title { font-size: 2.2rem; font-weight: 600; }

.pl-cart-head {
  font-size: 1.8rem;
  font-weight: 600;
  padding: 2rem 2.5rem 1rem;
  border-bottom: .1rem solid rgba(var(--color-foreground), .1);
}
.pl-cart-items {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 2.5rem;
}
.pl-cart-item {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: .1rem solid rgba(var(--color-foreground), .08);
}
.pl-cart-item__img {
  width: 8rem; height: 8rem;
  object-fit: cover;
  border: .1rem solid rgba(var(--color-foreground), .1);
  border-radius: .4rem;
}
.pl-cart-item__title { font-weight: 600; margin: 0 0 .3rem; line-height: 1.3; }
.pl-cart-item__variant { font-size: 1.3rem; opacity: .65; margin: 0 0 .6rem; }
.pl-cart-item__row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: .6rem;
}
.pl-cart-item__price { font-weight: 600; }
.pl-qty {
  display: inline-flex; align-items: center;
  border: .1rem solid rgba(var(--color-foreground), .2);
  border-radius: .4rem;
}
.pl-qty button {
  width: 3.2rem; height: 3.2rem;
  background: none; border: 0; cursor: pointer;
  font-size: 1.8rem; line-height: 1; color: rgb(var(--color-foreground));
}
.pl-qty span { min-width: 2.4rem; text-align: center; font-size: 1.4rem; }
.pl-cart-item__remove {
  margin-top: .8rem;
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: 1.3rem; text-decoration: underline; opacity: .6;
  color: rgb(var(--color-foreground));
}
.pl-cart-item__info { min-width: 0; }
.pl-cart-footer {
  padding: 2rem 2.5rem;
  border-top: .1rem solid rgba(var(--color-foreground), .15);
}
.pl-cart-subtotal {
  display: flex; justify-content: space-between;
  font-size: 1.6rem; font-weight: 600; margin-bottom: .6rem;
}
.pl-cart-note { font-size: 1.3rem; opacity: .6; margin: 0 0 1.4rem; }
.pl-cart-checkout { cursor: pointer; }

/* --- Themed cart drawer (real Dawn markup rendered by cart.js) -------------
   base.css already styles the cart classes; these few rules supply the bits
   that depend on a color-scheme/accent context our .pl-cart-root doesn't sit
   in (e.g. the red checkout button) plus minor drawer-chrome layout. */
.pl-cart-root .drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2rem 2.5rem 1rem; margin: 0;
}
.pl-cart-root .drawer__header .drawer__close {
  position: static; transform: none; min-width: 4.4rem; min-height: 4.4rem;
}
.pl-cart-root .cart-drawer__body { padding-left: 2rem; padding-right: 2rem; }
.pl-cart-root .drawer__footer { padding: 0 2rem 1.5rem; }
/* Accent (red) checkout button — our root lacks the accent scheme that sets
   --color-button, so Dawn's .button falls back to black; force it here. */
.pl-cart-root .cart__checkout-button {
  background: rgb(255, 49, 49);
  color: #fff;
  width: 100%;
  cursor: pointer;
}
.pl-cart-root .cart__checkout-button:hover { background: rgb(230, 30, 30); }

/* ---- Self-contained injected cart drawer (non-Dawn themes, e.g. t4s) -------
   When the source theme has no <cart-drawer> in static markup, cart.js injects
   `cart-drawer.pl-injected-drawer` + `.pl-cart-overlay`. These rules give it the
   fixed right-side slide-in panel + scrim without relying on Dawn's base.css. */
cart-drawer.pl-injected-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  max-width: 100vw;
  height: 100%;
  background: #fff;
  z-index: 10001;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
  visibility: hidden;
}
cart-drawer.pl-injected-drawer.active {
  transform: translateX(0);
  visibility: visible;
}
cart-drawer.pl-injected-drawer .drawer__inner {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pl-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
html.pl-cart-open .pl-cart-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Add-to-cart confirmation popup --------------------------------------- */
.pl-atc-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.pl-atc-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(380px, calc(100vw - 2.4rem));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  z-index: 10051;
  padding: 2rem 1.8rem 1.6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: "Poppins", system-ui, sans-serif;
}
html.pl-atc-open .pl-atc-popup-overlay {
  opacity: 1;
  pointer-events: auto;
}
html.pl-atc-open .pl-atc-popup {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.pl-atc-popup__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  border: 0;
  background: transparent;
  color: #888;
  cursor: pointer;
  padding: 0.4rem;
  line-height: 0;
}
.pl-atc-popup__close:hover { color: #111; }
.pl-atc-popup__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.pl-atc-popup__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1ca15a;
  color: #fff;
  flex: 0 0 auto;
}
.pl-atc-popup__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #111;
}
.pl-atc-popup__item {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  margin-bottom: 1.2rem;
}
.pl-atc-popup__img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
  flex: 0 0 auto;
}
.pl-atc-popup__name {
  font-size: 0.92rem;
  font-weight: 500;
  color: #111;
  line-height: 1.3;
}
.pl-atc-popup__variant {
  font-size: 0.8rem;
  color: #777;
  margin-top: 0.15rem;
}
.pl-atc-popup__price {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111;
  margin-top: 0.3rem;
}
.pl-atc-popup__actions {
  display: flex;
  gap: 0.6rem;
}
.pl-atc-popup__btn {
  flex: 1;
  border: 0;
  border-radius: 9px;
  padding: 0.85rem 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.pl-atc-popup__btn--cart {
  background: #fff;
  color: #111;
  border: 1.5px solid #111;
}
.pl-atc-popup__btn--cart:hover { background: #f3f3f3; }
.pl-atc-popup__btn--checkout {
  background: #111;
  color: #fff;
}
.pl-atc-popup__btn--checkout:hover { opacity: 0.85; }
.pl-atc-popup__continue {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  border: 0;
  background: transparent;
  color: #777;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ============================================================================
   Self-contained styling for the cart.js-rendered drawer body.
   cart.js emits Dawn-themed classes (.cart-drawer-item, .quantity__button,
   .cart-drawer__totals, .cart__checkout-button, …) that normally inherit from
   Dawn's base.css — but this build loads the Kanama (t4s) theme and NEVER loads
   base.css, so that markup rendered unstyled. These rules style that exact
   markup, scoped under .pl-cart-root so nothing leaks into the t4s pages.
   Authored in px on purpose: the theme's root font-size is not Dawn's 62.5%,
   so rem would mis-scale.
   ========================================================================== */
.pl-cart-root {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
}

/* ---- layout: fixed header / scrolling body / fixed footer ---------------- */
.pl-cart-root .drawer__header {
  flex: 0 0 auto;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #ececec;
}
.pl-cart-root .drawer__heading { font-size: 18px; font-weight: 600; margin: 0; }
.pl-cart-root .drawer__close {
  background: none; border: 0; cursor: pointer;
  color: #111; padding: 6px; line-height: 0;
}
.pl-cart-root .cart-drawer__body {
  flex: 1 1 auto; overflow-y: auto; padding: 0 20px;
}
.pl-cart-root .drawer__footer {
  flex: 0 0 auto; border-top: 1px solid #ececec; padding: 16px 20px;
}

/* ---- empty-state CTA ----------------------------------------------------- */
.pl-cart-root .pl-cart-empty .button {
  display: inline-block; padding: 12px 22px;
  border: 1px solid #111; border-radius: 8px;
  text-decoration: none; color: #111; font-weight: 600; font-size: 14px;
}

/* ---- free-shipping progress bar ------------------------------------------ */
.pl-cart-root .cart-progress { margin: 14px 0; }
.pl-cart-root .cart-progress__text {
  font-size: 12.5px; font-weight: 600; text-align: center;
  margin: 0 0 8px; color: #1a7a3d;
}
.pl-cart-root .cart-progress__bar {
  position: relative; height: 6px; border-radius: 99px; background: #e9e9e9;
}
.pl-cart-root .cart-progress__bar__progress {
  position: relative; height: 100%; border-radius: 99px; background: #1ca15a;
}
.pl-cart-root .cart-progress__bar__badge {
  position: absolute; right: 0; top: 50%; transform: translate(50%, -50%);
  width: 28px; height: 28px; border-radius: 50%;
  background: #1ca15a; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ---- line items ---------------------------------------------------------- */
.pl-cart-root .cart-items { list-style: none; margin: 0; padding: 0; }
.pl-cart-root .cart-drawer-item {
  display: grid; grid-template-columns: 72px 1fr; gap: 12px;
  padding: 16px 0; border-bottom: 1px solid #eee; align-items: start;
}
.pl-cart-root .cart-item__media { width: 72px; }
.pl-cart-root .cart-item__image {
  display: block; width: 72px; height: 72px; object-fit: cover;
  border: 1px solid #eee; border-radius: 6px;
}
.pl-cart-root .cart-drawer-item__right {
  min-width: 0; display: flex; flex-direction: column; gap: 6px;
}
.pl-cart-root .cart-drawer-item__details-and-delete-btn {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.pl-cart-root .cart-item__name {
  font-weight: 600; font-size: 13.5px; line-height: 1.35;
  text-decoration: none; color: #1a1a1a;
}
.pl-cart-root .cart-item__discounted-prices {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px;
}
.pl-cart-root .cart-item__old-price,
.pl-cart-root .compare-price {
  color: #999; text-decoration: line-through; font-size: 12px;
}
.pl-cart-root .cart-item__final-price,
.pl-cart-root .regular-price { font-weight: 600; font-size: 13px; color: #1a1a1a; }
.pl-cart-root .cart-drawer__discounts { margin-top: 4px; }
.pl-cart-root .badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eef6ee; color: #1a7a3d; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 99px;
}
.pl-cart-root .badge .icon-discount { width: 11px; height: 11px; }
.pl-cart-root .cart-drawer-item__cart-remove-button .button {
  background: none; border: 0; cursor: pointer; color: #9a9a9a;
  padding: 2px; line-height: 0;
}
.pl-cart-root .cart-drawer-item__cart-remove-button .button:hover { color: #d33; }
.pl-cart-root .icon-remove { width: 15px; height: 15px; }

/* ---- quantity stepper + line total --------------------------------------- */
.pl-cart-root .cart-drawer-item__quantity-and-prices {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 2px;
}
.pl-cart-root quantity-input.quantity {
  display: inline-flex; align-items: center;
  border: 1px solid #d8d8d8; border-radius: 6px; overflow: hidden;
}
.pl-cart-root .quantity__button {
  width: 30px; height: 30px; display: flex; align-items: center;
  justify-content: center; background: #fff; border: 0; cursor: pointer; color: #222;
}
.pl-cart-root .quantity__button:hover { background: #f4f4f4; }
.pl-cart-root .quantity__input {
  width: 34px; height: 30px; text-align: center; border: 0; padding: 0;
  font-size: 13px; background: #fff; color: #111; -moz-appearance: textfield;
}
.pl-cart-root .quantity__input::-webkit-outer-spin-button,
.pl-cart-root .quantity__input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}
.pl-cart-root .cart-item__totals { text-align: right; }
.pl-cart-root .cart-item__totals .cart-item__discounted-prices { justify-content: flex-end; }
.pl-cart-root .price--end { font-weight: 600; font-size: 14px; }

/* ---- footer: totals / CTA / trust / payment badges ----------------------- */
.pl-cart-root .cart-drawer__totals__row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 8px; font-size: 16px;
}
.pl-cart-root .text-color-accent-2 strong { color: #1a7a3d; }
.pl-cart-root .cart__ctas { margin: 14px 0 12px; }
.pl-cart-root .cart__checkout-button {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; border: 0; border-radius: 8px; font-size: 15px; font-weight: 600;
}
.pl-cart-root .icon-with-text {
  display: flex; align-items: center; justify-content: space-around; gap: 8px;
  list-style: none; margin: 10px 0 0; padding: 12px 0 0; border-top: 1px solid #eee;
}
.pl-cart-root .icon-with-text__item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500; color: #555; text-align: center;
}
.pl-cart-root .icon-with-text__item .h4 { font-size: 11.5px; font-weight: 500; margin: 0; }
.pl-cart-root .payment-badges-block { margin-top: 10px; }
.pl-cart-root .payment-badges {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; align-items: center;
  list-style: none; margin: 0; padding: 0;
}
.pl-cart-root .payment-badges .list-payment__item { line-height: 0; }
.pl-cart-root .payment-badges svg,
.pl-cart-root .payment-badges img { height: 22px; width: auto; display: block; }
