body {
  font-family: 'SF Pro Display', Arial, sans-serif;
  background-color: #ffffff;
}

/* Container để gom input và preview song song */
.container {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin: 20px;
  gap: 20px;
}

/* Khung nhập liệu bên trái */
.input-section {
  flex: 0 0 35%;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background: linear-gradient(135deg, #fdfdfd, #f3f7fb);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.input-section h3, .input-section h4 {
  margin-top: 15px;
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
  border-left: 4px solid #2196F3;
  padding-left: 8px;
}

.input-section label {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.input-section input[type="text"],
.input-section input[type="file"],
.input-section textarea {
  width: 95%;
  padding: 8px 10px;
  margin-top: 5px;
  border: 1px solid #bbb;
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-section input:focus,
.input-section textarea:focus {
  border-color: #2196F3;
  box-shadow: 0 0 5px rgba(33,150,243,0.4);
  outline: none;
}
.button-row button:nth-child(2) {
  background-color: #e74c3c;
  color: #fff;
}

.button-row button:nth-child(2):hover {
  background-color: #c0392b;
  transform: translateY(-2px);
}


/* Hàng nút */
.fixed-buttons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: grid;
  grid-template-columns: repeat(4, auto); /* tối đa 4 nút mỗi hàng */
  gap: 10px;
  background: rgba(255,255,255,0.95);
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 9999;
}

.fixed-buttons button {
  min-width: 100px;   /* chiều rộng tối thiểu cho đều */
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

/* Mỗi nút một màu */
.fixed-buttons button:nth-child(1) {
  background: #e74c3c; /* đỏ cho nút Xóa */
}
.fixed-buttons button:nth-child(1):hover {
  background: #c0392b;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(2) {
  background: #3498db; /* xanh dương cho nút Xuất PDF */
}
.fixed-buttons button:nth-child(2):hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(3) {
  background: #27ae60; /* xanh lá */
}
.fixed-buttons button:nth-child(3):hover {
  background: #1e8449;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(4) {
  background: #9b59b6; /* tím */
}
.fixed-buttons button:nth-child(4):hover {
  background: #8e44ad;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(5) {
  background: #f39c12; /* cam */
}
.fixed-buttons button:nth-child(5):hover {
  background: #d68910;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(6) {
  background: #1abc9c; /* xanh ngọc */
}
.fixed-buttons button:nth-child(6):hover {
  background: #16a085;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(7) {
  background: #8e44ad; /* tím đậm */
}
.fixed-buttons button:nth-child(7):hover {
  background: #6c3483;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(8) {
  background: #d35400; /* cam đất */
}
.fixed-buttons button:nth-child(8):hover {
  background: #a04000;
  transform: translateY(-2px);
}

.fixed-buttons button:nth-child(9) {
  background: #2c3e50; /* xanh xám */
}
.fixed-buttons button:nth-child(9):hover {
  background: #1a252f;
  transform: translateY(-2px);
}
.fixed-buttons button:nth-child(10) {
  background: #ff69b4; /* hồng cho nút Drive */
}
.fixed-buttons button:nth-child(10):hover {
  background: #d63384;
  transform: translateY(-2px);
}
.fixed-buttons button:nth-child(11) {
  background: #5a5757; /* hồng cho nút Drive */
}
.fixed-buttons button:nth-child(11):hover {
  background: #000000;
  transform: translateY(-2px);
}
/* Nút Hiển thị trên giấy */
.button-row button:first-child {
  background-color: #4CAF50; /* xanh lá */
  color: #fff;
}

.button-row button:first-child:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

/* Nút Xuất PDF */
.button-row button:last-child {
  background-color: #2196F3; /* xanh dương */
  color: #fff;
}

.button-row button:last-child:hover {
  background-color: #1976D2;
  transform: translateY(-2px);
}

/* Preview A5 bên phải */
.a5-landscape {
  flex: 0 0 auto;
  display: inline-block;
  width: 210mm;
  height: 148mm;
  border: 1px solid #000;
  display: flex;
  position: relative;
}

.half {
  width: 50%;
  padding: 15px;
  box-sizing: border-box;
  border-right: 1px dashed #aaa;
  position: relative;
}

.half.right .fixed-title {
  position: absolute;
  top: 33mm;
  left: 35%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
  margin: 0;
  text-align: left;
}

.half.right p {
  position: absolute;
  top: 40mm;
  left: 11mm;
  right: 8mm;
  font-size: 11px;
  white-space: pre-line;
}

/* Khung nhóm 1: Tên sản phẩm + Mô tả */
.group1 {
  position: absolute;
  top: 33mm;
  left: 51%;
  transform: translateX(-50%);
  width: 90mm;
  height: 15mm;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.group1 h2 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
}

.group1 p {
  margin: 4px 0 0 0;
  font-size: 10px;
  text-align: center;
  text-transform: capitalize;
}

/* Khung nhóm 2: Giá */
.group2 {
  position: absolute;
  top: 52mm;
  left: 12mm;
  width: 81mm;
  height: 17mm;
}

.price-box.combined {
  width: 81mm;
  height: 100%;
  border: 1px solid #333;
  border-radius: 8px;
  background-color: #fff;
  display: flex;
  flex-direction: row;
}

.price {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.price .label {
  font-size: 12px;
  font-weight: bold;
}

.price .value {
  font-size: 19px;
  margin-top: 4px;
}

.price.listed .value .amount {
  text-decoration: line-through;
}

.price.discount .value strong {
  font-weight: bold;
}

.currency {
  font-size: 10px;
  margin-left: 0.1px;
  text-decoration: none;
}

.divider {
  width: 1px;
  background-color: #333;
  height: 100%;
  /* margin-right: 4mm; /* dịch sang trái */
}

.group.cutline {
  position: absolute;
  top: 28mm;
  left: 8mm;
  width: 90mm;
  height: 115mm;
  border: 1px dashed #000;
}

.group.cutline-right {
  position: absolute;
  top: 28mm;
  right: 8mm;
  width: 90mm;
  height: 91mm;
  border: 1px dashed #000;
}

.group3, .group4 {
  position: absolute;
  left: 12mm;
  width: 81mm;
  background-color: #fff;
  font-size: 11px;
}

.group3 {
  top: 74mm;
}

.group4 {
  top: 107mm;
}

.group3 h3, .group4 h3 {
  margin: 0 0 4px 0;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.group3 ul, .group4 ul {
  margin: 0;
  padding-left: 15px;
}

#paperRightContent {
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;        /* giữ xuống dòng, đồng thời cho phép wrap chữ */
  word-wrap: break-word;        /* ngắt từ dài */
  overflow-wrap: break-word;    /* ngắt từ dài (chuẩn mới) */
  top: 37.5mm;
  left: 9mm;
  width: 85mm;                  /* giới hạn chiều rộng khung */
  box-sizing: border-box;       /* đảm bảo padding/border không làm tràn */

  /* Giới hạn số dòng hiển thị */
  display: -webkit-box;
  -webkit-line-clamp: 17;       /* tối đa 17 dòng */
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* QR box */
.qr-box {
  position: absolute;
  bottom: 0mm;
  right: 5mm;
  width: 25mm;
  height: auto;
  text-align: center;
}

.qr-box img {
  width: 25mm;
  height: 25mm;
  object-fit: contain;
  border: 1px solid #333;
  background-color: #fff;
  display: block;
  margin: 0 auto;
}

.qr-box p {
  font-size: 9px;
  margin-top: 2px;
  color: #000;
}
@import url('https://cdn.jsdelivr.net/npm/sf-font@latest/sf-font.css');
/* Input bắt buộc: viền đỏ nhạt */
.input-section input[required],
.input-section textarea[required] {
  border: 1px solid #d88;   /* đỏ nhạt */
  background-color: #fff;   /* giữ nền trắng */
}

/* Input không bắt buộc: viền xanh nhạt */
.input-section input:not([required]),
.input-section textarea:not([required]) {
  border: 1px solid #88b;   /* xanh nhạt */
  background-color: #fff;   /* giữ nền trắng */
}

/* Hiệu ứng khi focus để nổi bật hơn một chút */
.input-section input:focus,
.input-section textarea:focus {
  outline: none;
  border-color: #555;       /* viền xám đậm khi focus */
  box-shadow: 0 0 4px rgba(0,0,0,0.1);
}


.btn-drive {
  display: flex;
  align-items: center;
  justify-content: center;   /* căn giữa theo chiều ngang */
  gap: 6px;              /* khoảng cách giữa icon và chữ */
  background: #ff69b4;   /* màu nền nút */
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.btn-drive:hover {
  background: #d63384;
  transform: translateY(-2px);
}

.icon-drive {
  width: 18px;
  height: 18px;
}
.group.cutline::before {
  content: "✂";              /* ký tự cây kéo */
  position: absolute;
  top: -15px;                /* chỉnh vị trí theo ý */
  left: -20px;
  font-size: 16px;
  color: #000;
}
.group.cutline-right::before {
  content: "✂";              /* ký tự cây kéo */
  position: absolute;
  top: -15px;                /* chỉnh vị trí theo ý */
  left: -20px;
  font-size: 16px;
  color: #000;
}
#progress-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  height: 24px;
  background: linear-gradient(135deg, #ddd, #bbb);
  border-radius: 12px;
  overflow: hidden;
  display: none;
  z-index: 99999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4caf50, #81c784);
  transition: width 0.3s ease;
}

#progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
#toast {
  min-width: 300px;
  max-width: 80%;
  background: linear-gradient(135deg, #4caf50, #81c784);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 14px 20px;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 10000;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none; /* tránh click */
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#toast.hide {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
}

#toast.error {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}
.search-box {
  display: flex;
  align-items: center;   /* căn giữa theo chiều dọc */
  gap: 6px;              /* khoảng cách giữa input và nút */
  margin-top: 8px;
}

.search-box input {
  flex: 1;               /* input chiếm hết chiều ngang */
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.search-box button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px; /* đẩy xuống dưới */
}

.search-box button:hover {
  background-color: #0056b3;
}
/* Danh sách kết quả */
#searchResults {
  list-style: none;
  padding: 0;
  margin-top: 10px;
}
#searchResults li {
  padding: 8px;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
#searchResults li:hover {
  background-color: #f0f0f0;
}
#searchResults li:active {
  background-color: #d0e0ff; /* hiệu ứng click */
}
#searchResults li {
  user-select: none;   /* không cho chọn text */
}
#tipsModal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#tipsModal .modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 1000px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#tipsModal h3 {
  margin-top: 0;
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
}

#tipsModal button {
  margin-top: 10px;
  padding: 6px 12px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
#tipsModal button:hover {
  background: #2980b9;
}
#tipsModal pre {
  font-family: 'SF Pro Display', Arial, sans-serif; /* không dùng monospace */
  white-space: pre-line; /* giữ xuống dòng nhưng font vẫn đẹp */
}
#confirmModal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

#confirmModal .modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  width: 360px;
  font-family: 'SF Pro Display', Arial, sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  text-align: center;
}

#confirmModal .modal-buttons {
  margin-top: 15px;
  display: flex;
  justify-content: space-around;
}

#confirmModal button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

#confirmYes {
  background: #27ae60;
  color: #fff;
}
#confirmYes:hover {
  background: #219150;
}

#confirmNo {
  background: #e74c3c;
  color: #fff;
}
#confirmNo:hover {
  background: #c0392b;
}
#a5-container {
  position: relative;
  display: inline-block; /* giữ khung gọn */
}

.note {
  position: absolute;
  bottom: -30px;             /* cách mép dưới khung A5 20px */
  left: 50%;                 /* canh giữa theo chiều ngang */
  transform: translateX(-50%);
  font-size: 12px;
  color: #666;               /* màu xám nhạt */
  font-family: 'SF Pro Display', Arial, sans-serif;
}
