/* ===== CART PAGE STYLES ===== */
.cart-main {
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
  min-height: 100vh;
  padding: 32px 0 64px;
}

/* Cart Header */
.cart-header {
  text-align: center;
  margin-bottom: 28px;
}

.cart-title {
  font-size: 42px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 15px;
}

.cart-title i {
  color: #667eea;
}

.cart-subtitle {
  font-size: 18px;
  color: #6c757d;
  margin: 0;
}

/* Empty Cart */
.empty-cart {
  background: white;
  border-radius: 25px;
  padding: 80px 40px;
  text-align: center;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.08);
  display: none;
}

.empty-cart-icon {
  font-size: 120px;
  color: #e9ecef;
  margin-bottom: 30px;
}

.empty-cart h3 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 15px;
}

.empty-cart p {
  font-size: 18px;
  color: #6c757d;
  margin-bottom: 30px;
}

.btn-shopping {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-shopping:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
  color: white;
}
/* Cart Items Card */
.cart-items-card {
  background: white;
  border-radius: 25px;
  padding: 30px;
}

.cart-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.cart-items-header h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.btn-clear-cart {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  color: #dc3545;
  border: 2px solid #dc3545;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-clear-cart:hover {
  background: #dc3545;
  color: white;
}

/* Cart Item */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 14px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.cart-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.cart-item-image {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cart-item:hover .cart-item-image img {
  transform: scale(1.1);
}

.cart-item-details {
  text-align: left; /* style.css căn giữa toàn bộ <main> */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-price {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.item-quantity {
  display: flex;
  align-items: center;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  background: white;
}

.btn-qty {
  width: 40px;
  height: 40px;
  background: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  color: #667eea;
}

.btn-qty:hover {
  background: #667eea;
  color: white;
}

.qty-value {
  width: 60px;
  height: 40px;
  border: none;
  border-left: 2px solid #e9ecef;
  border-right: 2px solid #e9ecef;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  background: white;
}

.btn-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: white;
  border: 2px solid #dc3545;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #dc3545;
  font-size: 18px;
}

.btn-remove:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

.summary-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.summary-details {
  margin-bottom: 25px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 16px;
}

.summary-row span:first-child {
  color: #6c757d;
}

.summary-value {
  font-weight: 700;
  color: #1a1a1a;
}

.summary-divider {
  height: 2px;
  background: #e9ecef;
  margin: 20px 0;
}

.summary-total {
  font-size: 20px;
  margin-bottom: 0;
}

.summary-total .summary-value {
  font-size: 28px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Coupon Section */
.coupon-section {
  margin-bottom: 20px;
}

.coupon-input-group {
  display: flex;
  gap: 10px;
}

.coupon-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 10px;
  font-size: 15px;
  transition: all 0.3s ease;
}

.coupon-input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-apply-coupon {
  padding: 12px 24px;
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-apply-coupon:hover {
  background: #667eea;
  color: white;
}

/* Lưới giỏ hàng: gỡ giới hạn "* { max-width: 100% }" trong style.css,
   nếu không .row không giãn ra bù lề âm của gutter và các cột bị lệch. */
#cart-items-wrapper { max-width: none; }

/* Điện thoại: mỗi sản phẩm là một hàng ngang gọn, một màn hình thấy được nhiều sản phẩm */
@media (max-width: 767px) {
  .cart-main { padding: 16px 0 40px; }
  .cart-header { margin-bottom: 16px; }
  .cart-header h1 { font-size: 1.4rem; margin-bottom: 4px; }
  .cart-title { font-size: 24px; }
  .cart-subtitle { font-size: 14px; }

  #cart-items-wrapper { --bs-gutter-y: 1rem; }

  .cart-items-card {
    padding: 14px;
    border-radius: 16px;
  }

  .cart-items-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .cart-items-header h3 { font-size: 18px; }
  .btn-clear-cart {
    padding: 6px 12px;
    font-size: 13px;
    border-width: 1.5px;
    border-radius: 8px;
  }

  .cart-item {
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 12px;
  }
  .cart-item:last-child { margin-bottom: 0; }
  .cart-item:hover { transform: none; }
  .cart-item:hover .cart-item-image img { transform: none; }

  .cart-item-image {
    width: 72px;
    height: 72px;
    border-radius: 10px;
  }

  .cart-item-details { min-width: 0; gap: 6px; }
  .cart-item-name { font-size: 15px; line-height: 1.3; margin-bottom: 0; }
  .cart-item-price { font-size: 16px; }

  .cart-item-actions { justify-content: space-between; gap: 10px; }
  .item-quantity { border-width: 1.5px; border-radius: 8px; }
  .btn-qty { width: 30px; height: 30px; font-size: 15px; }
  .qty-value { width: 38px; height: 30px; font-size: 14px; }
  .btn-remove {
    width: 30px;
    height: 30px;
    font-size: 15px;
    border-width: 1.5px;
    border-radius: 8px;
  }
  .btn-remove:hover { transform: none; }

  .summary-title { font-size: 18px; margin-bottom: 12px; padding-bottom: 10px; }
  .summary-details { margin-bottom: 14px; }
  .summary-row { margin-bottom: 8px; font-size: 14px; }
  .summary-divider { margin: 12px 0; }
  .summary-total { font-size: 16px; }
  .summary-total .summary-value { font-size: 22px; }

  /* Mã giảm giá: ô nhập và nút nằm cùng một hàng */
  .coupon-section { margin-bottom: 12px; }
  .coupon-input-group { gap: 8px; }
  .coupon-input { min-width: 0; padding: 10px 12px; font-size: 16px; } /* >= 16px để iOS không tự phóng to */
  .btn-apply-coupon { padding: 10px 14px; font-size: 14px; }

  .empty-cart { padding: 40px 20px; border-radius: 16px; }
  .empty-cart-icon { font-size: 64px; margin-bottom: 16px; }
  .empty-cart h3 { font-size: 22px; margin-bottom: 8px; }
  .empty-cart p { font-size: 15px; margin-bottom: 20px; }
  .btn-shopping { padding: 12px 28px; font-size: 16px; }

  .cart-notification {
    right: -100%;
    max-width: calc(100% - 40px);
  }
}