.cart-toggle-badge { position:absolute; top:-8px; right:-8px; background:#e74c3c; color:#fff; border-radius:50%; width:20px; height:20px; font-size:11px; font-weight:700; display:none; align-items:center; justify-content:center; border:2px solid #fff; }

.cart-drawer { position:fixed; top:0; right:0; bottom:0; width:380px; max-width:90vw; background:#fff; box-shadow:-10px 0 30px rgba(0,0,0,.15); z-index:10050; transform:translateX(100%); transition:transform .25s ease; display:flex; flex-direction:column; }
.cart-drawer.open { transform:translateX(0); }
.cart-head { padding:16px; border-bottom:1px solid #eee; display:flex; justify-content:space-between; align-items:center; }
.cart-body { padding:12px 16px; overflow:auto; flex:1; }
.cart-foot { padding:12px 16px; border-top:1px solid #eee; display:grid; gap:8px; }
.cart-checkout-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  touch-action: manipulation;
  position: relative;
  z-index: 2;
}
.cart-checkout-btn:active { transform: translateY(0); }
.cart-loading { display:none; align-items:center; gap:8px; color:#6b7280; font-weight:700; pointer-events:none; }
.cart-loading .spinner { width:18px; height:18px; border-radius:50%; border:3px solid #e5e7eb; border-top-color:#667eea; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Checkout overlay animation (ported from unified UI, simplified) */
.checkout-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85); backdrop-filter: blur(10px); z-index: 2147483000; display: none; align-items: center; justify-content: center; }
.checkout-overlay.active { display: flex; }
.checkout-modal { background:#fff; border-radius: 16px; width: 90%; max-width: 360px; padding: 24px; text-align:center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.checkout-spinner { width: 72px; height: 72px; margin: 0 auto 14px; position: relative; }
.checkout-spinner .ring { position:absolute; inset:0; border:4px solid #f3f3f3; border-top-color:#667eea; border-radius:50%; animation: spin 1s linear infinite; }
.checkout-spinner .ring:nth-child(2) { inset:10px; border-top-color:#f56565; animation-duration:1.4s; animation-direction: reverse; }
.checkout-spinner .ring:nth-child(3) { inset:20px; border-top-color:#10b981; animation-duration:1.8s; }
.checkout-status-title { font-weight:800; color:#111827; margin-bottom:6px; font-size:18px; }
.checkout-status-step { color:#374151; font-weight:700; font-size:14px; }
.checkout-progress { height:8px; border-radius:6px; background:#f3f4f6; overflow:hidden; margin-top:12px; }
.checkout-progress-bar { height:100%; width:10%; background: linear-gradient(135deg,#667eea,#764ba2); transition: width .4s ease; }

/* Local overlay inside cart drawer (iOS safe) */
.cart-overlay { position:absolute; inset:0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); display:none; align-items:center; justify-content:center; z-index: 10051; /* Higher than cart drawer itself */ }
.cart-overlay.active { display:flex; }
.cart-overlay .checkout-modal { width:86%; max-width:320px; }
.cart-item { display:flex; gap:10px; align-items:center; padding:8px 0; border-bottom:1px dashed #eee; }
.cart-item img { width:56px; height:56px; object-fit:cover; border-radius:8px; }
.cart-item .meta { flex:1; font-size:.9rem; }
.cart-item .rm { border:none; background:#f3f4f6; border-radius:8px; padding:6px 10px; cursor:pointer; }
.cart-item .qty-controls { display:flex; align-items:center; gap:8px; margin-top:4px; }
.cart-item .qty-controls button { width:24px; height:24px; border:1px solid #e5e7eb; border-radius:4px; background:#fff; cursor:pointer; font-weight:700; transition: all 0.2s; display:flex; align-items:center; justify-content:center; }
.cart-item .qty-controls button:hover { background:#f3f4f6; border-color:#d1d5db; }
.cart-item .qty-controls button:active { background:#e5e7eb; }
.cart-item .qty-controls span { min-width:40px; text-align:center; font-size:14px; font-weight:600; color:#374151; }

/* Mobile phones: cart becomes full-screen overlay */
@media (max-width: 600px) {
  .cart-drawer { width: 100vw; max-width: 100vw; right: 0; left: 0; box-shadow: 0 0 0 rgba(0,0,0,0); border-left: none; }
}

/* Local preview mobile mode: force full width */
body.mobile-preview .cart-drawer { width: 100vw; max-width: 100vw; right: 0; left: 0; }
