#Slider {
  padding-bottom: 30px;
  border-bottom: 2px solid #000;
  overflow: hidden;
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px);
  width: 100%;
  position: relative; /* Đảm bảo background không làm lệch nội dung */
  background-size: cover;
  background-position: center;
}

.flipbook {
  width: 100%;
  max-width: 1000px;
  height: 700px;
  margin: 0 auto;
  position: relative;

  display: flex; /* Đảm bảo flipbook nằm giữa */
  justify-content: center;
  align-items: center;
}

.flipbook .hard {
  background: #f9f9f9 !important;
  color: #070707;
  font-weight: bold;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.flipbook .hard small {
  font-style: italic;
  font-weight: lighter;
  opacity: 0.7;
  font-size: 14px;
}

.flipbook .page {
  background-image: url("../libs/images/bia/cover-book - 2.1.jpg");
  background-size: cover; /* Căn chỉnh kích thước ảnh cho vừa khít */
  background-repeat: no-repeat; /* Không lặp lại ảnh */
  
  height: 500px; /* Chiều cao phần tử */
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; /* Khoảng cách giữa các phần giảm lại */
}

.page-content {
  margin-top: 30px; /* Giảm margin trên từ 40px xuống 10px */
  margin-bottom: 22px; /* Giảm margin dưới từ 42px xuống 15px */
  padding: 20px 20px; /* Thêm padding ngang vừa phải */
  border: none; /* Bỏ viền xanh đậm nếu không cần */
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  width: auto;
  height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px; /* Khoảng cách giữa các phần con nhỏ hơn */
}

.tentd {
  font-size: 22px; /* Có thể giảm nhẹ kích thước chữ nếu muốn */
  font-weight: bold;
  color: #006400;
  margin-bottom: 3px; /* Giảm khoảng cách dưới */
  text-align: center;
}

.tenkh {
  font-size: 18px;
  font-style: italic;
  color: #2e8b57;
  text-align: center;
  margin-bottom: 6px; /* Giảm khoảng cách dưới */
}

.duoctinh,
.gioithieu,
.cdcay,
.lieuluong,
.luuy,
.btdt,
.bpd {
  font-size: 15px; /* Điều chỉnh font-size cho vừa phải */
  line-height: 1.4; /* Giảm dòng để các dòng gần nhau hơn */
  text-align: justify;
  color: #333;
  padding: 6px 10px; /* Giảm padding cho sát hơn */
  border-left: 4px solid #007bff;
  border-radius: 6px;
  margin-bottom: 6px; /* Giảm khoảng cách xuống còn 6px */
}

.duoctinh::before {
  content: "Dược tính: ";
  font-weight: bold;
  color: #007bff;
}

.gioithieu::before {
  content: "Giới thiệu: ";
  font-weight: bold;
  color: #007bff;
}

.cdcay::before {
  content: "Thành phần hoá học: ";
  font-weight: bold;
  color: #007bff;
}

.lieuluong::before {
  content: "Liều lượng: ";
  font-weight: bold;
  color: #007bff;
}

.luuy::before {
  content: "Lưu ý: ";
  font-weight: bold;
  color: #dc3545;
}

.bpd::before {
  content: "Bộ phận dùng: ";
  font-weight: bold;
  color: #007bff;
}

.hinhanh {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 85%;
  max-height: none !important;
  margin-left: auto;
  margin-right: auto; /* Căn giữa khung hình */
}

.imageduoclieu {
  margin: 20px !important;
  -webkit-box-shadow:
            0px 0px 0px 2px rgba(0,0,0,0.6),
                0px 0px 0px 14px #fff,
                0px 0px 0px 18px rgba(0,0,0,0.2),
                6px 6px 8px 17px #555;
   
     -moz-box-shadow:
            0px 0px 0px 2px rgba(0,0,0,0.6),
                0px 0px 0px 14px #fff,
                0px 0px 0px 18px rgba(0,0,0,0.2),
                6px 6px 8px 17px #555;
   
          box-shadow:
            0px 0px 0px 2px rgba(0,0,0,0.6),
                0px 0px 0px 14px #fff,
                0px 0px 0px 18px rgba(0,0,0,0.2),
                6px 6px 8px 17px #555;
}

.btdt {
  margin-top: 6px; /* Giảm margin trên */
  padding: 6px 10px;
  border-left: 4px solid #28a745;
  border-radius: 6px;
  font-size: 15px;
  color: #155724;
}

.btdt::before {
  content: "Bài thuốc dân tộc: ";
  font-weight: bold;
  color: #28a745;
}

.page img {
  width: 100%;
  height: auto; /* Để ảnh tự động chiều cao theo tỉ lệ */
  object-fit: contain; /* Giữ tỉ lệ ảnh */
  margin: 0 auto; /* Căn giữa */
}

.flipbook .page small {
  font-size: 14px;
  margin-bottom: 10px;
}

.hard.page img {
  width: 470px;
  height: 650px;
}

/* Xử lý background từ background.php */
#Slider > div:not(.flipbook) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

@media screen and (max-width: 768px) {

  .flipbook {
    width: 95% !important;
    max-width: 1000px;
    height: 700px;
    margin: 0 auto;
    position: relative;

    display: flex; /* Đảm bảo flipbook nằm giữa */
    justify-content: center;
    align-items: center;
  }

  .flipbook .page {
    background-image: url("../libs/images/bia/cover-book - 2.1.jpg");
    background-size: cover; /* Căn chỉnh kích thước ảnh cho vừa khít */
    background-repeat: round; /* Không lặp lại ảnh */
    
    height: 500px; /* Chiều cao phần tử */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Khoảng cách giữa các phần giảm lại */
  }
  /* Hiển thị trang bìa giống trang thường */
  .flipbook .hard.page {
    display: block !important;
    margin: 0 auto;
    background: #fff;
    box-shadow: none;
    border: none;
  }

  .hard.page img {
    margin-top: 0;
    width: 100%;
    height: 100%;
  }

  .mobile-pair .page-content {
    margin-top: 50px;
    margin-bottom: 60px;
    padding: 15px;
    height: 100%;
    overflow-y: auto;
  }

  .mobile-pair .page-content > * {
    margin-bottom: 15px;
  }

  .mobile-pair .page-content > *:last-child {
    margin-bottom: 0;
  }

  /* Loại bỏ khoảng trống giữa các phần */
  .mobile-pair .page-content > .hinhanh {
    margin-top: 10px;
    margin-bottom: 10px;
  }

  /* Đảm bảo các phần nội dung dính liền */
  .mobile-pair .tentd,
  .mobile-pair .tenkh {
    margin: 0px;
    margin-left: 10px;
    padding: 8px 0;
  }

  .mobile-pair .duoctinh,
  .mobile-pair .cdcay,
  .mobile-pair .gioithieu,
  .mobile-pair .btdt,
  .mobile-pair .lieuluong,
  .mobile-pair .luuy,
  .mobile-pair .bpd {
    margin: 5px;
    margin-left: 10px;
    padding: 8px 0;
    padding-left: 10px;
  }
}
