/* ===========================
   CART.CSS - Gio hang sidebar
   =========================== */

/* ===== CART SIDEBAR OVERLAY ===== */
.cart-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  backdrop-filter: blur(3px);
}

.cart-sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ===== CART SIDEBAR ===== */
.cart-sidebar {
  position: fixed;
  top: 0; right: 0;
  width: 420px;
  height: 100vh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.2);
}

.cart-sidebar.open {
  transform: translateX(0);
}

/* Header */
.cart-sidebar-header {
  background: #1A1A1A;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.cart-sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-sidebar-title-icon {
  width: 36px; height: 36px;
  background: #D0021B;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.cart-sidebar-count {
  background: #D0021B;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.cart-sidebar-close {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
}

.cart-sidebar-close:hover {
  background: #D0021B;
  transform: rotate(90deg);
}

/* Progress bar mua them */
.cart-progress-bar {
  background: #f5f5f5;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.cart-progress-text {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.cart-progress-text strong { color: #D0021B; }

.cart-progress-track {
  height: 5px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.cart-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #D0021B, #ff4d4d);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Body - danh sach san pham */
.cart-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.cart-sidebar-body::-webkit-scrollbar       { width: 4px; }
.cart-sidebar-body::-webkit-scrollbar-track { background: #f5f5f5; }
.cart-sidebar-body::-webkit-scrollbar-thumb { background: #D0021B; border-radius: 2px; }

/* Empty state */
.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 60px 30px;
  text-align: center;
}

.cart-empty-emoji { font-size: 80px; margin-bottom: 16px; }
.cart-empty-title { font-size: 18px; font-weight: 900; color: #1A1A1A; margin-bottom: 8px; }
.cart-empty-desc  { font-size: 14px; color: #aaa; margin-bottom: 28px; line-height: 1.6; }
.cart-empty-btn {
  background: #D0021B; color: #fff; border: none;
  border-radius: 8px; padding: 13px 28px;
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
  letter-spacing: 0.5px;
}
.cart-empty-btn:hover { background: #A30015; transform: translateY(-1px); }

/* Cart item */
.cart-sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s;
  position: relative;
}

.cart-sidebar-item:hover { background: #fafafa; }

.cart-item-img-wrap {
  width: 76px; height: 64px;
  background: linear-gradient(135deg, #f8f8f8, #efefef);
  border-radius: 8px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
  flex-shrink: 0;
  border: 1px solid #eee;
}

.cart-item-img-wrap img {
  width: 100%; height: 100%; object-fit: contain;
}

.cart-item-details { flex: 1; min-width: 0; }

.cart-item-brand {
  font-size: 10px;
  color: #D0021B;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.cart-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #1A1A1A;
  line-height: 1.4;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 900;
  color: #D0021B;
}

/* Qty control inline */
.cart-item-qty-ctrl {
  display: flex;
  align-items: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.cart-qty-btn {
  width: 28px; height: 28px;
  background: #f5f5f5;
  border: none;
  font-size: 16px;
  font-weight: 700;
  color: #444;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1;
}

.cart-qty-btn:hover { background: #D0021B; color: #fff; }

.cart-qty-num {
  width: 32px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1A1A1A;
  border-left: 1.5px solid #e0e0e0;
  border-right: 1.5px solid #e0e0e0;
  line-height: 28px;
  background: #fff;
}

.cart-item-remove {
  position: absolute;
  top: 12px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #e0e0e0;
  color: #ccc;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.cart-item-remove:hover {
  background: #D0021B;
  border-color: #D0021B;
  color: #fff;
}

/* Footer */
.cart-sidebar-footer {
  background: #fff;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

/* Summary */
.cart-summary {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

.cart-summary-label { color: #888; }
.cart-summary-value { font-weight: 700; color: #1A1A1A; }
.cart-summary-value.green { color: #00A651; }

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid #f0f0f0;
}

.cart-total-label { font-size: 15px; font-weight: 900; color: #1A1A1A; text-transform: uppercase; }
.cart-total-price { font-size: 24px; font-weight: 900; color: #D0021B; line-height: 1; }
.cart-total-vat   { font-size: 10px; color: #bbb; text-align: right; margin-top: 2px; }

/* Actions */
.cart-actions { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }

.btn-goto-cart {
  width: 100%;
  background: linear-gradient(135deg, #D0021B, #A30015);
  color: #fff; border: none; border-radius: 8px;
  padding: 15px; font-size: 15px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(208,2,27,0.35);
  font-family: inherit;
}

.btn-goto-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(208,2,27,0.5);
}

.btn-continue-shop {
  width: 100%;
  background: transparent; color: #666;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px; padding: 12px;
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  cursor: pointer; font-family: inherit; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.btn-continue-shop:hover { border-color: #D0021B; color: #D0021B; }

/* Security badges */
.cart-security {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid #f5f5f5;
  background: #fafafa;
}

.cart-security-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  color: #aaa;
  font-weight: 600;
}

.cart-security-item span:first-child { font-size: 18px; }

/* ===== FLOATING CART BTN ===== */
.floating-cart-btn {
  position: fixed;
  bottom: 32px; right: 28px;
  width: 58px; height: 58px;
  background: linear-gradient(135deg, #D0021B, #A30015);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(208,2,27,0.5);
  z-index: 9997;
  border: none;
  transition: all 0.3s;
  animation: floatBounce 3s ease-in-out infinite;
}

@keyframes floatBounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.floating-cart-btn:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 32px rgba(208,2,27,0.6);
  animation: none;
}

.floating-cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #FFD700;
  color: #1A1A1A;
  font-size: 11px;
  font-weight: 900;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  display: none;
}

/* Modal cu (an di, dung sidebar thay) */
.modal-overlay { display: none !important; }

/* Responsive */
@media (max-width: 480px) {
  .cart-sidebar { width: 100%; }
}