/* Cart drawer + toast styles */
.cart-count {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  margin-left: 8px; border-radius: 999px;
  background: rgba(255,255,255,.12); color: #fff;
  font-size: .72rem; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  vertical-align: middle;
  box-sizing: border-box;
  transition: background .2s, transform .2s;
}
.cart-btn { overflow: visible; }
.cart-btn .cart-count + .cart-count { display: none !important; } /* hard guard against duplicates */
.cart-count.has-items {
  background: linear-gradient(135deg,#7c3aed,#06b6d4);
  transform: scale(1.05);
  box-shadow: 0 0 14px rgba(124,58,237,.55);
}


/* Toast */
.tm-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(40px);
  background: linear-gradient(135deg,#0f172a,#1e1b4b);
  color: #fff; padding: 12px 22px; border-radius: 14px;
  font-weight: 600; font-size: .92rem;
  border: 1px solid rgba(124,58,237,.4);
  box-shadow: 0 16px 50px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; z-index: 9999;
  transition: opacity .25s, transform .25s;
}
.tm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Drawer */
.tm-drawer { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
.tm-drawer.open { pointer-events: auto; }
.tm-drawer-backdrop {
  position: absolute; inset: 0; background: rgba(5,4,15,.65);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s;
}
.tm-drawer.open .tm-drawer-backdrop { opacity: 1; }
.tm-drawer-panel {
  position: absolute; right: 0; top: 0; height: 100%;
  width: min(440px, 100%);
  background: linear-gradient(180deg, #0b0816, #0f0a22);
  border-left: 1px solid rgba(255,255,255,.08);
  box-shadow: -30px 0 80px rgba(0,0,0,.6);
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.tm-drawer.open .tm-drawer-panel { transform: translateX(0); }
.tm-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.tm-drawer-head h3 { margin: 0; color: #fff; font-size: 1.1rem; }
.tm-drawer-count { color: #a78bfa; font-weight: 500; margin-left: 4px; }
.tm-drawer-close {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: #fff; width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; transition: background .2s;
}
.tm-drawer-close:hover { background: rgba(255,255,255,.1); }
.tm-drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.tm-empty { text-align: center; padding: 60px 20px; color: #94a3b8; }
.tm-empty p { margin: 12px 0 22px; }

.tm-line {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px;
  padding: 14px 8px; border-bottom: 1px solid rgba(255,255,255,.06);
  align-items: center;
}
.tm-line-img {
  width: 64px; height: 64px; border-radius: 12px;
  background-size: cover; background-position: center;
  background-color: rgba(124,58,237,.15);
  border: 1px solid rgba(255,255,255,.08);
}
.tm-line-emoji { display: grid; place-items: center; font-size: 1.6rem; }
.tm-line-title { color: #fff; font-weight: 600; font-size: .92rem; line-height: 1.25; }
.tm-line-variant { color: #94a3b8; font-size: .78rem; margin-top: 2px; }
.tm-line-price { color: #fbbf24; font-weight: 700; font-size: .88rem; margin-top: 4px; }
.tm-line-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tm-qty {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 2px 4px;
}
.tm-qty button {
  background: transparent; border: 0; color: #fff;
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: 1rem;
}
.tm-qty button:hover { background: rgba(124,58,237,.3); }
.tm-qty span { color: #fff; min-width: 18px; text-align: center; font-weight: 600; }
.tm-line-remove {
  background: transparent; border: 0; color: #ef4444; cursor: pointer;
  font-size: 1rem; padding: 4px;
}

.tm-drawer-foot {
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.3);
}
.tm-drawer-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; color: #cbd5e1;
}
.tm-drawer-total { color: #fbbf24; font-size: 1.4rem; }
.tm-checkout-btn { width: 100%; justify-content: center; }
.tm-drawer-clear {
  width: 100%; margin-top: 10px; background: transparent;
  border: 1px solid rgba(255,255,255,.08); color: #94a3b8;
  padding: 8px; border-radius: 10px; cursor: pointer; font-size: .82rem;
}
.tm-drawer-clear:hover { color: #ef4444; border-color: rgba(239,68,68,.3); }

/* Add to cart button on product cards */
.pc-add-btn {
  width: 100%; margin-top: 8px; justify-content: center;
  background: linear-gradient(135deg,#7c3aed,#06b6d4);
  border: 0; color: #fff; padding: 9px 14px; border-radius: 10px;
  font-weight: 600; cursor: pointer; font-size: .85rem;
  transition: transform .15s, box-shadow .2s;
}
.pc-add-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,58,237,.4); }
