.cart-wrapper {
    position: relative;
    display: inline-block;
}

#cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e53935;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 50%;
    text-align: center;
    padding: 0 4px;
}

/* POP */
@keyframes cartBadgePop {
    0%   { transform: scale(0.6); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-badge-animate {
    animation: cartBadgePop 0.35s ease-out;
}

/* GLOW */
@keyframes cartBadgeGlow {
    0% { box-shadow: 0 0 0 rgba(229,57,53,0); }
    50% {
        box-shadow:
            0 0 8px rgba(229,57,53,0.8),
            0 0 14px rgba(229,57,53,0.6);
    }
    100% { box-shadow: 0 0 0 rgba(229,57,53,0); }
}

.cart-badge-glow {
    animation: cartBadgeGlow 0.6s ease-out;
}
@keyframes cartBadgePulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.cart-badge-pulse {
    animation: cartBadgePulse 0.5s ease-in-out;
}

/* ====== NHẤP NHÁY NHẸ KHI GIỎ CÓ HÀNG ====== */
@keyframes cartBadgeIdlePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(229,57,53,0);
    }
    50% {
        transform: scale(1.12);
        box-shadow:
            0 0 6px rgba(229,57,53,0.6),
            0 0 10px rgba(229,57,53,0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(229,57,53,0);
    }
}

.cart-badge-idle {
    animation: cartBadgeIdlePulse 0.6s ease-in-out;
}


/* Bọc toàn bộ bảng giỏ hàng */
.cart-table {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  font-size:14px;
  font-family: Tahoma, sans-serif;
}

/* Mỗi dòng sản phẩm */
.cart-row {
background: #fff;
  display: flex;
  flex-wrap: nowrap;
  border-bottom: 1px solid #ddd;
  padding: 10px 0;
  align-items: center;
}

/* Header */
.cart-header {
  background-color: #f5f5f5;
  font-weight: bold;
  color: #333;
}
.cart-title {
  color:#DC7110;
  margin-top:20px;
  font-weight:bold;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size:30px;
  text-align:center;
  line-height: 1.2;  /* không dùng 70px */
  padding: 15px 0;  /* thay height */
}
#message-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45); /* nền mờ */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#message {
    background: #ffffff;
    padding: 20px 28px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #0a7d2c;
    text-align: center;
    min-width: 260px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}



/* Mobile */
@media (max-width: 768px) {

  .cart-title {
    font-size: 22px;
    padding: 10px 0;
    margin-top: 10px;
    line-height: 1.3; /* đẹp, không cao quá */
  }
}

/* Cột */
.cart-col {
     align-items: center;
  flex: 1;
  padding: 8px 10px;
  box-sizing: border-box;
  font-size: 15px;
}

/* Căn chỉnh ảnh sản phẩm */
.cart-col img {
     align-items: center;
  max-width: 60px;
  height: auto;
  border: 1px solid #ccc;
  padding: 2px;
  background: #fff;
}

/* Ô số lượng */
.cart-col input[type="number"] {
     align-items: center;
  width: 60px;
  padding: 4px;
  font-size: 14px;
  text-align:center;
  font-weight:bold;
}

/* Nút thao tác */

.cart-col button {
     align-items: center;
  padding: 6px 10px;
  font-size: 15px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}
.cart-col button:hover {
     align-items: center;
  background-color: #c0392b;
}

/* Footer (tổng cộng) */
.cart-footer {
  text-align: Right;
 
  justify-content: flex-end;
  align-items: center;
  gap: 10px;              /* khoảng cách nhỏ giữa chữ và tiền */
  padding: 10px 170px;
  background-color: #f9f9f9;
  font-weight: bold;
  color: #DC7110;
  font-size: 18px;
  border-top: 1px solid #ddd;
}

.cart-footer .label {
  margin: 0;
}

.cart-footer .value {
  margin: 0;
}

/* Mobile */
@media (max-width: 768px) {
  .cart-footer {
    font-size: 16px;
    gap: 6px;        /* sát hơn xíu trên mobile */
    padding: 5px;
  }
}

.giohang #message {
    text-align: center;
    color: green;
    margin-top: 10px;
	font-size:16px;
}
/* Tùy chỉnh tỉ lệ cột (theo nhu cầu) */
.cart-col:nth-child(1) { flex: 3; } /* Tên sản phẩm */
.cart-col:nth-child(2) { flex: 1; } /* Ảnh */
.cart-col:nth-child(3),
.cart-col:nth-child(4),
.cart-col:nth-child(5),
.cart-col:nth-child(6) { flex: 1; }


/* Responsive cho mobile */
@media (max-width: 768px) {

  /* Tổng giỏ hàng thành dạng thẻ */
  .cart-table {
    border: none;
  }

  .cart-header {
    display: none; /* Ẩn tiêu đề bảng */
  }

  .cart-row {
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  .cart-col {
    width: 100%;
    flex: unset;
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
  }

  /* Hiển thị label phía trước */
  .cart-col[data-label]::before {
    content: attr(data-label);
    font-weight: bold;
    color: #333;
    margin-right: 10px;
  }

  /* Ảnh */
  .cart-col img {
    max-width: 80px !important;
    height: auto;
    border-radius: 6px;
  }

  /* Hộp số lượng */
  .qty-box {
    justify-content: flex-end;
  }

  /* Input số lượng nhỏ hơn */
  .qty-box input {
    width: 45px !important;
    height: 30px;
    font-size: 15px;
  }

  /* Footer tổng cộng */
  .cart-footer {
    flex-direction: column;
    text-align: right;
    gap: 8px;
    font-size: 16px;
    padding: 10px 0;
  }

  /* Căn nút */
  .cart-col button {
    width: auto;
    font-size: 14px;
    padding: 6px 12px;
  }

}
.qty-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.qty-box input {
  width: 40px !important;
  height: 25px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Nút giảm */
button.btn-minus {
  background-color: #e74c3c !important; /* đỏ */
  color: #fff !important;
  width: 35px;
  height: 33px;
  font-size: 20px;
  border-radius: 6px;
  border: none !important;
}

/* Nút tăng */
button.btn-plus {
  background-color: #27ae60 !important; /* xanh lá */
  color: #fff !important;
  width: 35px;
  height: 33px;
  font-size: 20px;
  border-radius: 6px;
  border: none !important;
}

button.btn-minus:hover {
  background-color: #c0392b !important;
}

button.btn-plus:hover {
  background-color: #1e8449 !important;
}

.cart-buttons button {
  transition: 0.25s ease;
  font-weight: bold;
  transform-origin: center;
  margin: 0 10px;      /* khoảng cách an toàn khi hover */
}

/* Hiệu ứng hover không bị chồng nhau */
.cart-buttons button:hover {
  transform: scale(1.05);
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 2;          /* giữ nút nổi nhưng không đè nút kia */
}


/* Nút xanh dương */
.cart-buttons .btn-blue {
  background: #3498db;
}
.cart-buttons .btn-blue:hover {
  background: #2980b9;
}

/* Nút xanh lá */
.cart-buttons .btn-green {
  background: #2ecc71;
}
.cart-buttons .btn-green:hover {
  background: #27ae60;
}


/* Mobile */
@media (max-width: 768px) {
  .cart-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
  }
  .cart-buttons button {
    width: 90%;
    max-width: 400px;
    margin: 0 !important;
  }
}

