/* ═══════════════════════════════════════════════════════════
   CART — MOTION + JS-SUPPORTING STYLES ONLY
   Loaded after style.css. Adds animations and toast/sparkle
   styles needed by the cart's JS interactivity.
═══════════════════════════════════════════════════════════ */

/* ── Floating orbs ──────────────────────────────────────── */
@keyframes cart-orb-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(34px,22px) scale(1.06); } }
@keyframes cart-orb-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-28px,-18px) scale(1.08); } }
.cart-hero .orb-1 { animation: cart-orb-1 14s ease-in-out infinite; }
.cart-hero .orb-2 { animation: cart-orb-2 16s ease-in-out infinite; }

/* ── Active checkout-step pulse ─────────────────────────── */
@keyframes cart-step-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(74,74,74,.55); }
  60%     { box-shadow: 0 0 0 10px rgba(74,74,74,0); }
}
.cart-step.active .cart-step-dot { animation: cart-step-pulse 2.4s ease-out infinite; }

/* ── Cart-count badge pop ───────────────────────────────── */
@keyframes cart-badge-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
.cart-count-badge .badge-num { animation: cart-badge-pop .7s cubic-bezier(.34,1.56,.64,1) both; animation-delay: .25s; }

/* ── Reveal stagger ─────────────────────────────────────── */
.cart-body .reveal,
.cart-left .reveal { transition-delay: calc(var(--i, 0) * 90ms); }

/* ── Image zoom on item hover ───────────────────────────── */
.cart-item-img { transition: transform .35s cubic-bezier(.4,0,.2,1); }
.cart-item-img img { transition: transform .55s cubic-bezier(.4,0,.2,1); }
.cart-item:hover .cart-item-img img { transform: scale(1.08); }

/* ── Qty stepper press bounce ───────────────────────────── */
@keyframes qty-bounce { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
.qty-btn.bumped { animation: qty-bounce .32s cubic-bezier(.34,1.56,.64,1); }
.qty-val.bumped { animation: qty-bounce .35s cubic-bezier(.34,1.56,.64,1); }

/* ── Price flash on change ──────────────────────────────── */
@keyframes price-flash { 0% { color: #000000; transform: scale(1); } 40% { color: #000000; transform: scale(1.08); } 100% { color: #000000; transform: scale(1); } }
@keyframes price-flash-light { 0% { color: #fff; transform: scale(1); } 40% { color: #FFFFFF; transform: scale(1.06); } 100% { color: #fff; transform: scale(1); } }
.cart-item-price.flash { animation: price-flash .55s ease-out; display: inline-block; transform-origin: right center; }
.summary-total-val.flash { animation: price-flash-light .55s ease-out; display: inline-block; transform-origin: right center; }
.summary-row-val.flash { animation: price-flash-light .5s ease-out; display: inline-block; transform-origin: right center; }

/* ── Save heart pulse ───────────────────────────────────── */
@keyframes heart-pulse { 0%,100% { transform: scale(1); } 30% { transform: scale(1.3); color: #dc2626; } 60% { transform: scale(.95); } }
.cart-link-save.bumped svg { animation: heart-pulse .6s ease-out; transform-origin: center; }

/* ── Removing item — refined exit ───────────────────────── */
.cart-item.removing,
.saved-item.removing {
  opacity: 0 !important;
  transform: translateX(-32px) scale(.96) !important;
  filter: blur(2px);
  transition: opacity .42s ease, transform .42s ease, filter .42s ease, max-height .35s ease .15s, padding .35s ease .15s, margin .35s ease .15s !important;
  max-height: 320px;
  pointer-events: none;
}
.cart-item.collapsing,
.saved-item.collapsing {
  max-height: 0 !important;
  padding-top: 0 !important; padding-bottom: 0 !important;
  margin-top: 0 !important; margin-bottom: 0 !important;
  border-width: 0 !important; overflow: hidden !important;
}

/* ── Crosssell hover/zoom ───────────────────────────────── */
.crosssell-img img { transition: transform .55s cubic-bezier(.4,0,.2,1); }
.crosssell-card:hover .crosssell-img img { transform: scale(1.07); }
.crosssell-card { will-change: transform; transition: box-shadow .28s ease, transform .35s cubic-bezier(.4,0,.2,1); }

/* ── Crosssell drag-to-scroll affordance ────────────────── */
.crosssell-scroll { cursor: grab; }
.crosssell-scroll.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;          /* 1:1 with the pointer while dragging */
  user-select: none;
}
.crosssell-scroll.is-dragging img { pointer-events: none; }
.crosssell-scroll img { -webkit-user-drag: none; user-drag: none; }

/* ── Magnetic checkout button ───────────────────────────── */
.checkout-btn { will-change: transform; }

/* ── Shipping-progress shimmer ──────────────────────────── */
@keyframes ship-shimmer { 0% { background-position: -120% 0; } 100% { background-position: 220% 0; } }
.ship-bar-fill {
  background: linear-gradient(90deg, #4A4A4A, #000000 40%, #4A4A4A 60%, #000000);
  background-size: 220% 100%;
  animation: ship-shimmer 3.2s linear infinite;
}

/* ── Coupon sparkle burst ───────────────────────────────── */
.coupon-burst { position: absolute; pointer-events: none; left: 50%; top: 50%; width: 0; height: 0; z-index: 5; }
.coupon-burst span {
  position: absolute; left: 0; top: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: #4A4A4A;
  box-shadow: 0 0 8px rgba(74,74,74,.85);
  animation: spark-fly .9s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes spark-fly {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); }
}
.coupon-apply-btn { position: relative; overflow: visible; }
.coupon-input.applied { border-color: #000000 !important; box-shadow: 0 0 0 3px rgba(74,74,74,.15); }
.coupon-apply-btn.applied { background: #000000 !important; }

/* ── Toast notifications ────────────────────────────────── */
.cart-toast-wrap {
  position: fixed; right: 22px; bottom: 22px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.cart-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  background: #141414; color: #fff;
  border: 1px solid rgba(74,74,74,.35);
  border-left: 3px solid #4A4A4A;
  border-radius: 12px;
  padding: 12px 18px 12px 14px;
  font-family: 'Jost', sans-serif; font-size: .82rem;
  box-shadow: 0 18px 44px rgba(0,0,0,.35);
  min-width: 220px;
  transform: translateX(120%); opacity: 0;
  transition: transform .42s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
}
.cart-toast.show { transform: translateX(0); opacity: 1; }
.cart-toast.hide { transform: translateX(120%); opacity: 0; }
.cart-toast svg { width: 16px; height: 16px; stroke: #4A4A4A; fill: none; stroke-width: 2.4; flex-shrink: 0; }
.cart-toast.warn { border-left-color: #f59e0b; }
.cart-toast.warn svg { stroke: #f59e0b; }
.cart-toast.error { border-left-color: #dc2626; }
.cart-toast.error svg { stroke: #dc2626; }
@media (max-width: 600px) {
  .cart-toast-wrap { right: 12px; left: 12px; bottom: 12px; }
  .cart-toast { min-width: 0; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   ENHANCED ENTRANCE ANIMATIONS — sequenced page intro
═══════════════════════════════════════════════════════════ */
@keyframes cart-fade-up {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes cart-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cart-scale-in {
  from { opacity: 0; transform: scale(.86); }
  to   { opacity: 1; transform: scale(1); }
}

/* Hero sequenced children — handled by [data-cascade] on the
   <section class="cart-hero"> wrapper, so no CSS animation here. */

/* Em-text glow inside h1 */
@keyframes cart-em-glow {
  0%,100% { text-shadow: 0 0 0 transparent; }
  50%     { text-shadow: 0 0 28px rgba(74,74,74,.45); }
}
.cart-hero h1 em { animation: cart-em-glow 4.6s ease-in-out 1.4s infinite; }

/* Step dots & lines — handled by the cart-steps [data-cascade]
   so each dot/line is staggered by the JS observer. */

/* ═══════════════════════════════════════════════════════════
   ENHANCED HOVER & MICRO-INTERACTIONS
═══════════════════════════════════════════════════════════ */

/* Cart item: subtle lift on hover (transform) */
.cart-item { transition: box-shadow .35s ease, border-color .3s ease, transform .3s ease; }
.cart-item:hover { transform: translateY(-2px); }

/* Cart item image: glossy shine sweep on hover */
.cart-item-img { position: relative; }
.cart-item-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.42) 50%, transparent 65%);
  transform: translateX(-110%);
  transition: transform .9s cubic-bezier(.4,0,.2,1);
  pointer-events: none; z-index: 2;
}
.cart-item:hover .cart-item-img::after { transform: translateX(110%); }

/* Qty button ripple feedback */
.qty-btn { position: relative; overflow: hidden; }
/* Disabled minus (quantity already at 1) */
.qty-btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── Empty cart state ─────────────────────────────────────── */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 66px 32px;
  background: #fff;
  border: 1px solid #FAFAFA;
  border-radius: 16px;
  box-shadow: 0 18px 40px -28px rgba(0,0,0,.35);
}
.cart-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #FAFAFA;
  margin-bottom: 22px;
}
.cart-empty-icon svg {
  width: 36px;
  height: 36px;
  stroke: #4A4A4A;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cart-empty-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  font-weight: 600;
  color: #141414;
  margin: 0 0 8px;
}
.cart-empty-text {
  font-family: 'Jost', sans-serif;
  font-size: .92rem;
  line-height: 1.7;
  color: #8a8a8a;
  max-width: 430px;
  margin: 0 0 26px;
}
.cart-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 30px;
  background: #000000;
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 999px;
  text-decoration: none;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.cart-empty-btn:hover {
  background: #000000;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(0,0,0,.6);
}
.cart-empty-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}
@media (max-width: 600px) {
  .cart-empty { padding: 48px 20px; }
  .cart-empty-title { font-size: 1.5rem; }
}
.qty-btn::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 0; height: 0; border-radius: 50%;
  background: rgba(74,74,74,.42); transform: translate(-50%,-50%);
  opacity: 0; pointer-events: none;
}
.qty-btn.bumped::after {
  animation: qty-ripple .55s ease-out;
}
@keyframes qty-ripple {
  0%   { width: 0; height: 0; opacity: .85; }
  100% { width: 64px; height: 64px; opacity: 0; }
}

/* Save / remove btn underline grow */
.cart-link-btn { position: relative; text-decoration: none; }
.cart-link-btn::after {
  content: ''; position: absolute; left: 0; bottom: -2px;
  height: 1px; width: 0; background: currentColor;
  transition: width .3s ease;
}
.cart-link-btn:hover::after { width: 100%; }

/* Continue shopping arrow slides */
.cart-continue svg { transition: transform .3s ease; }
.cart-continue:hover svg { transform: translateX(-4px); }

/* Saved item: lift on hover */
.saved-item { transition: border-color .25s, transform .3s ease, box-shadow .3s ease; }
.saved-item:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.saved-item-move-btn { transition: background .25s, border-color .25s, color .25s, transform .25s; }
.saved-item-move-btn:hover { transform: scale(1.04); }

/* Crosssell add-btn lift */
.crosssell-add-btn { transition: background .25s, color .25s, transform .25s; }
.crosssell-add-btn:hover { transform: scale(1.04); }

/* Trust items mini-animation */
.trust-item { transition: color .25s, transform .25s; }
.trust-item:hover { color: rgba(74,74,74,.75); }
.trust-item svg { transition: stroke .25s, transform .25s; }
.trust-item:hover svg { stroke: rgba(74,74,74,.75); transform: translateY(-2px) scale(1.08); }

/* Summary card breathing border-glow */
@keyframes cart-summary-glow {
  0%, 100% { box-shadow: 0 28px 72px rgba(0,0,0,.45), 0 0 0 1px rgba(74,74,74,.08); }
  50%      { box-shadow: 0 32px 86px rgba(0,0,0,.5),  0 0 0 1px rgba(74,74,74,.2); }
}
.summary-card { animation: cart-summary-glow 5.5s ease-in-out infinite; }

/* Free-shipping unlocked celebration */
.shipping-progress-wrap { transition: border-color .35s ease, background .35s ease; }
.shipping-progress-wrap.unlocked { border-color: rgba(74,74,74,.55); background: rgba(74,74,74,.04); }
.ship-prog-icon { transition: transform .45s cubic-bezier(.34,1.56,.64,1); }
.shipping-progress-wrap.unlocked .ship-prog-icon { transform: scale(1.12) rotate(-8deg); }

/* Coupon attention pulse (only until clicked) */
@keyframes coupon-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(74,74,74,0); }
  50%     { box-shadow: 0 0 0 4px rgba(74,74,74,.16); }
}
.coupon-toggle:not(.open):not(.dismissed) { animation: coupon-pulse 3.2s ease-in-out 2.4s infinite; }

/* ═══════════════════════════════════════════════════════════
   MOBILE STICKY CHECKOUT CTA
═══════════════════════════════════════════════════════════ */
.cart-mobile-cta {
  position: fixed; left: 12px; right: 12px; bottom: 12px;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(135deg, #141414 0%, #141414 100%);
  border: 1px solid rgba(74,74,74,.32);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5);
  z-index: 998;
  transform: translateY(140%); opacity: 0;
  transition: transform .5s cubic-bezier(.22,.94,.36,1), opacity .35s ease;
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}
.cart-mobile-cta.show { transform: translateY(0); opacity: 1; }
.mcc-info { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.mcc-label {
  font-family: 'Jost', sans-serif; font-size: .58rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.42);
}
.mcc-total {
  font-family: 'Cormorant Garamond', serif; font-size: 1.25rem;
  font-weight: 600; color: #fff;
}
.mcc-btn {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #4A4A4A, #000000);
  color: #fff; border: none; border-radius: 100px;
  padding: 12px 22px;
  font-family: 'Jost', sans-serif; font-size: .76rem;
  letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
  cursor: pointer; position: relative; overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
  transition: transform .25s ease, box-shadow .25s ease;
}
.mcc-btn:active { transform: scale(.96); }
.mcc-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.mcc-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.32), transparent);
  transform: translateX(-100%);
  animation: mcc-shine 3.4s ease-in-out 1s infinite;
}
@keyframes mcc-shine {
  0%, 55%, 100% { transform: translateX(-100%); }
  78%           { transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════
   COMPREHENSIVE RESPONSIVE BREAKPOINTS
   These augment the base rules in style.css with finer control.
═══════════════════════════════════════════════════════════ */

/* Wide desktop ≤ 1280 */
@media (max-width: 1280px) {
  .cart-body { padding: 44px 56px 56px; }
  .cart-crosssell { padding: 48px 56px; }
  .cart-hero { padding: 100px 56px 44px; }
}

/* Small desktop ≤ 1100 */
@media (max-width: 1100px) {
  .cart-layout { gap: 24px; }
  .summary-header { padding: 22px 22px 18px; }
  .summary-body   { padding: 20px 22px; }
  .summary-trust  { padding: 16px 22px 22px; }
  .summary-total-val { font-size: 1.7rem; }
  .crosssell-card { width: 220px; }
  .crosssell-img { height: 170px; }
}

/* Tablet ≤ 980 — single-column layout */
@media (max-width: 980px) {
  .cart-hero { padding: 96px 32px 44px; }
  .cart-summary { max-width: 620px; margin: 0 auto; width: 100%; }
  .cart-saved-section { margin-top: 32px; }
  .crosssell-card { width: 210px; }
  .crosssell-img { height: 162px; }
  .summary-card { animation-duration: 7s; }
}

/* Tablet portrait & large mobile ≤ 768 */
@media (max-width: 768px) {
  .cart-hero { padding: 90px 22px 40px; }
  .cart-body { padding: 32px 18px 110px !important; } /* extra bottom for sticky CTA */
  .cart-crosssell { padding: 44px 18px; }
  .cart-crosssell h2 { font-size: 1.85rem; margin-bottom: 26px; }

  /* Steps: keep visible as compact dots-only, scrollable */
  .cart-steps {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 22px;
  }
  .cart-steps::-webkit-scrollbar { display: none; }
  .cart-step span { display: none; }
  .cart-step-line { width: 28px; margin: 0 4px; }

  /* Item card: tighter compact layout */
  .cart-item {
    grid-template-columns: 92px 1fr !important;
    padding: 16px !important;
    gap: 14px !important;
    border-radius: 16px;
  }
  .cart-item-img {
    width: 92px !important;
    height: 92px !important;
    aspect-ratio: auto !important;
    border-radius: 10px;
  }
  .cart-item-name { font-size: 1.05rem; }
  .cart-item-meta { gap: 10px; margin-bottom: 10px; }
  .cart-item-meta-row { font-size: .72rem; }
  .cart-item-footer { padding-top: 0; }
  .cart-item-right {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    gap: 12px;
  }
  .cart-item-price { font-size: 1.2rem; }

  /* Touch-friendly qty stepper */
  .qty-btn { width: 40px; height: 40px; }
  .qty-val { min-width: 36px; font-size: .92rem; }

  /* Saved item: stacked button */
  .saved-item {
    grid-template-columns: 64px 1fr !important;
    padding: 14px 16px !important;
    gap: 12px !important;
  }
  .saved-item-img { width: 64px; height: 64px; }
  .saved-item-move-btn {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
    padding: 9px 14px;
    margin-top: 4px;
  }

  /* Show sticky CTA on tablets/phones */
  .cart-mobile-cta { display: flex; }

  /* Crosssell scroll snap */
  .crosssell-scroll { gap: 14px; padding: 0 4px 6px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .crosssell-card { flex: 0 0 200px; scroll-snap-align: start; }
  .crosssell-img { height: 156px; }

  /* Shipping bar tighter */
  .shipping-progress-wrap {
    padding: 14px 16px;
    border-radius: 12px;
    gap: 12px;
  }
  .ship-prog-icon { width: 38px; height: 38px; }

  /* Disable 3D tilt on touch devices to avoid jank */
  .crosssell-card { transform: none !important; }
}

/* Mobile ≤ 600 */
@media (max-width: 600px) {
  .cart-hero h1 { font-size: clamp(1.95rem, 8vw, 2.6rem); }
  .cart-count-badge { font-size: .68rem; padding: 5px 12px 5px 6px; }
  .cart-count-badge .badge-num { width: 20px; height: 20px; font-size: .64rem; }
  .cart-breadcrumb { font-size: .68rem; margin-bottom: 18px; }

  .cart-items-head { margin-bottom: 14px; }
  .cart-items-head h2 { font-size: 1.4rem; }

  .cart-item {
    grid-template-columns: 84px 1fr !important;
    padding: 14px !important;
    gap: 12px !important;
  }
  .cart-item-img { width: 84px !important; height: 84px !important; }
  .cart-item-name { font-size: 1rem; }
  .cart-item-badges { gap: 4px; margin-bottom: 6px; }
  .cart-item-badge { font-size: .58rem; padding: 2px 8px; }
  .cart-item-sku { font-size: .65rem; margin-bottom: 8px; }
  .cart-item-left-actions { gap: 12px; }
  .cart-item-price { font-size: 1.15rem; }
  .cart-item-price-old { font-size: .68rem; }

  .summary-total-val { font-size: 1.65rem; }
  .summary-header h2 { font-size: 1.3rem; }
  .delivery-text { font-size: .72rem; }

  .cart-crosssell h2 { font-size: 1.6rem; margin-bottom: 22px; }
  .crosssell-card { flex: 0 0 76vw !important; max-width: 260px; }
  .crosssell-img { height: 168px; }
}

/* Tiny mobile ≤ 400 */
@media (max-width: 400px) {
  .cart-hero { padding: 88px 16px 36px; }
  .cart-body { padding: 24px 12px 110px !important; }
  .cart-crosssell { padding: 36px 14px; }

  .cart-item {
    grid-template-columns: 72px 1fr !important;
    padding: 12px !important;
    gap: 10px !important;
  }
  .cart-item-img { width: 72px !important; height: 72px !important; }
  .cart-item-name { font-size: .95rem; }
  .cart-item-meta { gap: 8px; }
  .cart-item-meta-row { font-size: .68rem; }
  .cart-item-meta-row svg { width: 10px; height: 10px; }

  .cart-item-right { gap: 8px; }
  .qty-btn { width: 36px; height: 36px; }
  .qty-val { min-width: 32px; }

  .cart-mobile-cta { left: 8px; right: 8px; padding: 10px 12px; border-radius: 14px; }
  .mcc-total { font-size: 1.05rem; }
  .mcc-btn { padding: 10px 16px; font-size: .7rem; gap: 4px; }

  .cart-saved-head h3 { font-size: 1.05rem; }
}

/* ═══════════════════════════════════════════════════════════
   SCROLL-REVEAL — cart-specific motion variants
   Builds on the global .reveal / .reveal-X / [data-stagger] system.
═══════════════════════════════════════════════════════════ */

/* Smoother, longer transitions for cart sections specifically */
.cart-body .reveal,
.cart-crosssell .reveal {
  transition: opacity .85s cubic-bezier(.22,.94,.36,1),
              transform .85s cubic-bezier(.22,.94,.36,1) !important;
}

/* Cart items: slide from the left + extra stagger via --i index */
.cart-left .cart-item.reveal {
  transform: translate3d(-56px, 18px, 0);
  transition-delay: calc(var(--i, 0) * 90ms) !important;
}
.cart-left .cart-item.reveal.visible { transform: translate3d(0, 0, 0); }

/* Saved items: slide from the left, lighter offset */
.saved-item.reveal {
  transform: translate3d(-32px, 12px, 0);
}
.saved-item.reveal.visible { transform: translate3d(0, 0, 0); }

/* Summary card: slide from right + slight scale-up */
.cart-summary.reveal.reveal-right {
  transform: translate3d(56px, 0, 0) scale(.96);
  transition-duration: 1s !important;
}
.cart-summary.reveal.reveal-right.visible {
  transform: translate3d(0, 0, 0) scale(1);
}

/* Summary body rows stagger as the card lands */
.summary-body[data-stagger] > .reveal {
  transition-duration: .65s !important;
}
.summary-body[data-stagger] > .reveal:nth-child(1) { transition-delay: .35s !important; }
.summary-body[data-stagger] > .reveal:nth-child(2) { transition-delay: .42s !important; }
.summary-body[data-stagger] > .reveal:nth-child(3) { transition-delay: .49s !important; }
.summary-body[data-stagger] > .reveal:nth-child(4) { transition-delay: .56s !important; }
.summary-body[data-stagger] > .reveal:nth-child(n+5) { transition-delay: .63s !important; }

/* Delivery estimate: zoom-in + icon rotate */
.delivery-estimate.reveal {
  transform: scale(.85) translateY(8px);
}
.delivery-estimate.reveal svg {
  transition: transform .8s cubic-bezier(.34,1.56,.64,1) .25s;
  transform: rotate(-90deg);
}
.delivery-estimate.reveal.visible svg { transform: rotate(0); }

/* Checkout button: zoom-pop into place */
.checkout-btn.reveal.reveal-zoom {
  transform: scale(.85);
  transition: opacity .7s ease, transform .7s cubic-bezier(.34,1.56,.64,1) !important;
}
.checkout-btn.reveal.reveal-zoom.visible { transform: scale(1); }

/* Trust badges: scaled-up pop with stagger */
.summary-trust[data-stagger] > .trust-item.reveal {
  transform: translate3d(0, 14px, 0) scale(.78);
  transition: opacity .55s ease, transform .55s cubic-bezier(.34,1.56,.64,1) !important;
}
.summary-trust[data-stagger] > .trust-item.reveal.visible {
  transform: translate3d(0, 0, 0) scale(1);
}

/* Crosssell cards: slide-up + 3D tilt as they enter */
.crosssell-card.reveal {
  transform: translate3d(0, 50px, 0) rotateX(10deg);
  transform-origin: center bottom;
  transition: opacity 1s cubic-bezier(.22,.94,.36,1),
              transform 1s cubic-bezier(.22,.94,.36,1) !important;
}
.crosssell-card.reveal.visible {
  transform: translate3d(0, 0, 0) rotateX(0deg);
}

/* Crosssell scroll children stagger */
.crosssell-scroll[data-stagger] > .reveal:nth-child(1) { transition-delay: .05s !important; }
.crosssell-scroll[data-stagger] > .reveal:nth-child(2) { transition-delay: .15s !important; }
.crosssell-scroll[data-stagger] > .reveal:nth-child(3) { transition-delay: .25s !important; }
.crosssell-scroll[data-stagger] > .reveal:nth-child(4) { transition-delay: .35s !important; }
.crosssell-scroll[data-stagger] > .reveal:nth-child(5) { transition-delay: .45s !important; }

/* Cart-saved-head: rule line draws across when section enters */
.cart-saved-head.reveal .cart-saved-rule {
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform .9s cubic-bezier(.22,.94,.36,1) .3s;
}
.cart-saved-head.reveal.visible .cart-saved-rule { transform: scaleX(1); }

/* Section h2 (crosssell): underline accent draws in */
.cart-crosssell h2.reveal {
  position: relative; padding-bottom: 14px;
}
.cart-crosssell h2.reveal::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #000000, rgba(74,74,74,.2) 70%, transparent);
  transition: width 1s cubic-bezier(.22,.94,.36,1) .35s;
}
.cart-crosssell h2.reveal.visible::after { width: 96px; }

/* Cart items header: rule line accent draws in */
.cart-items-head.reveal {
  position: relative; padding-bottom: 12px;
}
.cart-items-head.reveal::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: linear-gradient(90deg, #000000, transparent);
  transition: width .9s cubic-bezier(.22,.94,.36,1) .25s;
}
.cart-items-head.reveal.visible::after { width: 64px; }

/* Shipping-progress: bar stays at 0 until visible, then fills.
   Use :not(.visible) so the visible-state rule (and any inline `style.width`
   set by JS after AJAX cart updates) wins without needing !important. */
.shipping-progress-wrap.reveal:not(.visible) .ship-bar-fill {
  width: 0;
  transition: width 1.2s cubic-bezier(.22,.94,.36,1) .4s;
}
.shipping-progress-wrap.reveal.visible .ship-bar-fill {
  width: var(--target-w, 72%);
  transition: width 1.2s cubic-bezier(.22,.94,.36,1);
}

/* Coupon toggle: slight slide-up on entry */
.coupon-toggle.reveal {
  transform: translate3d(0, 14px, 0);
}
.coupon-toggle.reveal.visible { transform: translate3d(0, 0, 0); }

/* Continue-shopping: gentle fade + horizontal slide */
.cart-continue.reveal.reveal-fade {
  transform: translate3d(-12px, 0, 0);
}
.cart-continue.reveal.reveal-fade.visible { transform: translate3d(0, 0, 0); }

/* ═══════════════════════════════════════════════════════════
   DATA-ANIM CASCADE — fine-grained per-element entrance motion
   Every element with [data-anim] is hidden until its closest
   [data-cascade] parent enters the viewport, then JS stamps
   `.in` on each descendant with a staggered delay.
═══════════════════════════════════════════════════════════ */

[data-anim] {
  opacity: 0;
  transition: opacity .8s cubic-bezier(.22,.94,.36,1),
              transform .8s cubic-bezier(.22,.94,.36,1),
              filter .7s ease,
              clip-path .9s cubic-bezier(.22,.94,.36,1);
  will-change: transform, opacity;
}

/* Variants — initial states */
[data-anim="fade"]   { transform: none; }
[data-anim="up"]     { transform: translate3d(0, 28px, 0); }
[data-anim="up-sm"]  { transform: translate3d(0, 14px, 0); }
[data-anim="down"]   { transform: translate3d(0, -22px, 0); }
[data-anim="left"]   { transform: translate3d(-32px, 0, 0); }
[data-anim="right"]  { transform: translate3d( 32px, 0, 0); }
[data-anim="zoom"]   { transform: scale(.86); }
[data-anim="pop"]    { transform: scale(.4); }
[data-anim="rotate"] { transform: rotate(-10deg) scale(.92); transform-origin: center; }
[data-anim="blur"]   { filter: blur(10px); transform: scale(1.02); }
[data-anim="flipX"]  { transform: perspective(700px) rotateX(35deg); transform-origin: center bottom; }
[data-anim="flipY"]  { transform: perspective(700px) rotateY(28deg); transform-origin: left center; }
[data-anim="drawX"]  { transform: scaleX(0); transform-origin: left center; }
[data-anim="drawY"]  { transform: scaleY(0); transform-origin: top center; }
[data-anim="slide-up-blur"] { transform: translate3d(0, 22px, 0); filter: blur(8px); }
[data-anim="tilt-up"] { transform: translate3d(0, 28px, 0) rotateX(14deg); transform-origin: center bottom; perspective: 800px; }

/* Final state — applied by JS after stagger delay */
[data-anim].in {
  opacity: 1;
  transform: none;
  filter: none;
  clip-path: none;
}

/* Bouncy variants use spring-y easing on the .in state */
[data-anim="pop"],
[data-anim="zoom"] {
  transition-timing-function: cubic-bezier(.34,1.56,.64,1);
  transition-duration: .7s;
}

/* Snappier for small UI dots/icons */
[data-anim="pop"]    { transition-duration: .55s; }
[data-anim="rotate"] { transition-duration: .7s; }
[data-anim="drawX"], [data-anim="drawY"] { transition-duration: 1s; }

/* ── Hover micro-motion on tagged interactive elements ──── */
[data-anim].in.cart-item-meta-row:hover { transform: translateY(-1px); color: #000000; transition: transform .2s, color .2s; }
[data-anim].in.cart-item-badge:hover    { transform: translateY(-1px) scale(1.04); transition: transform .2s; }

/* ═══════════════════════════════════════════════════════════
   HERO STEP DOT / LINE — viewport entrance
═══════════════════════════════════════════════════════════ */
.cart-step .cart-step-dot[data-anim="pop"] { transform: scale(.3); }
.cart-step-line[data-anim="drawX"] { transform: scaleX(0); }
.cart-step-line[data-anim="drawX"].in { transform: scaleX(1); }

/* ═══════════════════════════════════════════════════════════
   SHIPPING — viewport-driven bar + icon
═══════════════════════════════════════════════════════════ */
.ship-prog-icon[data-anim="rotate"] { transform: rotate(-90deg) scale(.6); }
.ship-prog-icon[data-anim="rotate"].in { transform: rotate(0deg) scale(1); }

/* ═══════════════════════════════════════════════════════════
   IMAGE BLUR-CLEAR ON ENTRY — for product images
═══════════════════════════════════════════════════════════ */
.cart-item-img[data-anim="blur"],
.saved-item-img[data-anim="blur"],
.crosssell-img[data-anim="blur"] {
  filter: blur(14px) saturate(.7);
  transform: scale(1.08);
}
.cart-item-img[data-anim="blur"].in,
.saved-item-img[data-anim="blur"].in,
.crosssell-img[data-anim="blur"].in {
  filter: blur(0) saturate(1);
  transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════
   BADGE / CHIP POP — letter-by-letter feel for short tags
═══════════════════════════════════════════════════════════ */
.cart-item-badge[data-anim="pop"] {
  transform: scale(.4) translateY(6px);
}
.cart-item-badge[data-anim="pop"].in {
  transform: scale(1) translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   QUANTITY STEPPER — viewport entrance
═══════════════════════════════════════════════════════════ */
.qty-stepper[data-anim="zoom"] { transform: scale(.7); }
.qty-stepper[data-anim="zoom"].in { transform: scale(1); }
.qty-btn[data-anim="pop"] { transform: scale(.3) rotate(-25deg); }
.qty-btn[data-anim="pop"].in { transform: scale(1) rotate(0); }

/* ═══════════════════════════════════════════════════════════
   PRICE TAGS — slide + scale
═══════════════════════════════════════════════════════════ */
.cart-item-price[data-anim="up"]     { transform: translate3d(0, 14px, 0); letter-spacing: .15em; opacity: 0; }
.cart-item-price[data-anim="up"].in  { transform: translate3d(0, 0, 0);    letter-spacing: 0;     opacity: 1; }

/* ═══════════════════════════════════════════════════════════
   CHECKOUT BUTTON — extra dramatic entrance
═══════════════════════════════════════════════════════════ */
.checkout-btn[data-anim="zoom"] {
  transform: scale(.6) translateY(8px);
  filter: blur(2px);
}
.checkout-btn[data-anim="zoom"].in {
  transform: scale(1) translateY(0);
  filter: blur(0);
  transition-duration: .9s;
  transition-timing-function: cubic-bezier(.34,1.56,.64,1);
}

/* ═══════════════════════════════════════════════════════════
   SUMMARY DIVIDER — line draws across
═══════════════════════════════════════════════════════════ */
.summary-divider[data-anim="drawX"] { transform: scaleX(0); }
.summary-divider[data-anim="drawX"].in { transform: scaleX(1); }

/* ═══════════════════════════════════════════════════════════
   CONTINUE-SHOPPING — arrow flies in from right
═══════════════════════════════════════════════════════════ */
.cart-continue[data-anim="left"] svg { transform: translateX(20px); transition: transform .9s cubic-bezier(.34,1.56,.64,1); }
.cart-continue[data-anim="left"].in svg { transform: translateX(0); }

/* ═══════════════════════════════════════════════════════════
   CROSSSELL CARDS — full 3D tilt entrance
═══════════════════════════════════════════════════════════ */
.crosssell-card[data-anim="tilt-up"] {
  transform: perspective(900px) translate3d(0, 60px, 0) rotateX(18deg) scale(.95);
  transform-origin: center bottom;
}
.crosssell-card[data-anim="tilt-up"].in {
  transform: perspective(900px) translate3d(0, 0, 0) rotateX(0) scale(1);
  transition-duration: 1.1s;
}

/* ═══════════════════════════════════════════════════════════
   CART HERO — page-load + scroll-tag hybrid
═══════════════════════════════════════════════════════════ */
.cart-hero [data-anim] { transition-delay: 0ms; } /* hero uses our own page-load timing */
.cart-hero [data-anim].in { /* nothing — keep .in for symmetry */ }

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION — kill non-essential animations
═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .cart-hero .orb-1, .cart-hero .orb-2,
  .cart-step.active .cart-step-dot,
  .ship-bar-fill { animation: none !important; }
  .cart-toast { transition: opacity .2s ease; transform: none; }

  .cart-hero-inner > .cart-breadcrumb,
  .cart-hero-inner > .cart-steps,
  .cart-hero-inner > h1,
  .cart-hero-inner > .cart-count-badge,
  .cart-step-line,
  .cart-step .cart-step-dot,
  .cart-hero h1 em,
  .summary-card,
  .coupon-toggle,
  .mcc-btn::before { animation: none !important; }
  .cart-item:hover { transform: none; }
  .cart-mobile-cta { transition: opacity .2s ease; transform: none; }

  .cart-body .reveal,
  .cart-crosssell .reveal {
    transition-duration: .25s !important;
    transition-delay: 0s !important;
  }
  .cart-body .reveal,
  .cart-crosssell .reveal { transform: none !important; }
  .cart-crosssell h2.reveal::after,
  .cart-items-head.reveal::after { transition: none !important; width: 64px !important; }
  .cart-saved-head.reveal .cart-saved-rule { transform: scaleX(1) !important; }
  .delivery-estimate.reveal svg { transform: none !important; }

  /* Neutralize all data-anim variants */
  [data-anim] {
    transition-duration: .25s !important;
    transition-delay: 0s !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
  }
}
