/* Cart drawer (assets/cart.js). Reuses the page tokens from index.html (--brand, --ink, --tint, --soft, --radius).
   Desktop: a panel from the inline-end edge. Phones (under 700px): a bottom sheet. Soft fills, no borders, no glows. */
#headBag { position: relative; }
.cart-badge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand, #2a0912); color: #fff; font: 500 11px/18px 'Inter', system-ui, sans-serif; letter-spacing: 0; text-align: center; pointer-events: none; }
.cart-badge.pop { animation: cart-pop .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes cart-pop { 40% { transform: scale(1.25); } }

.cart { position: fixed; inset: 0; z-index: 200; visibility: hidden; transition: visibility 0s linear .34s; }
.cart.open { visibility: visible; transition: none; }
.cart-scrim { position: absolute; inset: 0; background: rgba(42, 9, 18, .38); opacity: 0; transition: opacity .28s ease; }
.cart.open .cart-scrim { opacity: 1; }

.cart-panel { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(440px, 100vw); display: flex; flex-direction: column; background: #fff; color: var(--ink, #1c1416); box-shadow: 0 0 48px rgba(42, 9, 18, .14); transform: translateX(100%); transition: transform .34s cubic-bezier(.2, .8, .2, 1); outline: 0; overscroll-behavior: contain; padding-top: env(safe-area-inset-top); }
[dir="rtl"] .cart-panel { transform: translateX(-100%); }
.cart.open .cart-panel { transform: none; }
.cart-panel.dragging { transition: none; }

.cart-grab { display: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 6px; padding-inline-start: 20px; }
.cart-head h2 { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 500; letter-spacing: -0.02em; }
[dir="rtl"] .cart-head h2 { letter-spacing: 0; }
.cart-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--soft, #f6eee1); color: var(--brand, #2a0912); cursor: pointer; }
.cart-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.cart-x:hover { background: #efe3d1; }

.cart-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 10px 20px 16px; }

/* Line item */
.cart-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 14px; align-items: start; }
.cart-img { width: 88px; height: 88px; border-radius: 12px; object-fit: cover; background: var(--soft, #f6eee1); }
.cart-main { min-width: 0; }
.cart-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cart-name { min-width: 0; font-size: 16px; line-height: 1.35; font-weight: 500; }
.cart-price { flex: none; font-size: 16px; line-height: 1.35; font-weight: 500; white-space: nowrap; }
.cart-set { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2, #5a5053); }
.cart-remove { display: inline-flex; align-items: center; min-height: 44px; margin: 0 -8px -8px; padding: 0 8px; border: 0; background: none; color: var(--ink-2, #5a5053); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(42, 9, 18, .3); cursor: pointer; }
.cart-remove:hover { color: var(--brand, #2a0912); }
.cart-straps { grid-column: 1 / -1; display: grid; gap: 8px; }
.cart-strap { display: flex; align-items: center; gap: 10px; padding: 4px; padding-inline-end: 0; border-radius: 12px; background: #f7f7f7; }
.cart-strap img { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: #fff; }
.cart-strap select { flex: 1; min-width: 0; min-height: 44px; padding: 0 38px 0 4px; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a0912' stroke-width='1.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; appearance: none; -webkit-appearance: none; font: inherit; font-size: 16px; color: var(--ink, #1c1416); cursor: pointer; }
[dir="rtl"] .cart-strap select { padding: 0 4px 0 38px; background-position: left 12px center; }

/* Step up to the next set */
.cart-up { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px; padding-inline-start: 16px; border-radius: var(--radius, 14px); background: var(--tint, #faf4eb); }
.cart-up-txt { flex: 1; min-width: 0; }
.cart-up-txt b { display: block; font-size: 14.5px; line-height: 1.4; font-weight: 500; }
.cart-up-txt span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--ink-2, #5a5053); }
.cart-up-btn { flex: none; min-width: 64px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: #fff; color: var(--brand, #2a0912); font-size: 14.5px; font-weight: 500; cursor: pointer; }
.cart-up-btn:hover { background: var(--brand, #2a0912); color: #fff; }

/* Delivery and pay-later facts */
.cart-facts { margin-top: 16px; display: grid; gap: 10px; }
.cart-facts p { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2, #5a5053); }
.cart-facts b { font-weight: 500; color: var(--ink, #1c1416); }
.cart-facts .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--brand, #2a0912); }
.cart-bnpl-marks { flex: none; display: flex; gap: 4px; margin-top: 1px; }
.cart-bnpl-marks img { width: 30px; height: 19px; }

/* Pinned footer: subtotal, Checkout, WhatsApp, ways to pay */
.cart-foot { flex: none; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8px 24px rgba(42, 9, 18, .06); }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; }
.cart-total b { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.cart-incl { margin: 0 0 12px; font-size: 13px; color: var(--ink-2, #5a5053); }
.cart-go { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 20px; border-radius: 12px; background: var(--brand, #2a0912); color: #fff; font-size: 16.5px; font-weight: 500; text-decoration: none; }
.cart-go:hover { background: var(--brand-2, #3b0f1c); }
.cart-go .ic { width: 18px; height: 18px; }
.cart-go[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.cart-wa { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; margin-top: 8px; padding: 0 16px; border-radius: 12px; background: #f5f5f5; color: var(--ink, #1c1416); font-size: 15px; font-weight: 500; text-decoration: none; }
.cart-wa:hover { background: #ededed; }
.cart-wa svg { flex: none; width: 18px; height: 18px; fill: #1faa52; }
.cart-marks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.cart-marks img { display: block; width: 34px; height: 22px; }

/* Empty state */
.cart-empty { padding: 32px 0 24px; text-align: center; }
.cart-empty p { margin: 0; font-size: 15.5px; color: var(--ink, #1c1416); }
.cart-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; color: var(--brand, #2a0912); font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(42, 9, 18, .35); }

/* Phones: a bottom sheet */
@media (max-width: 699px) {
  .cart-panel { top: auto; inset-inline: 0; width: auto; max-height: calc(100dvh - 40px - env(safe-area-inset-top)); padding-top: 0; border-radius: 20px 20px 0 0; transform: translateY(100%); box-shadow: 0 -12px 40px rgba(42, 9, 18, .14); }
  [dir="rtl"] .cart-panel { transform: translateY(100%); }
  .cart-grab { display: flex; justify-content: center; padding: 8px 0 0; }
  .cart-grab span { width: 36px; height: 5px; border-radius: 3px; background: #ddd5cc; }
  .cart-head { padding-top: 4px; }
  .cart-body { padding: 8px 16px 14px; }
  .cart-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .cart-head { padding-inline: 16px 10px; }
  .cart-item { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .cart-img { width: 72px; height: 72px; }
}
/* The sticky bar and chat bubble step back while the drawer is open. */
body.cart-on .chat { opacity: 0; visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .cart, .cart-scrim, .cart-panel { transition: none; }
  .cart-badge.pop { animation: none; }
}
