/* =====================================================================
   7thbreed — Cart UI (v1)
   Floating cart button, slide-in drawer, toasts. Brand blue #2563eb.
   ===================================================================== */

/* ---------- floating button ---------- */
#cart7b-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2147482000;
  width: 3.4rem;
  height: 3.4rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #3478ee, var(--primary, #2563eb));
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 14px 34px -8px rgba(37, 99, 235, .55);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease;
}
#cart7b-fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 18px 40px -8px rgba(37, 99, 235, .65), 0 0 0 5px rgba(37, 99, 235, .12);
}
#cart7b-fab:active { transform: scale(.96); }
#cart7b-fab .cart7b-badge {
  position: absolute;
  top: -.25rem;
  right: -.25rem;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 .3rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  animation: cart7bPop .3s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes cart7bPop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }

/* ---------- drawer ---------- */
#cart7b-drawer { position: fixed; inset: 0; z-index: 2147482500; pointer-events: none; }
#cart7b-drawer .cart7b-scrim {
  position: absolute; inset: 0;
  background: rgba(2, 6, 23, .45);
  opacity: 0;
  transition: opacity .3s ease;
}
#cart7b-drawer .cart7b-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(100%, 25rem);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(2, 6, 23, .25);
  transform: translateX(105%);
  transition: transform .38s cubic-bezier(.22, 1.1, .32, 1);
}
#cart7b-drawer.open { pointer-events: auto; }
#cart7b-drawer.open .cart7b-scrim { opacity: 1; }
#cart7b-drawer.open .cart7b-panel { transform: translateX(0); }

.cart7b-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.cart7b-head h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.cart7b-x {
  background: none; border: none; cursor: pointer;
  width: 2.2rem; height: 2.2rem; border-radius: 10px;
  display: grid; place-items: center;
  color: #64748b;
  transition: background .2s ease, color .2s ease;
}
.cart7b-x:hover { background: rgba(37, 99, 235, .1); color: var(--primary, #2563eb); }

.cart7b-items { flex: 1; overflow-y: auto; padding: .9rem 1.25rem; }

.cart7b-empty {
  height: 100%; min-height: 14rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; color: #93a3b8; text-align: center;
}
.cart7b-empty p { font-weight: 700; color: #475569; margin: .5rem 0 0; }
.cart7b-empty span { font-size: .85rem; }

.cart7b-item {
  display: flex; gap: .8rem;
  padding: .8rem 0;
  border-bottom: 1px solid #eef2f7;
  align-items: flex-start;
}
.cart7b-item:last-child { border-bottom: 0; }
.cart7b-thumb {
  width: 3.6rem; height: 3.6rem;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  flex: none;
}
.cart7b-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart7b-thumb-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-weight: 800; color: var(--primary, #2563eb);
  background: linear-gradient(135deg, #eff6ff, #e0ecff);
}
.cart7b-info { flex: 1; min-width: 0; }
.cart7b-info strong {
  display: block;
  font-size: .92rem;
  color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart7b-price { font-size: .85rem; color: var(--primary, #2563eb); font-weight: 700; }
.cart7b-qty {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-top: .45rem;
}
.cart7b-qty button {
  width: 1.55rem; height: 1.55rem;
  border-radius: 8px;
  border: 1px solid #dbe3ee;
  background: #fff;
  font-size: .95rem; line-height: 1;
  cursor: pointer;
  color: #334155;
  display: grid; place-items: center;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.cart7b-qty button:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.cart7b-qty span { min-width: 1.1rem; text-align: center; font-weight: 700; font-size: .9rem; }
.cart7b-remove {
  background: none; border: none; cursor: pointer;
  color: #b0bccd; width: 1.9rem; height: 1.9rem;
  border-radius: 8px; display: grid; place-items: center;
  transition: color .18s ease, background .18s ease;
}
.cart7b-remove:hover { color: #dc2626; background: rgba(220, 38, 38, .08); }

.cart7b-foot {
  border-top: 1px solid var(--border, #e5e7eb);
  padding: 1rem 1.25rem 1.15rem;
}
.cart7b-subtotal {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: .35rem;
}
.cart7b-subtotal span { color: #64748b; font-size: .9rem; }
.cart7b-subtotal strong { font-size: 1.2rem; color: #111827; }
.cart7b-note { font-size: .72rem; color: #93a3b8; margin: 0 0 .8rem; line-height: 1.45; }
.cart7b-checkout {
  width: 100%;
  border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: .97rem;
  color: #fff;
  padding: .85rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #3478ee, var(--primary, #2563eb));
  box-shadow: 0 12px 28px -8px rgba(37, 99, 235, .5);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease;
}
.cart7b-checkout:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px -8px rgba(37, 99, 235, .6), 0 0 0 4px rgba(37, 99, 235, .12);
}
.cart7b-checkout:active { transform: scale(.98); }
.cart7b-continue {
  width: 100%;
  margin-top: .55rem;
  background: none; border: none;
  font: inherit; font-size: .88rem; font-weight: 600;
  color: #64748b; cursor: pointer;
  padding: .4rem;
}
.cart7b-continue:hover { color: var(--primary, #2563eb); }

/* ---------- toasts ---------- */
.cart7b-toasts {
  position: fixed;
  left: 50%; bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 2147483000;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  pointer-events: none;
}
.cart7b-toast {
  display: flex; align-items: center; gap: .5rem;
  background: #0f172a;
  color: #fff;
  font-size: .85rem; font-weight: 600;
  padding: .65rem 1rem;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(2, 6, 23, .35);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.cart7b-toast svg { color: #4ade80; }
.cart7b-toast.show { opacity: 1; transform: translateY(0); }

/* Dark mode */
html.dark #cart7b-drawer .cart7b-scrim { background: rgba(2, 6, 23, .76); }
html.dark #cart7b-drawer .cart7b-panel {
  background: #0f1d34;
  color: #f8fafc;
  border-left: 1px solid #334155;
  box-shadow: -18px 0 50px rgba(0, 0, 0, .42);
}
html.dark #cart7b-drawer .cart7b-head,
html.dark #cart7b-drawer .cart7b-foot { border-color: #334155; }
html.dark #cart7b-drawer .cart7b-head h2,
html.dark #cart7b-drawer .cart7b-info strong,
html.dark #cart7b-drawer .cart7b-subtotal strong { color: #f8fafc; }
html.dark #cart7b-drawer .cart7b-x,
html.dark #cart7b-drawer .cart7b-qty span { color: #e2e8f0; }
html.dark #cart7b-drawer .cart7b-empty { color: #94a3b8; }
html.dark #cart7b-drawer .cart7b-empty p { color: #f8fafc; }
html.dark #cart7b-drawer .cart7b-item { border-color: #24344e; }
html.dark #cart7b-drawer .cart7b-thumb { background: #16263d; }
html.dark #cart7b-drawer .cart7b-thumb-fallback {
  background: linear-gradient(135deg, #142438, #1e3657);
  color: #60a5fa;
}
html.dark #cart7b-drawer .cart7b-qty button {
  background: #142438;
  border-color: #3b4d68;
  color: #e2e8f0;
}
html.dark #cart7b-drawer .cart7b-qty button:hover { background: #1b2e49; border-color: #3b82f6; }
html.dark #cart7b-drawer .cart7b-remove,
html.dark #cart7b-drawer .cart7b-subtotal span,
html.dark #cart7b-drawer .cart7b-note,
html.dark #cart7b-drawer .cart7b-continue { color: #a8b8ce; }
html.dark #cart7b-drawer .cart7b-continue:hover { color: #60a5fa; }

@media (max-width: 640px) {
  #cart7b-fab { right: .9rem; bottom: .9rem; width: 3.1rem; height: 3.1rem; }
  #cart7b-drawer .cart7b-panel { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  #cart7b-fab, .cart7b-toast, #cart7b-drawer .cart7b-panel, #cart7b-drawer .cart7b-scrim { transition: none !important; animation: none !important; }
}
