/* Container chính */
.cart-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 40px 24px;
  background: #f3f6fa;
}

/* Cart Left */
.cart-left {
  flex: 1 1 60%;
  background: #fff;
  padding: 32px 28px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  margin-left: 0;
  min-width: 340px;
}

.cart-left h2 {
  font-size: 26px;
  margin-bottom: 8px;
  /* color: #0154b9; */
  font-weight: 700;
}

.sub-heading {
  font-size: 15px;
  color: #777;
  margin-bottom: 20px;
}

table {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border-collapse: collapse;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

th,
td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid #eaeaea;
  font-size: 17px;
  font-weight: 500;
}

thead th {
  background: #f3f6fa;
  color: #0154b9;
  font-size: 16px;
  font-weight: 700;
}

tbody tr:hover {
  background: #eaf4ff;
  transition: background 0.2s;
}

.product-info {
  display: flex;
  gap: 14px;
  align-items: center;
}

.product-info img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.product-detail {
  font-size: 15px;
}

.product-detail .product-name {
  font-weight: bold;
  color: #0051ff;
  font-size: 17px;
}

.product-note {
  color: #ef4444;
  font-size: 13px;
}

.new-price {
  font-weight: bold;
  color: #d32f2f;
  font-size: 18px;
}

.old-price {
  text-decoration: line-through;
  font-size: 13px;
  color: #9ca3af;
}

.discount {
  color: #9CA3AF;
  font-size: 13px;
}

.quantity {
  /* display: flex; */
  align-items: center;
  gap: 8px;
}

.quantity button {
  width: 32px;
  height: 32px;
  background-color: #e0e6f5;
  border: none;
  border-radius: 6px;
  color: #0154b9;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s;
}

.quantity button:hover {
  background-color: #0154b9;
  color: #fff;
}

.quantity input {
  width: 40px;
  height: 32px;
  text-align: center;
  background-color: #f3f6fa;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  outline: none;
}

.delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 18px;
  transition: color 0.2s;
}

.delete-btn:hover {
  color: #b91c1c;
}

.back-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 18px;
  color: #5A5A5A;
  font-weight: 500;
}

/* Cart Right */
.cart-right {
  flex: 1 1 30%;
  background: #fff;
  padding: 32px 24px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  height: fit-content;
  min-width: 320px;
}

.cart-right h3 {
  /* color: #0154b9; */
  margin-bottom: 18px;
  font-size: 24px;
  text-align: center;
  font-weight: 700;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  font-size: 17px;
  font-weight: 500;
}

.total-row {
  border-top: 1px solid #eaeaea;
  padding-top: 10px;
  font-weight: bold;
  font-size: 19px;
  color: #d32f2f;
}

.voucher {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}

.voucher input {
  flex: 1;
  padding: 8px;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  font-size: 15px;
}

.voucher button {
  background: #0154b9;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.voucher button:hover {
  background: #0051ff;
}

.checkout-btn {
  background: linear-gradient(90deg,#0154b9 0%,#0051ff 100%);
  color: white;
  border: none;
  padding: 14px;
  width: 100%;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 20px;
  margin-top: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: background 0.2s;
}

.checkout-btn:hover {
  background: linear-gradient(90deg,#0051ff 0%,#0154b9 100%);
}

/* Responsive: chuyển sang dọc khi mobile */
@media (max-width: 900px) {
  .cart-wrapper {
    flex-direction: column;
    gap: 18px;
    padding: 18px 6px;
  }

  .cart-left,
  .cart-right {
    flex: 1 1 100%;
    min-width: unset;
    padding: 18px 8px;
  }

  table th, table td {
    font-size: 14px;
    padding: 8px 4px;
  }
}

.recently-viewed {
  margin: 100px auto;
  padding: 0 20px;
  width: 1760px;
  box-sizing: border-box;
  height: 440px;
}

.recently-viewed h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

/* Bọc ngoài để đặt nút scroll */
.recently-viewed-wrapper {
  position: relative;
  overflow: hidden;
}

/* Track chính để scroll ngang */
.recently-viewed-track {
  display: flex;
  gap: 16px;
  padding: 20px;
  background-color: #007bff;
  border-radius: 10px;

  overflow-x: auto;
  /* cho phép cuộn ngang */
  overflow-y: hidden;
  /* ẩn cuộn dọc */

  scroll-behavior: smooth;
  height: 100%;
  align-items: center;
  box-sizing: border-box;
}



.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 6px 12px;
  z-index: 2;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.left-btn {
  left: 10px;
}

.right-btn {
  right: 10px;
}

.product-card1 {
  background: white;
  border-radius: 8px;
  width: 260px;
  height: 400px;
  flex: 0 0 auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 10px;
}

.product-image1 {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.product-name1 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  margin-left: 10px;
}

.product-price1 {
  color: red;
  font-weight: 700;
  margin-bottom: 6px;
  margin-left: 10px;
}

.product-rating1 {
  font-size: 14px;
  color: #fbc02d;
  margin-bottom: 12px;
  margin-left: 10px;
}

.product-actions1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: 10px;
}

.buy-btn1 {
  background-color: white;
  color: #007bff;
  border: 2px solid #007bff;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.buy-btn1:hover {
  background-color: #007bff;
  color: white;
}

.product-fav1 {
  font-size: 18px;
  cursor: pointer;
  color: #333;
}

.voucher-products-list {
  max-height: 180px;
  overflow-y: auto;
  padding-right: 8px;
  margin-bottom: 0;
}

/* =========================
   SKU Column Styles 
========================= */

/* Container chính của cột SKU */
.sku-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60px;
}

/* SKU Badge khi có dữ liệu */
.sku-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0154b9 0%, #1e88e5 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(1, 84, 185, 0.25);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.sku-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.sku-badge:hover::before {
  left: 100%;
}

.sku-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(1, 84, 185, 0.35);
}

/* Icon barcode */
.sku-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
}

/* Nội dung SKU */
.sku-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sku-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sku-value {
  font-size: 13px;
  color: #fff;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
}

/* SKU Empty khi không có dữ liệu */
.sku-empty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f5f5f5;
  border: 1px dashed #d0d0d0;
  border-radius: 8px;
  color: #999;
  font-size: 12px;
  font-style: italic;
}

.sku-empty i {
  font-size: 14px;
  color: #ccc;
}

/* Cột SKU trong table */
.cart-table th:nth-child(2),
.cart-table td:nth-child(2) {
  width: 160px;
  text-align: center;
  vertical-align: middle;
  padding: 12px 8px;
}

/* Header cột SKU */
.cart-table th:nth-child(2) {
  background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
  color: #0154b9;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
}

.cart-table th:nth-child(2)::before {
  content: '🔖';
  margin-right: 6px;
  font-size: 12px;
}

/* Hover effect cho row */
tbody tr:hover .sku-badge {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(1, 84, 185, 0.4);
}

tbody tr:hover .sku-empty {
  background: #f0f0f0;
  border-color: #bbb;
}

/* =========================
   Responsive Design
========================= */

@media (max-width: 1200px) {
  .cart-table th:nth-child(2),
  .cart-table td:nth-child(2) {
    width: 140px;
  }
  
  .sku-badge {
    padding: 8px 10px;
    gap: 6px;
  }
  
  .sku-value {
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .cart-table th:nth-child(2),
  .cart-table td:nth-child(2) {
    width: 120px;
  }
  
  .sku-badge {
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
  }
  
  .sku-content {
    gap: 1px;
  }
  
  .sku-label {
    font-size: 9px;
  }
  
  .sku-value {
    font-size: 11px;
  }
}

@media (max-width: 600px) {
  /* Giữ cột SKU nhưng thu nhỏ */
  .cart-table th:nth-child(2),
  .cart-table td:nth-child(2) {
    width: 80px;
    padding: 8px 4px;
  }
  
  .sku-badge {
    padding: 4px 6px;
    border-radius: 8px;
  }
  
  .sku-icon {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }
  
  .sku-label {
    display: none; /* Ẩn label trên mobile */
  }
  
  .sku-value {
    font-size: 10px;
    line-height: 1.2;
  }
  
  .sku-empty {
    padding: 4px 6px;
    font-size: 10px;
  }
  
  .sku-empty span {
    display: none; /* Chỉ hiện icon */
  }
}

/* =========================
   Animation Effects
========================= */

@keyframes skuGlow {
  0% { box-shadow: 0 4px 12px rgba(1, 84, 185, 0.25); }
  50% { box-shadow: 0 6px 20px rgba(1, 84, 185, 0.4); }
  100% { box-shadow: 0 4px 12px rgba(1, 84, 185, 0.25); }
}

.sku-badge:hover {
  animation: skuGlow 2s ease-in-out infinite;
}

/* Tooltip cho SKU */
.sku-badge {
  position: relative;
}

.sku-badge::after {
  content: 'Mã sản phẩm định danh';
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.sku-badge:hover::after {
  opacity: 1;
}
