/* Phase 2 cart experience: shared storefront drawer, feedback and cart page. */

/* Canonical storefront cart-button state machine: button-only success feedback. */
body.rg-storefront button.is-cart-pending,
body.rg-storefront button.is-cart-waiting,
body.rg-storefront button.is-cart-success {
  position:relative;
  min-height:44px;
  overflow:hidden;
  white-space:nowrap;
  isolation:isolate;
}

body.rg-storefront button.is-cart-pending {
  cursor:wait;
}

body.rg-storefront button.is-cart-pending .rg-cart-button-state,
body.rg-storefront button.is-cart-waiting .rg-cart-button-state,
body.rg-storefront button.is-cart-success .rg-cart-button-state {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

body.rg-storefront button.is-cart-pending .rg-cart-button-state--pending {
  pointer-events:none;
}

body.rg-storefront button.is-cart-pending .rg-cart-button-state__cart {
  position:absolute;
  top:50%;
  left:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  color:currentColor;
  font-size:22px;
  line-height:1;
  transform:translate3d(calc(-50% - var(--rg-cart-travel-x,96px)),-50%,0) scale(.965);
  transform-origin:center;
  will-change:transform,opacity;
  backface-visibility:hidden;
}

body.rg-storefront button.is-cart-waiting {
  cursor:wait;
}

body.rg-storefront button.is-cart-waiting .rg-cart-button-state--waiting {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 12px;
  pointer-events:none;
}

body.rg-storefront button.is-cart-waiting .rg-cart-button-state__waiting-cart,
body.rg-storefront button.is-cart-waiting .rg-cart-button-state__waiting-label {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:inherit;
}

body.rg-storefront button.is-cart-waiting .rg-cart-button-state__waiting-cart {
  width:24px;
  height:24px;
  font-size:19px;
  line-height:1;
}

body.rg-storefront button.is-cart-waiting .rg-cart-button-state__waiting-label {
  min-width:0;
  font-size:14px;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
}

body.rg-storefront button.is-cart-waiting .rg-cart-button-state__waiting-cart {
  animation:rg-cart-waiting-breathe 1.1s ease-in-out infinite;
}

@keyframes rg-cart-waiting-breathe {
  0%,100% { opacity:.72; transform:scale(.98); }
  50% { opacity:1; transform:scale(1.04); }
}

body.rg-storefront button.is-cart-success,
body.rg-storefront #addCartBtn.is-cart-success,
body.rg-storefront [data-sticky-add-cart].is-cart-success {
  animation:rg-cart-success-shell 200ms cubic-bezier(.2,.8,.25,1) both;
  border-color:var(--rg-color-success) !important;
  background:var(--rg-color-success) !important;
  color:var(--rg-color-text-inverse,#fff) !important;
  font-size:14px !important;
  line-height:1.2;
}

body.rg-storefront button.is-cart-success .rg-cart-button-state--success {
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 30px;
  align-items:center;
  gap:8px;
  padding:0 12px;
  pointer-events:none;
}

body.rg-storefront button.is-cart-success .rg-cart-button-state__check,
body.rg-storefront button.is-cart-success .rg-cart-button-state__success-cart {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  color:inherit;
  line-height:1;
}

body.rg-storefront button.is-cart-success .rg-cart-button-state__check {
  border-radius:50%;
  background:rgb(255 255 255 / .16);
  font-size:17px;
  animation:rg-cart-success-check 300ms cubic-bezier(.2,.8,.25,1.25) both;
}

body.rg-storefront button.is-cart-success .rg-cart-button-state__label {
  min-width:0;
  overflow:hidden;
  color:inherit;
  font-size:14px;
  font-weight:700;
  line-height:1.2;
  text-align:center;
  text-overflow:ellipsis;
  white-space:nowrap;
  animation:rg-cart-success-label 260ms ease-out 70ms both;
}

body.rg-storefront button.is-cart-success .rg-cart-button-state__success-cart {
  position:relative;
  font-size:20px;
  animation:rg-cart-success-cart 360ms cubic-bezier(.2,.75,.25,1.15) 40ms both;
}

body.rg-storefront button.is-cart-success .rg-cart-button-state__success-cart::after {
  content:"";
  position:absolute;
  top:5px;
  right:-1px;
  width:3px;
  height:3px;
  border-radius:50%;
  background:currentColor;
  box-shadow:5px 5px 0 -1px currentColor;
  opacity:.8;
  animation:rg-cart-success-spark 420ms ease-out 120ms both;
}

@keyframes rg-cart-success-shell {
  from { filter:saturate(.86); transform:scale(.992); }
  to { filter:saturate(1); transform:scale(1); }
}

@keyframes rg-cart-success-check {
  0% { opacity:0; transform:scale(.45); }
  70% { opacity:1; transform:scale(1.1); }
  100% { opacity:1; transform:scale(1); }
}

@keyframes rg-cart-success-label {
  from { opacity:0; transform:translateY(4px); }
  to { opacity:1; transform:translateY(0); }
}

@keyframes rg-cart-success-cart {
  from { opacity:0; transform:translateX(-14px) scale(.9); }
  to { opacity:1; transform:translateX(0) scale(1); }
}

@keyframes rg-cart-success-spark {
  0% { opacity:0; transform:translate(-3px,3px) scale(.5); }
  45% { opacity:.9; }
  100% { opacity:0; transform:translate(4px,-4px) scale(1); }
}

@media (max-width:420px) {
  body.rg-storefront button.is-cart-success .rg-cart-button-state--success {
    grid-template-columns:26px minmax(0,1fr) 26px;
    gap:6px;
    padding:0 10px;
  }

  body.rg-storefront button.is-cart-success .rg-cart-button-state__label {
    font-size:13px;
  }

  body.rg-storefront button.is-cart-waiting .rg-cart-button-state__waiting-cart,
  body.rg-storefront button.is-cart-success,
  body.rg-storefront button.is-cart-success .rg-cart-button-state__check,
  body.rg-storefront button.is-cart-success .rg-cart-button-state__success-cart {
    width:26px;
    height:26px;
  }
}

@media (prefers-reduced-motion:reduce) {
  body.rg-storefront button.is-cart-success .rg-cart-button-state__check,
  body.rg-storefront button.is-cart-success .rg-cart-button-state__label,
  body.rg-storefront button.is-cart-success .rg-cart-button-state__success-cart,
  body.rg-storefront button.is-cart-success .rg-cart-button-state__success-cart::after {
    animation:none;
  }

  body.rg-storefront button.is-cart-pending .rg-cart-button-state__cart {
    left:50%;
    transform:translate3d(-50%,-50%,0);
  }
}

body.rg-mini-cart-open {
  overflow:hidden;
}

.rg-mini-cart[hidden],
.rg-cart-toast[hidden],
.rg-mini-cart [hidden] {
  display:none !important;
}

.rg-mini-cart {
  position:fixed;
  inset:0;
  /* Keep the drawer above fixed headers/sticky actions, below review modals. */
  z-index:2147483005;
  display:flex;
  justify-content:flex-end;
  font-family:var(--rg-font-sans);
}

.rg-mini-cart__backdrop {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  background:rgba(15,23,42,.48);
  opacity:0;
  cursor:default;
  transition:opacity var(--rg-motion-large) var(--rg-ease);
}

.rg-mini-cart__panel {
  position:relative;
  z-index:1;
  width:min(430px,100%);
  height:100%;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  background:var(--rg-white);
  color:var(--rg-gray-800);
  box-shadow:-16px 0 48px rgba(15,23,42,.16);
  transform:translateX(100%);
  transition:transform var(--rg-motion-large) var(--rg-ease);
}

.rg-mini-cart.is-open .rg-mini-cart__backdrop,
.rg-mini-cart[aria-hidden="false"] .rg-mini-cart__backdrop {
  opacity:1;
}

.rg-mini-cart.is-open .rg-mini-cart__panel,
.rg-mini-cart[aria-hidden="false"] .rg-mini-cart__panel {
  transform:translateX(0);
}

.rg-mini-cart__header {
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 20px;
  border-bottom:var(--rg-border);
}

.rg-mini-cart__header h2 {
  margin:0;
  color:var(--rg-gray-900);
  font-size:20px;
  font-weight:700;
  line-height:1.25;
  letter-spacing:0;
}

.rg-mini-cart__header p {
  margin:3px 0 0;
  color:var(--rg-gray-500);
  font-size:12px;
  line-height:1.4;
}

.rg-mini-cart__close,
.rg-cart-toast__close {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  padding:0;
  border:0;
  background:transparent;
  color:var(--rg-gray-500);
  cursor:pointer;
}

.rg-mini-cart__close {
  width:40px;
  height:40px;
  border-radius:var(--rg-radius-sm);
  font-size:18px;
}

.rg-mini-cart__close:hover,
.rg-cart-toast__close:hover {
  background:var(--rg-gray-100);
  color:var(--rg-gray-900);
}

.rg-mini-cart__body {
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
}

.rg-mini-cart__loading,
.rg-mini-cart__empty {
  min-height:280px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:32px 24px;
  text-align:center;
}

.rg-mini-cart__loading {
  gap:12px;
  color:var(--rg-gray-500);
  font-size:13px;
}

.rg-mini-cart__spinner {
  width:28px;
  height:28px;
  border:3px solid var(--rg-teal-100);
  border-top-color:var(--rg-system);
  border-radius:50%;
  animation:rg-cart-spin .75s linear infinite;
}

@keyframes rg-cart-spin {
  to { transform:rotate(360deg); }
}

.rg-mini-cart__empty-icon {
  width:56px;
  height:56px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-bottom:14px;
  border-radius:50%;
  background:var(--rg-teal-50);
  color:var(--rg-system);
  font-size:25px;
}

.rg-mini-cart__empty strong {
  color:var(--rg-gray-900);
  font-size:16px;
}

.rg-mini-cart__empty p {
  max-width:270px;
  margin:7px 0 18px;
  color:var(--rg-gray-500);
  font-size:13px;
  line-height:1.5;
}

.rg-mini-cart__continue {
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border:1px solid var(--rg-system);
  border-radius:var(--rg-radius-sm);
  color:var(--rg-system) !important;
  font-size:13px;
  font-weight:600;
  text-decoration:none;
}

.rg-mini-cart__continue:hover {
  background:var(--rg-teal-50);
  color:var(--rg-system-hover) !important;
}

.rg-mini-cart__list {
  padding:0 20px;
}

.rg-mini-cart-item {
  display:grid;
  grid-template-columns:76px minmax(0,1fr);
  gap:14px;
  padding:18px 0;
  border-bottom:var(--rg-border);
}

.rg-mini-cart-item:last-child {
  border-bottom:0;
}

.rg-mini-cart-item__media {
  width:76px;
  height:76px;
  display:block;
  overflow:hidden;
  border:var(--rg-border);
  border-radius:var(--rg-radius-sm);
  background:var(--rg-gray-50);
}

.rg-mini-cart-item__media img {
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.rg-mini-cart-item__fallback {
  width:100%;
  height:100%;
  align-items:center;
  justify-content:center;
  color:var(--rg-gray-400);
  font-size:20px;
}

.rg-mini-cart-item__fallback:not([hidden]) {
  display:flex;
}

.rg-mini-cart-item__content,
.rg-mini-cart-item__copy {
  min-width:0;
}

.rg-mini-cart-item__top,
.rg-mini-cart-item__bottom {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.rg-mini-cart-item__title {
  display:-webkit-box;
  overflow:hidden;
  color:var(--rg-gray-800) !important;
  font-size:13px;
  font-weight:600;
  line-height:1.45;
  text-decoration:none;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

.rg-mini-cart-item__title:hover {
  color:var(--rg-system) !important;
}

.rg-mini-cart-item__variant {
  margin:4px 0 0;
  overflow:hidden;
  color:var(--rg-gray-500);
  font-size:12px;
  line-height:1.4;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.rg-mini-cart-item__remove {
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  margin:-5px -5px 0 0;
  padding:0;
  border:0;
  border-radius:var(--rg-radius-xs);
  background:transparent;
  color:var(--rg-gray-400);
  font-size:14px;
  cursor:pointer;
}

.rg-mini-cart-item__remove:hover {
  background:var(--rg-red-100);
  color:var(--rg-red-600);
}

.rg-mini-cart-item__status {
  margin:6px 0 0;
  color:var(--rg-red-600);
  font-size:11px;
  line-height:1.4;
}

.rg-mini-cart-item__bottom {
  align-items:center;
  margin-top:11px;
}

.rg-mini-cart-item__qty {
  height:32px;
  display:inline-grid;
  grid-template-columns:32px 36px 32px;
  overflow:hidden;
  border:1px solid var(--rg-gray-300);
  border-radius:var(--rg-radius-xs);
  background:var(--rg-white);
}

.rg-mini-cart-item__qty button,
.rg-mini-cart-item__qty input {
  width:100%;
  height:30px;
  margin:0;
  padding:0;
  border:0;
  background:var(--rg-white);
  color:var(--rg-gray-700);
  text-align:center;
}

.rg-mini-cart-item__qty button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  cursor:pointer;
}

.rg-mini-cart-item__qty button:hover {
  background:var(--rg-teal-50);
  color:var(--rg-system);
}

.rg-mini-cart-item__qty input {
  border-right:1px solid var(--rg-gray-200);
  border-left:1px solid var(--rg-gray-200);
  border-radius:0;
  font-size:12px;
  appearance:textfield;
}

.rg-mini-cart-item__qty input::-webkit-outer-spin-button,
.rg-mini-cart-item__qty input::-webkit-inner-spin-button {
  margin:0;
  -webkit-appearance:none;
}

.rg-mini-cart-item__price {
  color:var(--rg-revenue);
  font-size:14px;
  font-weight:700;
  line-height:1.3;
  white-space:nowrap;
}

.rg-mini-cart-item.is-invalid {
  opacity:.78;
}

.rg-mini-cart-item.is-busy {
  opacity:.55;
  pointer-events:none;
}

.rg-mini-cart__footer {
  padding:16px 20px max(18px,env(safe-area-inset-bottom));
  border-top:var(--rg-border);
  background:var(--rg-white);
  box-shadow:0 -5px 18px rgba(15,23,42,.05);
}

.rg-mini-cart__subtotal-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  color:var(--rg-gray-800);
  font-size:14px;
}

.rg-mini-cart__subtotal-row strong {
  color:var(--rg-revenue);
  font-size:20px;
}

.rg-mini-cart__footer > p {
  margin:5px 0 14px;
  color:var(--rg-gray-500);
  font-size:11px;
  line-height:1.45;
}

.rg-mini-cart__actions {
  display:grid;
  grid-template-columns:1fr 1.2fr;
  gap:10px;
}

.rg-mini-cart__view,
.rg-mini-cart__checkout {
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border:1px solid transparent;
  border-radius:var(--rg-radius-sm);
  font-size:13px;
  font-weight:700;
  text-align:center;
  text-decoration:none;
}

.rg-mini-cart__view {
  border-color:var(--rg-system);
  background:var(--rg-white);
  color:var(--rg-system) !important;
}

.rg-mini-cart__view:hover {
  background:var(--rg-teal-50);
  color:var(--rg-system-hover) !important;
}

.rg-mini-cart__checkout {
  border-color:var(--rg-revenue);
  background:var(--rg-revenue);
  color:var(--rg-white) !important;
}

.rg-mini-cart__checkout:hover {
  border-color:var(--rg-revenue-hover);
  background:var(--rg-revenue-hover);
  color:var(--rg-white) !important;
}

.rg-mini-cart__checkout[aria-disabled="true"] {
  border-color:var(--rg-gray-300);
  background:var(--rg-gray-300);
  pointer-events:none;
}

.rg-cart-toast {
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:90;
  width:min(390px,calc(100vw - 32px));
  min-height:76px;
  display:grid;
  grid-template-columns:38px minmax(0,1fr) auto 44px;
  align-items:center;
  gap:10px;
  padding:13px 12px 13px 14px;
  border:var(--rg-border);
  border-left:3px solid var(--rg-system);
  border-radius:var(--rg-radius-sm);
  background:var(--rg-white);
  box-shadow:var(--rg-shadow-lg);
  color:var(--rg-gray-800);
  font-family:var(--rg-font-sans);
  transform:translateY(18px);
  opacity:0;
  transition:opacity var(--rg-motion) var(--rg-ease),transform var(--rg-motion) var(--rg-ease);
}

/* Product Detail sticky UI reaches 2147483000; keep feedback above it but below its 2147483050 review modal. */
body.rg-product-page .rg-cart-toast {
  z-index:2147483001;
}

.rg-cart-toast.is-visible {
  transform:translateY(0);
  opacity:1;
}

.rg-cart-toast.is-error {
  border-left-color:var(--rg-red-500);
}

.rg-cart-toast__icon {
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:var(--rg-teal-100);
  color:var(--rg-system);
  font-size:17px;
}

.rg-cart-toast.is-error .rg-cart-toast__icon {
  background:var(--rg-red-100);
  color:var(--rg-red-600);
}

.rg-cart-toast__content {
  min-width:0;
}

.rg-cart-toast__content strong {
  display:block;
  color:var(--rg-gray-900);
  font-size:14px;
  line-height:1.35;
}

.rg-cart-toast__content p {
  margin:3px 0 0;
  overflow:hidden;
  color:var(--rg-gray-500);
  display:-webkit-box;
  font-size:13px;
  line-height:1.4;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  white-space:normal;
}

.rg-cart-toast__link {
  color:var(--rg-system) !important;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  font-size:14px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}

.rg-cart-toast__link:hover {
  color:var(--rg-system-hover) !important;
  text-decoration:underline;
}

.rg-cart-toast__close {
  width:44px;
  height:44px;
  border-radius:var(--rg-radius-xs);
  font-size:18px;
}

.cartx-empty {
  width:min(620px,100%);
  min-height:440px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  margin:0 auto;
  padding:48px 24px;
  text-align:center;
}

.cartx-empty-icon {
  width:72px;
  height:72px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-bottom:18px;
  border-radius:50%;
  background:var(--rg-teal-50);
  color:var(--rg-system);
  font-size:30px;
}

.cartx-empty h1 {
  margin:0;
  color:var(--rg-gray-900);
  font-size:24px;
  font-weight:700;
  letter-spacing:0;
}

.cartx-empty p {
  max-width:430px;
  margin:9px 0 22px;
  color:var(--rg-gray-500);
  font-size:14px;
  line-height:1.6;
}

.cartx-empty-action {
  min-height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:0 20px;
  border-radius:var(--rg-radius-sm);
  background:var(--rg-revenue);
  color:var(--rg-white) !important;
  font-size:14px;
  font-weight:700;
  text-decoration:none;
}

.cartx-empty-action:hover {
  background:var(--rg-revenue-hover);
  color:var(--rg-white) !important;
}

/* Cart page refinements. Kept outside product-theme scopes on purpose. */
body.rg-storefront .cartx-mobile-topbar {
  border-bottom:var(--rg-border);
  background:var(--rg-white);
  box-shadow:none;
}

body.rg-storefront .cartx-mobile-back,
body.rg-storefront .cartx-mobile-chat {
  color:var(--rg-system);
}

body.rg-storefront .cartx-mobile-title {
  color:var(--rg-gray-900);
  font-weight:700;
  letter-spacing:0;
}

body.rg-storefront .cartx-page {
  color:var(--rg-gray-800);
  font-size:14px;
}

body.rg-storefront .cartx-layout {
  grid-template-columns:minmax(0,1fr) minmax(320px,360px);
  gap:20px;
}

body.rg-storefront .cartx-layout > .cartx-card:last-child {
  position:sticky;
  top:calc(var(--top-promo-height,0px) + 84px);
}

body.rg-storefront .cartx-card {
  overflow:hidden;
  border:var(--rg-border);
  border-radius:var(--rg-radius-sm);
  background:var(--rg-white);
  box-shadow:var(--rg-shadow-xs);
}

body.rg-storefront .cartx-card-head {
  padding:18px 20px;
  border-bottom:var(--rg-border);
  color:var(--rg-gray-900);
  font-size:17px;
  font-weight:700;
}

body.rg-storefront .cartx-table-head {
  padding:11px 20px;
  border-bottom:var(--rg-border);
  background:var(--rg-gray-50);
  color:var(--rg-gray-500);
  font-size:11px;
  font-weight:600;
}

body.rg-storefront .cartx-item {
  border-bottom:var(--rg-border);
}

body.rg-storefront .cartx-swipe-content {
  padding:18px 20px;
  background:var(--rg-white);
}

body.rg-storefront .cartx-thumb {
  width:76px;
  height:76px;
  flex-basis:76px;
  border:var(--rg-border);
  border-radius:var(--rg-radius-sm);
  background:var(--rg-gray-50);
}

body.rg-storefront .cartx-title {
  margin-bottom:7px;
  color:var(--rg-gray-800);
  font-size:13px;
  font-weight:600;
  line-height:1.45;
}

body.rg-storefront .cartx-title a:hover,
body.rg-storefront .cartx-product-link {
  color:var(--rg-system);
}

body.rg-storefront .cartx-product-link:hover {
  color:var(--rg-system-hover);
}

body.rg-storefront .cartx-variant {
  color:var(--rg-gray-500);
  font-size:12px;
}

body.rg-storefront .cartx-qty-box,
body.rg-storefront .cartx-variant-modal-qty {
  border-color:var(--rg-gray-300);
  border-radius:var(--rg-radius-xs);
}

body.rg-storefront .cartx-qty-box button:hover,
body.rg-storefront .cartx-variant-modal-qty button:hover {
  background:var(--rg-teal-50);
  color:var(--rg-system);
}

body.rg-storefront .cartx-remove {
  border-color:var(--rg-gray-300);
  border-radius:var(--rg-radius-xs);
  color:var(--rg-gray-500);
}

body.rg-storefront .cartx-remove:hover {
  border-color:var(--rg-red-500);
  background:var(--rg-red-100);
  color:var(--rg-red-600);
}

body.rg-storefront .cartx-price-main,
body.rg-storefront .cartx-ship-price,
body.rg-storefront .cartx-line-discount .cartx-line-value,
body.rg-storefront .cartx-total .cartx-line-value {
  color:var(--rg-revenue);
}

body.rg-storefront .cartx-bottom {
  border-top:var(--rg-border);
}

body.rg-storefront .cartx-note {
  border-right:var(--rg-border);
}

body.rg-storefront .cartx-note textarea,
body.rg-storefront .cartx-promo-input {
  border-color:var(--rg-gray-300);
  border-radius:var(--rg-radius-xs);
  color:var(--rg-gray-800);
}

body.rg-storefront .cartx-note textarea:focus,
body.rg-storefront .cartx-promo-input:focus {
  border-color:var(--rg-system);
  box-shadow:0 0 0 3px rgba(10,142,134,.12);
  outline:0;
}

body.rg-storefront .cartx-side {
  padding:20px;
}

body.rg-storefront .cartx-side-title {
  color:var(--rg-gray-900);
  font-size:17px;
}

body.rg-storefront .cartx-divider {
  background:var(--rg-gray-200);
}

body.rg-storefront .cartx-promo-chevron,
body.rg-storefront .cartx-promo-ok {
  color:var(--rg-system);
}

body.rg-storefront .cartx-promo-list {
  border-color:var(--rg-gray-200);
  border-radius:var(--rg-radius-sm);
}

body.rg-storefront .cartx-promo-item.is-current {
  background:var(--rg-teal-50);
}

body.rg-storefront .cartx-promo-radio {
  accent-color:var(--rg-system);
}

body.rg-storefront .cartx-apply-btn {
  border-color:var(--rg-system);
  border-radius:var(--rg-radius-xs);
  background:var(--rg-white);
  color:var(--rg-system) !important;
  -webkit-text-fill-color:var(--rg-system) !important;
}

body.rg-storefront .cartx-apply-btn:hover {
  background:var(--rg-teal-50);
  color:var(--rg-system-hover) !important;
  -webkit-text-fill-color:var(--rg-system-hover) !important;
}

body.rg-storefront .cartx-submit-btn {
  min-height:50px;
  border-radius:var(--rg-radius-sm);
  background:var(--rg-revenue);
  color:var(--rg-white);
  font-size:14px;
  font-weight:700;
  transition:background-color var(--rg-motion) var(--rg-ease),transform var(--rg-motion) var(--rg-ease);
}

body.rg-storefront .cartx-submit-btn:hover:not([disabled]) {
  background:var(--rg-revenue-hover);
  transform:translateY(-1px);
}

body.rg-storefront .cartx-submit-btn:active:not([disabled]) {
  background:var(--rg-revenue-pressed);
  transform:translateY(0);
}

body.rg-storefront .cartx-submit-btn[disabled] {
  background:var(--rg-gray-300);
}

body.rg-storefront .cartx-invalid-alert {
  border-color:rgba(239,68,68,.35);
  border-radius:var(--rg-radius-sm);
  background:#fff5f5;
  color:var(--rg-red-600);
}

body.rg-storefront .cartx-status-badge {
  border-color:rgba(239,68,68,.35);
  border-radius:var(--rg-radius-pill);
  background:var(--rg-red-100);
  color:var(--rg-red-600);
}

body.rg-storefront .cartx-select input {
  accent-color:var(--rg-system);
}

body.rg-storefront .cartx-variant-option.is-active {
  border-color:var(--rg-system) !important;
  color:var(--rg-system);
}

body.rg-storefront .cartx-variant-confirm {
  border-radius:var(--rg-radius-sm);
  background:var(--rg-system);
}

body.rg-storefront .cartx-variant-confirm:hover {
  background:var(--rg-system-hover);
}

@media (max-width:991.98px) {
  body.rg-storefront .cartx-layout {
    grid-template-columns:1fr;
  }

  body.rg-storefront .cartx-layout > .cartx-card:last-child {
    position:static;
  }
}

@media (max-width:767.98px) {
  body.rg-storefront.rg-cart-page {
    padding-bottom:calc(76px + env(safe-area-inset-bottom)) !important;
    background:var(--rg-gray-100);
  }

  .rg-mini-cart {
    align-items:flex-end;
  }

  .rg-mini-cart__panel {
    width:100%;
    height:min(82dvh,720px);
    border-radius:var(--rg-radius-sm) var(--rg-radius-sm) 0 0;
    box-shadow:0 -16px 42px rgba(15,23,42,.18);
    transform:translateY(100%);
  }

  .rg-mini-cart.is-open .rg-mini-cart__panel,
  .rg-mini-cart[aria-hidden="false"] .rg-mini-cart__panel {
    transform:translateY(0);
  }

  .rg-mini-cart__header {
    min-height:64px;
    padding:13px 16px;
  }

  .rg-mini-cart__header::before {
    content:"";
    position:absolute;
    top:7px;
    left:50%;
    width:34px;
    height:4px;
    border-radius:var(--rg-radius-pill);
    background:var(--rg-gray-300);
    transform:translateX(-50%);
  }

  .rg-mini-cart__header h2 {
    font-size:18px;
  }

  .rg-mini-cart__list {
    padding:0 16px;
  }

  .rg-mini-cart-item {
    grid-template-columns:70px minmax(0,1fr);
    gap:12px;
    padding:15px 0;
  }

  .rg-mini-cart-item__media {
    width:70px;
    height:70px;
  }

  .rg-mini-cart__footer {
    padding:14px 16px max(14px,env(safe-area-inset-bottom));
  }

  .rg-mini-cart__actions {
    grid-template-columns:1fr 1.15fr;
    gap:8px;
  }

  .rg-cart-toast {
    right:12px;
    bottom:calc(78px + env(safe-area-inset-bottom));
    left:12px;
    width:auto;
    min-height:68px;
    grid-template-columns:34px minmax(0,1fr) auto 44px;
    padding:11px 9px 11px 12px;
  }

  .rg-cart-toast__icon {
    width:32px;
    height:32px;
    font-size:15px;
  }

  body.rg-storefront.rg-cart-page .store-body-container {
    width:100%;
    max-width:none;
    margin:0 !important;
    padding:0 !important;
    background:var(--rg-gray-100);
  }

  body.rg-storefront .cartx-mobile-topbar {
    height:56px;
    grid-template-columns:44px minmax(0,1fr) 44px;
    padding:0 12px;
  }

  .cartx-empty {
    min-height:calc(100dvh - 180px);
    padding:36px 22px;
    background:var(--rg-white);
  }

  .cartx-empty h1 {
    font-size:21px;
  }

  body.rg-storefront .cartx-mobile-title {
    font-size:18px;
  }

  body.rg-storefront .cartx-mobile-title span {
    color:var(--rg-gray-500);
    font-size:12px;
  }

  body.rg-storefront .cartx-page {
    padding:12px 12px 24px;
    background:var(--rg-gray-100);
    font-size:13px;
  }

  body.rg-storefront .cartx-layout {
    display:grid;
    gap:12px;
  }

  body.rg-storefront .cartx-layout > .cartx-card:first-child,
  body.rg-storefront .cartx-layout > .cartx-card:last-child {
    position:static !important;
    max-height:none !important;
    overflow:visible !important;
    margin:0 !important;
    padding-bottom:0 !important;
    border:0;
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }

  body.rg-storefront .cartx-card-head,
  body.rg-storefront .cartx-table-head {
    display:none;
  }

  body.rg-storefront .cartx-page .cartx-item[data-cartx-swipe-item] {
    display:block !important;
    margin:0 0 10px !important;
    padding:0 !important;
    overflow:hidden !important;
    border:var(--rg-border) !important;
    border-radius:var(--rg-radius-sm) !important;
    background:var(--rg-white) !important;
    box-shadow:var(--rg-shadow-xs) !important;
  }

  body.rg-storefront .cartx-page .cartx-swipe-content {
    display:grid !important;
    grid-template-columns:22px 72px minmax(68px,auto) minmax(0,1fr) auto !important;
    grid-template-areas:
      "select thumb title title title"
      "select thumb price variantSelect qty" !important;
    column-gap:8px !important;
    row-gap:7px !important;
    min-height:100px !important;
    padding:12px !important;
    border-radius:var(--rg-radius-sm) !important;
    background:var(--rg-white) !important;
  }

  body.rg-storefront .cartx-page .cartx-select {
    grid-area:select !important;
    position:static !important;
    width:22px !important;
    height:auto !important;
    min-height:72px !important;
    align-self:center !important;
  }

  body.rg-storefront .cartx-page .cartx-select input {
    width:20px !important;
    height:20px !important;
    border-color:var(--rg-gray-300) !important;
    border-radius:5px !important;
  }

  body.rg-storefront .cartx-page .cartx-select input:checked {
    border-color:var(--rg-system) !important;
    background-color:var(--rg-system) !important;
    box-shadow:0 2px 6px rgba(10,142,134,.18) !important;
  }

  body.rg-storefront .cartx-page .cartx-thumb {
    width:72px !important;
    height:72px !important;
    flex-basis:72px !important;
    border-radius:var(--rg-radius-xs) !important;
  }

  body.rg-storefront .cartx-page .cartx-title {
    margin:0 !important;
    color:var(--rg-gray-800) !important;
    font-size:13px !important;
    font-weight:600 !important;
    line-height:1.4 !important;
    -webkit-line-clamp:2 !important;
  }

  body.rg-storefront .cartx-page .cartx-product-link.cartx-variant-trigger {
    width:100% !important;
    max-width:132px !important;
    height:44px !important;
    min-height:44px !important;
    padding:0 8px !important;
    border-color:var(--rg-gray-200) !important;
    border-radius:var(--rg-radius-xs) !important;
    background:var(--rg-gray-50) !important;
    color:var(--rg-gray-600) !important;
    font-size:11px !important;
    line-height:1 !important;
    align-self:center !important;
  }

  body.rg-storefront .cartx-page .cartx-variant-trigger-mobile {
    font-size:11px !important;
  }

  body.rg-storefront .cartx-page .cartx-item-controls {
    align-self:center;
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-swipe-content,
  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-swipe-content.has-cartx-variant {
    grid-template-columns:22px 84px minmax(0,1fr) 54px !important;
    grid-template-rows:20px 44px 20px !important;
    grid-template-areas:
      "select thumb title title"
      "select thumb variantSelect qty"
      "select thumb price price" !important;
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-product-link.cartx-variant-trigger {
    height:44px !important;
    min-height:44px !important;
    padding:0 !important;
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-product-link.cartx-variant-trigger::before {
    display:none !important;
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-variant-trigger-mobile {
    display:-webkit-box !important;
    width:100%;
    min-width:0;
    min-height:18px;
    max-height:32px;
    padding:1px 20px 1px 6px;
    overflow:hidden;
    border:1px solid var(--rg-gray-200);
    border-radius:9px;
    background:var(--rg-gray-50);
    box-sizing:border-box;
    line-height:14px !important;
    white-space:normal !important;
    overflow-wrap:anywhere;
    text-overflow:ellipsis;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-product-link.cartx-variant-trigger::after {
    position:absolute !important;
    top:50%;
    right:8px;
    z-index:2;
    margin:0 !important;
    pointer-events:none;
    transform:translateY(-65%) rotate(45deg) !important;
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-qty-box {
    position:relative;
    width:54px !important;
    min-width:54px !important;
    max-width:54px !important;
    height:44px !important;
    gap:0 !important;
    overflow:hidden !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-qty-box::before,
  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-qty-box::after {
    content:"";
    position:absolute;
    top:50%;
    left:50%;
    pointer-events:none;
    transform:translate(-50%,-50%);
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-qty-box::before {
    z-index:0;
    width:54px;
    height:18px;
    border:1px solid var(--rg-gray-300);
    border-radius:9px;
    background:var(--rg-white);
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-qty-box::after {
    z-index:1;
    width:18px;
    height:18px;
    border-right:1px solid var(--rg-gray-200);
    border-left:1px solid var(--rg-gray-200);
  }

  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-qty-box button {
    position:relative;
    z-index:2;
    display:flex;
    align-items:center;
    justify-content:center;
    width:18px !important;
    min-width:18px !important;
    height:44px !important;
    padding:0 !important;
    background:transparent !important;
    color:var(--rg-gray-600) !important;
    font-size:15px !important;
  }


  body.rg-storefront .cartx-page[data-cartx-compact-ui="v86"] .cartx-qty-box input {
    position:relative;
    z-index:2;
    width:18px !important;
    min-width:18px !important;
    height:44px !important;
    padding:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    font-size:12px !important;
  }

  body.rg-storefront .cartx-page .cartx-price {
    align-self:center !important;
    min-width:0 !important;
  }

  body.rg-storefront .cartx-page .cartx-price-main {
    color:var(--rg-revenue) !important;
    font-size:15px !important;
    line-height:44px !important;
    white-space:nowrap !important;
  }

  body.rg-storefront .cartx-page .cartx-swipe-action {
    width:68px !important;
    min-width:68px !important;
    font-size:14px !important;
    font-weight:600 !important;
  }

  body.rg-storefront .cartx-page .cartx-swipe-edit {
    background:var(--rg-system) !important;
  }

  body.rg-storefront .cartx-page .cartx-swipe-delete {
    background:var(--rg-red-500) !important;
  }

  body.rg-storefront .cartx-bottom {
    margin:12px 0 0;
    border:0;
    background:transparent;
  }

  body.rg-storefront .cartx-note {
    padding:14px;
    border:var(--rg-border);
    border-radius:var(--rg-radius-sm);
    background:var(--rg-white);
  }

  body.rg-storefront .cartx-note-top {
    display:flex;
    margin:0 0 9px;
  }

  body.rg-storefront .cartx-note .cartx-section-title,
  body.rg-storefront .cartx-note textarea,
  body.rg-storefront .cartx-note textarea::placeholder {
    font-size:13px !important;
  }

  body.rg-storefront .cartx-note-count {
    display:block;
  }

  body.rg-storefront .cartx-note textarea {
    min-height:70px;
    padding:10px 12px;
    border:1px solid var(--rg-gray-300);
    border-radius:var(--rg-radius-xs);
    background:var(--rg-white);
    resize:vertical;
  }

  body.rg-storefront .cartx-side {
    padding:16px !important;
    border:var(--rg-border);
    border-radius:var(--rg-radius-sm);
    background:var(--rg-white) !important;
  }

  body.rg-storefront .cartx-side-title {
    display:block;
    margin-bottom:12px;
    font-size:16px;
  }

  body.rg-storefront .cartx-side > .cartx-line:not(.cartx-line-discount) {
    display:flex;
  }

  body.rg-storefront .cartx-line-discount {
    padding:11px 0;
  }

  body.rg-storefront .cartx-promo-toggle {
    grid-template-columns:28px minmax(0,1fr) auto;
  }

  body.rg-storefront .cartx-promo-toggle .cartx-line-label,
  body.rg-storefront .cartx-promo-mobile-value,
  body.rg-storefront .cartx-promo-toggle-right,
  body.rg-storefront .cartx-mobile-ship-label,
  body.rg-storefront .cartx-mobile-ship-value,
  body.rg-storefront .cartx-promo-code,
  body.rg-storefront .cartx-promo-meta,
  body.rg-storefront .cartx-promo-right,
  body.rg-storefront .cartx-promo-input,
  body.rg-storefront .cartx-apply-btn,
  body.rg-storefront .cartx-submit-help {
    font-size:12px !important;
  }

  body.rg-storefront .cartx-mobile-line-icon {
    color:var(--rg-system);
  }

  body.rg-storefront .cartx-mobile-ship-row {
    margin-bottom:58px;
  }

  body.rg-storefront .cartx-mobile-ship-row .cartx-mobile-line-icon {
    color:var(--rg-revenue);
  }

  body.rg-storefront .cartx-mobile-ship-value.is-free {
    color:var(--rg-green-600);
  }

  body.rg-storefront .cartx-mobile-ship-value.is-paid,
  body.rg-storefront .cartx-mobile-ship-note {
    color:var(--rg-revenue);
  }

  body.rg-storefront .cartx-submit {
    position:sticky;
    bottom:calc(70px + env(safe-area-inset-bottom));
    z-index:4;
    margin:14px -4px -4px;
    padding:8px 4px 4px;
    background:var(--rg-white);
  }

  body.rg-storefront .cartx-page .cartx-submit-btn {
    height:50px !important;
    border-radius:var(--rg-radius-sm) !important;
    background:var(--rg-revenue) !important;
    font-size:14px !important;
    font-weight:700 !important;
  }

  body.rg-storefront .cartx-page .cartx-submit-btn[disabled] {
    background:var(--rg-gray-300) !important;
  }

  body.rg-storefront .cartx-invalid-alert {
    margin:0 0 10px;
    padding:12px;
  }

  body.rg-storefront .cartx-variant-sheet {
    border-radius:var(--rg-radius-sm) var(--rg-radius-sm) 0 0;
  }
}

@media (max-width:420px) {
  .rg-cart-toast {
    grid-template-columns:34px minmax(0,1fr) 44px;
    grid-template-areas:
      "icon content close"
      ". link link";
    row-gap:6px;
  }

  .rg-cart-toast__icon { grid-area:icon; }
  .rg-cart-toast__content { grid-area:content; }
  .rg-cart-toast__link { grid-area:link;justify-self:start; }
  .rg-cart-toast__close { grid-area:close; }

  .rg-mini-cart__actions {
    grid-template-columns:1fr;
  }

  body.rg-storefront .cartx-page .cartx-swipe-content {
    grid-template-columns:22px 64px minmax(68px,auto) minmax(24px,1fr) auto !important;
    grid-template-areas:
      "select thumb title title title"
      "select thumb price variantSelect qty" !important;
    column-gap:4px !important;
  }

  body.rg-storefront .cartx-page .cartx-thumb {
    width:64px !important;
    height:64px !important;
    flex-basis:64px !important;
  }
}

@media (prefers-reduced-motion:reduce) {
  .rg-mini-cart__backdrop,
  .rg-mini-cart__panel,
  .rg-cart-toast,
  .rg-mini-cart__spinner {
    animation:none !important;
    transition:none !important;
  }
}
