/* ============================================
   URBot Cart Widget — badge + slide-out drawer
   ============================================ */

/* ---- Floating badge (bottom-right) ---- */
.urbot-cart-badge {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.urbot-cart-badge:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.55);
}
.urbot-cart-badge[data-count="0"] {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.6);
}
.urbot-cart-badge .cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: system-ui, sans-serif;
}

/* ---- Drawer overlay ---- */
.urbot-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}
.urbot-cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ---- Drawer panel ---- */
.urbot-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  width: 380px;
  max-width: 90vw;
  background: #0f0f23;
  color: #e2e8f0;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, sans-serif;
}
.urbot-cart-overlay.open .urbot-cart-drawer {
  transform: translateX(0);
}

/* Drawer header */
.urbot-cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.urbot-cart-drawer-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.urbot-cart-drawer-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.urbot-cart-drawer-close:hover { color: #fff; }

/* Drawer body */
.urbot-cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* Cart item */
.urbot-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.urbot-cart-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.urbot-cart-item-avatar img {
  width: 32px;
  height: 32px;
}
.urbot-cart-item-info {
  flex: 1;
  min-width: 0;
}
.urbot-cart-item-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.urbot-cart-item-tier {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.urbot-cart-item-tier select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
}
.urbot-cart-item-price {
  font-weight: 700;
  font-size: 14px;
  color: #a78bfa;
  white-space: nowrap;
}
.urbot-cart-item-remove {
  background: none;
  border: none;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.urbot-cart-item-remove:hover { color: #ef4444; }

/* Empty cart */
.urbot-cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}
.urbot-cart-empty-icon { font-size: 48px; margin-bottom: 12px; }
.urbot-cart-empty p { margin: 8px 0; }

/* Synergy badges */
.urbot-cart-synergies {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.urbot-cart-synergies h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin: 0 0 8px;
}
.urbot-cart-synergy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 4px 12px;
  margin: 4px 4px 4px 0;
  font-size: 12px;
  color: #c4b5fd;
}
.urbot-cart-synergy-badge.complete {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}
.urbot-cart-synergy-bonus {
  font-weight: 700;
  font-size: 11px;
}

/* Strength meter */
.urbot-cart-strength {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.urbot-cart-strength-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
}
.urbot-cart-strength-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
.urbot-cart-strength-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background 0.5s ease;
}

/* Drawer footer */
.urbot-cart-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.urbot-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.urbot-cart-total-amount { color: #a78bfa; font-size: 20px; }
.urbot-cart-checkout-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity 0.2s;
}
.urbot-cart-checkout-btn:hover { opacity: 0.9; }

/* Toast notification */
.urbot-cart-toast {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9997;
  background: #1e1b4b;
  color: #c4b5fd;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-family: system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.3);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
.urbot-cart-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile */
@media (max-width: 640px) {
  .urbot-cart-badge {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  .urbot-cart-toast {
    bottom: 74px;
    right: 16px;
    left: 16px;
    text-align: center;
  }
}
