@import url('https://fonts.googleapis.com/css?family=Poppins:400,500,600,700,800,900');
*,
*::before,
*::after {
  box-sizing: border-box;
}
p {
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.7;
  color: #ffffff;
}
.section1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

[type="checkbox"]:checked,
[type="checkbox"]:not(:checked) {
  position: absolute;
  left: -9999px;
}

.modal-btn1:checked + label,
.modal-btn1:not(:checked) + label {
  position: relative;
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 2;
  height: 50px;
  transition: all 150ms linear;
  border-radius: 4px;
  width: 200px;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: none;
  cursor: pointer;
  background-color: #102770;
  color: #ffeba7;
  box-shadow: 0 8px 25px 0 rgba(16,39,112,.3); /* ปรับเงา */
}

.modal-btn1:not(:checked) + label:hover {
  background-color: #ffeba7;
  color: #102770;
}

.modal-btn1:checked + label .uil1,
.modal-btn1:not(:checked) + label .uil1 {
  margin-left: 10px;
  font-size: 18px;
}

.modal-btn1:checked + label:after,
.modal-btn1:not(:checked) + label:after {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 110;
  width: 40px;
  border-radius: 3px;
  height: 30px;
  text-align: center;
  line-height: 30px;
  font-size: 18px;
  background-color: #ffeba7;
  color: #102770;
  content: '\0058'; 
  box-shadow: 0 12px 25px 0 rgba(16,39,112,.3);
  transition: all 150ms linear; /* ปรับการเคลื่อนไหว */
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.modal-btn1:checked + label:hover:after,
.modal-btn1:not(:checked) + label:hover:after {
  background-color: #102770;
  color: #ffeba7;
}

.modal-btn1:checked + label:after {
  transition: opacity 300ms 200ms ease, transform 300ms 200ms ease;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.modal1 {
  position: fixed;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  overflow-x: hidden;
  background-color: rgba(31,32,41,.75);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms 500ms ease; /* ปรับระยะเวลาแสดง modal */
}

.modal-btn1:checked ~ .modal1 {
  pointer-events: auto;
  opacity: 1;
  transition: all 250ms ease-in-out;
}

.modal-wrap1 {
  position: relative;
  display: flex; /* เพิ่ม Flexbox */
  flex-direction: column; /* ตั้งค่าการจัดเรียงในแนวตั้ง */
  align-items: center; /* จัดกลางแนวนอน */
  justify-content: center; /* จัดกลางแนวตั้ง */
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  border-radius: 4px;
  overflow: hidden;
  padding-bottom: 20px;
  background-color: #fff;
  box-shadow: 0 12px 25px 0 rgba(199,175,189,.35); /* เพิ่มเงา */
  opacity: 0;
  transform: scale(0.9); /* ลดการย่อขนาดให้น้อยลง */
  transition: opacity 150ms ease-in, transform 200ms ease-in; /* ปรับเวลา transition ให้เร็วขึ้น */
}

.modal-btn1:checked ~ .modal1 .modal-wrap1 {
  opacity: 1;
  transform: scale(1);
  transition: opacity 150ms ease-out, transform 200ms ease-out; /* ให้การแสดงผลลื่นไหลขึ้น */
}

/* สไตล์สำหรับปุ่มปิด */
.close-modal-btn {
  background-color: #ff4d4d; /* สีพื้นหลังแดง */
  color: white; /* สีข้อความขาว */
  border: none; /* ลบขอบปุ่ม */
  padding: 10px 20px; /* เพิ่มพื้นที่รอบตัวอักษร */
  font-size: 16px; /* ขนาดข้อความใหญ่ขึ้น */
  border-radius: 5px; /* มุมโค้งมน */
  cursor: pointer; /* เปลี่ยนเคอร์เซอร์เป็นรูปมือ */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* เพิ่มเงาให้ปุ่ม */
  transition: background-color 0.3s ease, transform 0.3s ease;
  margin-top: 20px; /* เพิ่มระยะห่างจากภาพ */
  align-self: center; /* จัดกลางในแนวตั้ง */
}

.close-modal-btn:hover {
  background-color: #ff1a1a;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.close-modal-btn:active {
  background-color: #cc0000;
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* เพิ่มการสไลด์ */
.slide-container1 {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
}

.slide1 {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 100%;
  height: 100%;
}

.logo1 {
  position: absolute;
  top: 25px;
  left: 25px;
  display: block;
  z-index: 1000;
  transition: all 250ms linear;
}

.logo1 img {
  height: 26px;
  width: auto;
  display: block;
  filter: brightness(10%);
  transition: filter 250ms 700ms linear;
}

.modal-btn1:checked ~ .logo1 img {
  filter: brightness(100%);
  transition: all 250ms linear;
}

/* Media query for responsive design */
@media screen and (max-width: 768px) {
  .modal-wrap1 {
    width: calc(100% - 40px);
    padding-bottom: 15px;
  }
  .modal-wrap1 p {
    padding: 15px 20px 0 20px;
  }
}

/* Adjust styles for the label */
.modal-btn1:checked + label,
.modal-btn1:not(:checked) + label {
  margin-left: auto; /* Updated styles to move label to the right */
}
