/* Shared cart drawer — used by every store page except store.html, which
   has its own copy of this same markup/styling already baked in (it was
   the original implementation this was extracted from). Self-contained:
   no dependency on store-common.css or any page-specific stylesheet. */

.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.cart-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer { position: fixed; top: 0; right: -440px; width: 420px; max-width: 100vw; height: 100vh; background: #111; border-left: 1px solid rgba(255,255,255,0.1); z-index: 201; display: flex; flex-direction: column; transition: right 0.3s ease; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
.cart-drawer.open { right: 0; }
.cart-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.cart-header h2 { font-size: 18px; font-weight: 700; color: #fff; }
.cart-header .cart-count { font-size: 13px; color: rgba(255,255,255,0.65); font-weight: 400; margin-left: 8px; }
.cart-close { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: rgba(255,255,255,0.5); background: none; border: none; cursor: pointer; border-radius: 6px; transition: all 0.15s; }
.cart-close:hover { color: #fff; background: rgba(255,255,255,0.05); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-empty { text-align: center; padding: 48px 0; color: rgba(255,255,255,0.6); }
.cart-empty i { font-size: 48px; display: block; margin-bottom: 12px; color: rgba(255,255,255,0.1); }
.cart-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cart-item-img { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #1A1A1A; flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-details { flex: 1; min-width: 0; }
.cart-item-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-variant { font-size: 12px; color: rgba(255,255,255,0.62); margin-bottom: 8px; }
.cart-item-qty { display: flex; align-items: center; gap: 0; }
.cart-drawer .qty-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); cursor: pointer; transition: all 0.15s; }
.cart-drawer .qty-btn:first-child { border-radius: 6px 0 0 6px; }
.cart-drawer .qty-btn:last-child { border-radius: 0 6px 6px 0; }
.cart-drawer .qty-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.cart-drawer .qty-val { width: 36px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,255,255,0.04); border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-item-price { font-size: 14px; font-weight: 700; color: #fff; }
.cart-item-remove { font-size: 16px; color: rgba(255,255,255,0.25); background: none; border: none; cursor: pointer; transition: color 0.15s; }
.cart-item-remove:hover { color: #EF4444; }
.cart-footer { padding: 20px 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.cart-subtotal { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cart-subtotal-label { font-size: 14px; color: rgba(255,255,255,0.5); }
.cart-subtotal-val { font-size: 20px; font-weight: 800; color: #fff; }
.cart-checkout-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px; font-size: 14px; font-weight: 700; color: #fff; background: #CC1F1F; border: none; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
.cart-checkout-btn:hover { background: #B01A1A; }
.cart-continue { display: block; text-align: center; margin-top: 12px; font-size: 13px; color: rgba(255,255,255,0.65); cursor: pointer; background: none; border: none; width: 100%; transition: color 0.15s; }
.cart-continue:hover { color: #fff; }

@media (max-width: 480px) {
  .cart-drawer { width: 100vw; right: -100vw; }
}

body.light .cart-drawer { background: #fff; border-left-color: #E8E8E8; }
body.light .cart-header h2 { color: #111; }
body.light .cart-header .cart-count { color: #888; }
body.light .cart-close { color: #999; }
body.light .cart-close:hover { color: #111; background: rgba(0,0,0,0.04); }
body.light .cart-item { border-bottom-color: #EEE; }
body.light .cart-item-img { background: #F0F0F0; }
body.light .cart-item-title { color: #111; }
body.light .cart-item-variant { color: #888; }
body.light .cart-drawer .qty-btn { color: #666; background: #F5F5F5; border-color: #DDD; }
body.light .cart-drawer .qty-btn:hover { color: #111; background: #EEE; }
body.light .cart-drawer .qty-val { color: #111; background: #FAFAFA; border-color: #DDD; }
body.light .cart-item-price { color: #111; }
body.light .cart-item-remove { color: #CCC; }
body.light .cart-item-remove:hover { color: #EF4444; }
body.light .cart-footer { border-top-color: #EEE; }
body.light .cart-subtotal-label { color: #888; }
body.light .cart-subtotal-val { color: #111; }
body.light .cart-empty { color: rgba(0,0,0,0.3); }
body.light .cart-empty i { color: rgba(0,0,0,0.1); }
