/* ==========================================================
   cart-upgrade.css  |  購物車 UI 美化 + 動畫升級
   ========================================================== */

/* ── 購物車側欄整體 ── */
.cart-sidebar {
  width: 400px !important;
  background: #0f0f0f !important;
  border-left: 1px solid #1e1e1e !important;
  box-shadow: -8px 0 40px rgba(0,0,0,.65) !important;
}
@media (max-width: 480px) {
  .cart-sidebar { width: 100% !important; }
}

/* ── 頭部 ── */
.cart-header {
  background: #111 !important;
  border-bottom: 1px solid #1a1a1a !important;
  padding: 18px 20px !important;
}
.cart-header h3 {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #f0f0f0 !important;
  letter-spacing: .02em !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-header h3::before {
  content: '';
  display: inline-block;
  width: 3px; height: 16px;
  background: linear-gradient(to bottom, #b8941f, #d4af37);
  border-radius: 2px;
}
.cart-close {
  width: 32px !important; height: 32px !important;
  border-radius: 8px !important;
  color: #666 !important;
  font-size: 20px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  transition: background .15s, color .15s !important;
}
.cart-close:hover {
  background: #1e1e1e !important;
  color: #f0f0f0 !important;
}

/* ── 商品列表 ── */
.cart-items {
  background: #0a0a0a !important;
}
.cart-item {
  padding: 14px 18px !important;
  border-bottom: 1px solid #141414 !important;
  transition: background .15s !important;
  animation: cartItemIn .2s ease both;
}
.cart-item:hover { background: #111 !important; }

@keyframes cartItemIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cart-item > img {
  width: 56px !important; height: 56px !important;
  border-radius: 10px !important;
  object-fit: cover !important;
  border: 1px solid #1e1e1e !important;
}
.cart-item-name {
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #eee !important;
  line-height: 1.3 !important;
}
.cart-item-meta {
  font-size: 12px !important;
  color: #555 !important;
  margin-top: 3px !important;
}
.cart-item-price {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #d4af37 !important;
}

/* 數量控制按鈕 */
.quantity-btn {
  width: 30px !important; height: 30px !important;
  border-radius: 8px !important;
  background: #1a1a1a !important;
  border: 1px solid #252525 !important;
  color: #ccc !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  transition: background .12s, color .12s, border-color .12s !important;
}
.quantity-btn:hover {
  background: #d4af37 !important;
  color: #1a0f00 !important;
  border-color: #d4af37 !important;
}
.cart-item-quantity {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #f0f0f0 !important;
  min-width: 24px !important;
}
.remove-btn {
  background: rgba(239,68,68,.08) !important;
  border: 1px solid rgba(239,68,68,.2) !important;
  color: #ef4444 !important;
  font-size: 16px !important;
  border-radius: 8px !important;
  transition: background .12s !important;
}
.remove-btn:hover {
  background: rgba(239,68,68,.18) !important;
}

/* 空購物車 */
.cart-empty-msg {
  padding: 48px 20px;
  text-align: center;
  color: #444;
  font-size: 14px;
  line-height: 1.8;
}
.cart-empty-msg .cart-empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
  opacity: .4;
}

/* ── 底部 ── */
.cart-footer {
  background: #0f0f0f !important;
  border-top: 1px solid #1a1a1a !important;
  padding: 16px 18px !important;
}
.cart-total {
  margin-bottom: 14px !important;
  font-size: 14px !important;
  color: #888 !important;
}
.cart-total .amount {
  font-size: 22px !important;
  font-weight: 800 !important;
  color: #d4af37 !important;
  letter-spacing: -.01em !important;
}
.cart-actions { gap: 10px !important; }

/* 清空按鈕 */
#clearCart {
  background: transparent !important;
  border: 1.5px solid #222 !important;
  color: #666 !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  padding: 9px 16px !important;
  transition: border-color .15s, color .15s !important;
}
#clearCart:hover {
  border-color: #ef4444 !important;
  color: #ef4444 !important;
}

/* 結帳按鈕 */
#goCheckout {
  background: linear-gradient(135deg, #b8941f, #d4af37) !important;
  color: #1a0f00 !important;
  border: none !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 12px !important;
  text-align: center !important;
  transition: opacity .15s !important;
  box-shadow: 0 4px 16px rgba(212,175,55,.2) !important;
}
#goCheckout:hover { opacity: .88 !important; }

/* ── 手機購物車 FAB 按鈕美化 ── */
@media (max-width: 992px) {
  #cartBtn {
    background: linear-gradient(135deg, #b8941f, #d4af37) !important;
    color: #1a0f00 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    padding: 13px 16px !important;
    border-radius: 999px !important;
    box-shadow: 0 6px 24px rgba(212,175,55,.35) !important;
    border: none !important;
    backdrop-filter: none !important;
  }
}

/* ── 加入購物車 Toast 升級 ── */
#toastContainer {
  position: fixed !important;
  bottom: 28px !important;
  right: 20px !important;
  z-index: 99999 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  pointer-events: none !important;
}
.toast {
  background: #111 !important;
  border: 1px solid #222 !important;
  border-left: 3px solid #d4af37 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  min-width: 220px !important;
  max-width: 300px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.55) !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  opacity: 0 !important;
  transform: translateX(20px) !important;
  transition: opacity .2s ease, transform .2s ease !important;
  pointer-events: auto !important;
}
.toast.show {
  opacity: 1 !important;
  transform: translateX(0) !important;
}
.toast .toast-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #f0f0f0 !important;
  line-height: 1.3 !important;
}
.toast .toast-desc {
  font-size: 12px !important;
  color: #888 !important;
  margin-top: 2px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 180px !important;
}
.toast .toast-right {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #d4af37 !important;
  white-space: nowrap !important;
  margin-left: auto !important;
}
/* Toast 前面加購物車圖示 */
.toast::before {
  content: '🛒';
  font-size: 18px;
  flex-shrink: 0;
}

/* ── 飛入購物車動畫（fly-to-cart） ── */
.fly-item {
  position: fixed;
  width: 52px; height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid #d4af37;
  box-shadow: 0 4px 20px rgba(212,175,55,.4);
  pointer-events: none;
  z-index: 99998;
  transition: none;
}
.fly-item.flying {
  transition: transform .6s cubic-bezier(.4,0,.2,1), opacity .5s ease !important;
}

/* ── 狀態顏色標籤（reply.html 頂部） ── */
.chat-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
}
.chat-status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-status-badge.open {
  background: rgba(34,197,94,.1);
  color: #4ade80;
}
.chat-status-badge.open::before { background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.chat-status-badge.closed {
  background: rgba(255,255,255,.05);
  color: #666;
}
.chat-status-badge.closed::before { background: #555; }

/* 管理員在線指示（前台顯示） */
.admin-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #4ade80;
  font-weight: 600;
}
.admin-online-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}
.admin-offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #555;
}
.admin-offline-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #333;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
