* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Sarabun", sans-serif;
}

body {
  background: #ffffff;
}

/* HEADER */
.header {
  background: #e8e8e8;
  padding: 15px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
  height: 100px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  /* ระยะห่างโลโก้กับข้อความ */
}

/* search center */
.header-search {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-bar {
  width: 80%;
  background: #04214b;
  padding: 7px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
}

.logo {
  object-fit: contain;
  width: 80px;
  height: 80px;
}

.brand h1 {
  font-size: 21px;
  font-weight: 700;
  margin: 0;
}

.brand span {
  color: #c0392b;
  font-size: 14px;
  font-weight: 600;
  font-size: 20px;
}

.login-btn {
  border: 2px solid #1e3a8a;
  padding: 10px 18px;
  border-radius: 25px;
  text-decoration: none;
  color: #1e3a8a;
  font-weight: 600;
  transition: 0.3s;
}

.login-btn:hover {
  background: #1e3a8a;
  color: white;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 100px;
  z-index: 999;
  display: flex;
  background: #6b8fcf;
  padding: 15px 40px;
  justify-content: center;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: center;
  justify-content: center;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 15px;
  margin: 0;
}

.nav-menu li a {
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  font-weight: 600;
}

.nav-menu li a:hover {
  background: #345ca8;
  border-radius: 10px;
}

/* Hamburger */
.hamburger {
  display: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

/* BANNER */
.banner {
  display: flex;
  width: 100%;
  height: 380px;
  overflow: hidden;
}

/* ---------- LEFT SLIDER ---------- */
.banner-left {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.slider {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide {
  width: 100%;
  height: 100%;
  position: absolute;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- PREV / NEXT BUTTON ---------- */
.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.3s;
}

.slide-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.prev {
  left: 10px;
}

.next {
  right: 10px;
}

/* ---------- RIGHT STATIC ART ---------- */
.banner-right {
  flex: 1;
  position: relative;
  text-decoration: none;
  color: #fff;
}

.banner-right img {
  width: 100%;
  height: 100%;
}

.right-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.right-text h2 {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.right-text button {
  margin-top: 15px;
  padding: 10px 25px;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  background: #542de0;
  color: #fff;
  cursor: pointer;
}

/* CS1-SECTIONS */
.section {
  padding: 80px 20px;
  text-align: center;
}

.section.alt {
  background: #eef2ff;
}

.section h3 {
  font-size: 28px;
  margin-bottom: 10px;
}

.section p {
  font-size: 16px;
  color: #555;
}

.cs1-section {
  text-align: center;
  padding: 30px;
}

.cs1-slider-box {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
}

.cs1-track-container {
  overflow: hidden;
}

.cs1-track {
  display: flex;
  transition: transform 0.45s ease;
}

.cs1-slide {
  min-width: 100%;
}

.cs1-slide img {
  width: 100%;
  height: 550px;
  object-fit: cover;
}

/* ปุ่ม */
.cs1-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 32px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: 0.3s;
  z-index: 99;
}

.cs1-prev-btn {
  left: 10px;
}

.cs1-next-btn {
  right: 10px;
}

.cs1-nav-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

/* รวม CSS ของ Section 2 และ Section 5 ไว้ด้วยกัน */
.cs2-section,
.cs5-section {
  width: 100%;
  max-width: 1550px; /* ล็อคขนาดสูงสุดเมื่อซูมออก */
  margin: 0 auto;
  position: relative;
  padding: 0;
}

/* ทำให้ Link คลุมพื้นที่ทั้งหมด */
/* รวมส่วนของ Link */
.cs2-link,
.cs5-board-link {
  display: block;
  width: 100%;
}

/* รวมส่วนของ Image */
.cs2-full-image,
.cs5-board-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* รวมส่วนของ Link */
.cs2-link,
.cs5-board-link {
  display: block;
  position: relative;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

.cs2-full-image,
.cs5-full-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 0;
  padding: 40px;
  background: #e6e6e6;
}

/* ข้อความซ้อนบนภาพ */
.cs2-text-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  text-shadow: 0px 3px 6px rgba(0, 0, 0, 0.5);
}

.cs2-text-overlay h3 {
  font-size: 2rem;
  margin: 0;
}

.cs2-text-overlay p {
  font-size: 1.2rem;
  margin-top: 5px;
}

/* CS3-SECTION */
.cs3-section {
  text-align: center;
  margin: 40px 0;
}

.cs3-grid {
  margin-top: 25px;
  /* เปลี่ยนมาใช้ Flexbox เพื่อการจัดกึ่งกลางที่สมบูรณ์แบบ */
  display: flex;
  flex-wrap: wrap; /* ให้ปัดตกบรรทัดใหม่ถ้าจอแคบ */
  justify-content: center; /* พระเอกของงาน: สั่งให้ทุกกล่องเริ่มจัดจาก "ตรงกลาง" เสมอ */
  gap: 25px;
  padding: 0 20px;
  
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.cs3-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #ffffff;
  border-radius: 14px;
  padding: 25px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease;
  
  /* --- ส่วนกำหนดขนาดกล่อง --- */
  /* กำหนดความกว้างพื้นฐานประมาณ 1 ใน 3 ของหน้าจอ (ลบ gap ออกนิดหน่อย) */
  width: 300px; 
  /* หรือถ้าอยากให้ยืดหยุ่นกว่านี้ ใช้บรรทัดล่างนี้แทนได้ครับ */
  /* flex: 0 1 320px; */ 
}

.cs3-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.15);
}

/* ส่วนรูปภาพ (เหมือนเดิม เพราะดีอยู่แล้ว) */
.cs3-icon {
  background: #e6e6e6;
  border-radius: 20px;
  margin-bottom: 15px;
  overflow: hidden; 
  flex-shrink: 0;
}

.cs3-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
}

/* ข้อความ */
.cs3-text h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.cs3-text p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
}

/* CS4-SECTION: ตัวแม่ ทำหน้าที่จัดกลาง */
.cs4-section {
  width: 100%;
  display: flex; /* ใช้ Flexbox */
  justify-content: center; /* จัดเนื้อหาให้อยู่กึ่งกลางแนวนอน */
  align-items: flex-start; /* จัดให้เริ่มจากด้านบน */
  background: #e6e6e6; /* สีพื้นหลังของ Section ใหญ่ (ถ้ามี) */
  margin-bottom: 40px;
}

/* =========================================
   ส่วนจัด Layout (PC Layout)
   ========================================= */
.cs4-wrapper {
  /* กำหนดสัดส่วนเลียนแบบรูปตัวอย่าง (ซ้ายใหญ่ 3 ส่วน : ขวาเล็ก 1 ส่วน) */
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;

  /* จัดกึ่งกลางหน้าจอ */
  width: 100%;
  max-width: 1500px;
  margin: 10px auto;
  align-items: start; /* ให้เริ่มที่ขอบบนเสมอกัน */
}

/* =========================================
   ส่วนซ้าย: Slider (รูปภาพ)
   ========================================= */
.cs4-slider {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* เพิ่มเงาให้ดูมีมิติ */
}

.cs4-slide-track {
  display: flex;
  transition: transform 0.45s ease;
}

.cs4-slide {
  min-width: 100%;
  position: relative;
}

.cs4-slide img {
  width: 100%;
  height: auto; /* ปล่อยความสูง auto เพื่อรักษาสัดส่วนรูป */
  object-fit: contain;
  display: block;
}

/* DOTS */
.cs4-dots {
  text-align: center;
  margin-top: 15px;
}

.cs4-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 5px;
  background: #bbbbbb; /* สีปกติ */
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cs4-dot.active {
  background: #c00000; /* สีแดงเมื่อ Active */
  transform: scale(1.2); /* ขยายใหญ่ขึ้นนิดหน่อย */
}

/* ARTICLE */
/* เพิ่ม Class นี้เผื่อในกรณีที่ไม่ได้ใช้ Bootstrap */
.mt-5 {
  margin-top: 3rem !important;
}

/* ส่วนหัวข้อ (แถบสีเทาเข้มด้านบน) */
.cs4-article h4 {
  background-color: #999999; /* สีแถบหัวข้อ (เทาเข้ม) */
  color: #ffffff; /* ตัวหนังสือสีขาว */
  margin: 0; /* ลบ margin */
  padding: 15px 20px; /* จัดระยะห่างภายใน */
  font-size: 1.4rem;
  font-weight: bold;
  border-radius: 20px;
}

/* ส่วนเนื้อหา (ตัวหนังสือด้านล่าง) */
.cs4-article p {
  padding: 20px; /* เว้นระยะขอบเนื้อหา */
  margin: 0;
  color: #333; /* สีตัวหนังสือ */
  font-size: 1.2rem;
  line-height: 1.6;
}

/* FOOTER */
.footer {
  width: 100%;
  background: #f4f6f9; /* ปรับสีพื้นหลังให้เทาอ่อนตามภาพ */
  font-family: "Sarabun", sans-serif; /* แนะนำให้ใช้ฟอนต์ไทยสวยๆ */
  margin-top: 120px;
  padding: 30px 0;
  color: #333;
}

.footer-container {
  max-width: 90%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* เปลี่ยนเป็น flex-start เพื่อให้เริ่มจัดจากด้านบนสุด */
  flex-wrap: wrap;
  padding: 0 20px 20px 20px; /* เพิ่ม padding ล่าง, ลด padding บนลงเพราะโลโก้ลอยไปแล้ว */
  position: relative; /* สำคัญ */
}

/* --- ฝั่งซ้าย: ข้อมูล --- */
.footer-left {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 2;
  min-width: 300px;
  /* ไม่ต้องมี margin-top เพราะเราจะดันโลโก้ขึ้นไปเอง */
}

.footer-logo {
  background-color: #f4f6f9; /* พื้นหลังสีขาว เพื่อบังเส้นขอบ */
  width: 120px; /* กำหนดขนาดวงกลม/กล่อง */
  height: 120px;
  padding: 15px; /* ระยะห่างภายใน ให้โลโก้ไม่ชิดขอบ */
  border-radius: 50%; /* ทำเป็นวงกลม (ถ้าอยากได้สี่เหลี่ยมให้ลบอันนี้ออก) */

  /* เทคนิคดึงขึ้นข้างบน */
  margin-top: -100px; /* ดึงขึ้นไปข้างบน 70px (ปรับเลขนี้ตามความสูงโลโก้) */

  /* จัดตำแหน่งรูปข้างใน */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px; /* ดันข้อความข้างล่างให้ห่างออกมาหน่อย */
}

.footer-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.footer-info h3.company-name {
  font-size: 24px;
  font-weight: bold;
  margin: 0 0 10px 0;
  color: #000;
}

.footer-info p {
  margin: 5px 0;
  font-size: 18px; /* ปรับขนาดตัวหนังสือให้อ่านง่าย */
  line-height: 1.5;
  color: #444;
  text-decoration: none;
}

/* --- ฝั่งขวา: Social & Map --- */
.footer-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  min-width: 600px;
  /* เส้นคั่นแนวตั้ง */
  border-left: 1px solid #ccc;
  padding-left: 40px;
}

.footer-right {
  margin-top: 20px; /* ดันลงมานิดหน่อยให้สมดุลกับฝั่งซ้าย */
}

/* --- ส่วน Map Section --- */
.map-section {
  width: 300px; /* กำหนดความกว้างของแผนที่ */
  height: 180px; /* กำหนดความสูง */
  overflow: hidden; /* ป้องกันส่วนเกินล้น */
  border-radius: 10px; /* ทำมุมโค้งให้ดูสวย (เหมือนปุ่มเดิม) */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* ใส่เงาเล็กน้อย */
  background-color: #ddd; /* สีพื้นหลังระหว่างรอโหลด */
}

.map-inner {
  height: 180px;
}

.map-section iframe {
  width: 100%;
  height: 100%;
  display: block; /* ลบช่องว่างด้านล่าง iframe */
}

/* ส่วน Social Media */
.social-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.social-section span {
  font-size: 18px;
  font-weight: bold;
  color: #555;
}

.social-icons {
  display: flex;
  gap: 10px;
}

/* ตกแต่งปุ่มไอคอน */
.social-icons a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  transition: 0.3s;
}

.icon-fb {
  background-color: #1877f2;
} /* สี Facebook */
.icon-yt {
  background-color: #ff0000;
} /* สี YouTube */

.social-icons a:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/* ปุ่มแผนที่ */
.map-btn {
  display: inline-block;
  background-color: #aab0b6; /* สีเทาตามภาพ */
  color: #333;
  font-size: 24px;
  font-weight: bold;
  text-decoration: none;
  padding: 20px 40px;
  border-radius: 8px;
  transition: 0.3s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-btn:hover {
  background-color: #959aa0;
  color: #000;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 650px) {
  .cs5-board-box {
    max-width: 100%;
  }
}

@media (max-width: 850px) {
  .cs4-wrapper {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .cs4-slide img {
    height: 260px;
  }
}

@media (max-width: 800px) {
  .cs3-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .cs1-nav-btn {
    padding: 10px 12px;
    font-size: 22px;
  }

  .cs2-full-image {
    padding: 10px;
  }

  .cs5-full-image {
    padding: 10px;
  }

  .cs2-text-overlay h3 {
    font-size: 1.4rem;
  }

  .cs2-text-overlay p {
    font-size: 1rem;
  }
}

@media (max-width: 900px) {
  .banner {
    flex-direction: column;
    height: 350px;
  }

  .banner-left,
  .banner-right {
    width: 100%;
    height: 220px;
  }

  .slide-btn {
    font-size: 24px;
    padding: 6px 10px;
  }

  .right-text h2 {
    font-size: 24px;
  }

  .right-text button {
    padding: 8px 20px;
    font-size: 16px;
  }
}

/* สำหรับมือถือเล็กจริง ๆ */
@media (max-width: 500px) {
  .cs3-grid {
    grid-template-columns: 1fr;
  }

  .banner-left,
  .banner-right {
    height: 180px;
  }

  .slide-btn {
    font-size: 20px;
    padding: 5px 8px;
  }

  .right-text h2 {
    font-size: 20px;
  }

  .right-text button {
    padding: 6px 16px;
    font-size: 14px;
  }
}

/* Tablet */
@media (max-width: 992px) {
  .banner {
    flex-direction: column;
    text-align: center;
  }

  .banner-art img {
    width: 280px;
    margin-top: 20px;
  }

  /* 2. แก้ปัญหารูปภาพทะลุ */
  .cs4-slide {
    width: 100% !important; /* บังคับสไลด์กว้างเท่าจอ */
  }

  .cs4-slide img {
    width: 100% !important; /* บังคับรูปให้ยืดหดตามกรอบ 100% */
    height: auto !important; /* ให้ความสูงปรับ Auto ตามสัดส่วนรูป */
    max-width: 100%; /* กันเหนียวไม่ให้เกิน 100% */
    object-fit: cover; /* ให้รูปเต็มสวย */
  }

  .cs4-article {
    background-color: #e6e6e6; /* สีพื้นหลังกล่อง (เทาอ่อน) */
    border-radius: 8px; /* มุมมน */
    overflow: hidden; /* ตัดส่วนเกินตามมุม */
    height: fit-content; /* ความสูงตามเนื้อหา */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0 !important; /* ล้าง padding เดิมเพื่อให้ header ชิดขอบ */
  }

  .cs4-article p,
  .cs4-article h4 {
    width: 100% !important; /* ข้อความกว้างเต็ม */
    word-wrap: break-word; /* ถ้ามีคำยาวๆ ให้ตัดคำลงบรรทัดใหม่ */
    overflow-wrap: break-word; /* (สำรอง) ตัดคำเมื่อสุดขอบ */
    white-space: normal; /* ให้ขึ้นบรรทัดใหม่ปกติ */
    font-size: 1rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .dropdown-menu {
    left: 85px !important;
  }
  .nav-menu li a {
    font-size: 20px;
  }
  .navbar {
    top: 0px;
    z-index: 999;
    display: flex;
    background: #6b8fcf;
    padding: 15px 40px;
    justify-content: center;
    position: relative;
  }

  .header {
    padding: 15px 20px;
    flex-direction: column;
    gap: 10px;
    text-align: center;
    height: auto;
    position: relative;
  }

  .header-left {
    flex-direction: column;
  }

  .header-search {
    width: 100%;
  }

  .search-bar {
    width: 100%;
    max-width: 100%;
  }

  .header-right {
    width: 100%;
    margin-top: 10px;
  }

  .logo {
    width: 52px;
    height: 52px;
  }

  .brand h1 {
    font-size: 18px;
    line-height: 1.2;
  }

  .brand span {
    font-size: 18px;
  }

  .login-btn {
    width: 100%;
    padding: 10px 10px;
  }

  /* Navbar */
  .nav-menu {
    display: none;
    flex-direction: column;
    background: #4a6eb3;
    padding: 10px;
    position: absolute;
    top: 70px;
    width: 100%;
  }

  .nav-menu.show {
    display: flex;
    z-index: 9999;
  }

  .hamburger {
    display: block;
  }

  /* Banner */
  .banner-content h2 {
    font-size: 34px;
  }

  .banner-art img {
    width: 230px;
  }

  .cs1-slide img {
    width: 100%;
    height: 250px;
    object-fit: contain;
  }

  .footer-container {
    flex-direction: column; /* เปลี่ยนแนวเป็นเรียงลงมา */
    text-align: center; /* จัดตัวหนังสือให้อยู่กลาง */
    gap: 30px;
  }

  .footer-left {
    width: 100%; /* ให้กว้างเต็มจอ */
  }

  .footer-right {
    display: flex;
    flex-direction: column;
    min-width: 300px;
    gap: 15px;
    flex: 2 1 0%;
    border: none;
    padding: 20px;
  }

  /* 1. บังคับให้ Social อยู่ลำดับที่ 1 (ด้านบน) */
  .social-section {
    order: 1;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
  }

  /* 2. บังคับให้ Map อยู่ลำดับที่ 2 (ด้านล่าง) */
  .map-section {
    order: 2;
    width: 100%;
  }

  /* ปรับขนาดแผนที่ให้เหมาะกับมือถือ */
  .map-inner,
  iframe {
    height: 250px !important; /* ความสูงแผนที่ในมือถือ */
    border-radius: 10px;
  }

  .footer-logo img {
    margin: 0 auto 20px auto; /* จัดโลโก้ให้อยู่กลาง */
    display: block;
  }

  .catalog-image {
    height: 200px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .header-left .logo {
    object-fit: contain;
    width: 80px;
    height: 80px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .banner-content h2 {
    font-size: 30px;
  }

  .banner-content p {
    font-size: 15px;
  }
}

/* ปิด bullet */
.nav-menu,
.dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* พื้นฐานเมนู */
.nav-menu li {
  position: relative;
}

/* ดรอปดาวน์เมนู */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: -40px;
  background: #aec6f1;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  display: none;
  padding: 8px 0;
  z-index: 20;
}

/* ปุ่มภายในดรอปดาวน์ */
.dropdown-menu li a {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

.dropdown-menu li a:hover {
  background: #f2f2f2;
}

/* แสดงเมื่อ active */
.dropdown.open .dropdown-menu {
  display: block;
}

/* ปุ่ม dropdown */
.dropdown-btn {
  cursor: pointer;
}

.logo_name a {
  text-decoration: none;
}

/* PAGE TEXTBOOK LIST */

.library-wrapper {
  display: flex;
  width: 100%;
  background: #f3f4f6;
  min-height: 100vh;
}

/* LEFT SIDEBAR */
.sidebar-list {
  width: 280px;
  background: #ffffff;
}

.sidebar-outside {
  background: #dddddd;
  border-right: 5px solid #ffffff;
  padding: 20px;
}

.sidebar-title-list {
  color: #ffffff;
  padding: 10px 0;
  font-size: 20px;
  font-weight: bold;
  background: #000000;
  text-align: center;
}

/* BUTTON STYLES */
.menu-btn {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 4px;
  margin-bottom: 3px;
  transition: 0.15s;
}

/* Level colors */
.level-1 {
  color: #000000;
  font-size: 22px;
  background: #e4e4e4;
}

.level-2 {
  color: #ff0000;
  font-size: 16px;
  background: #c8c8c8;
}

.level-3 {
  color: #005bbb;
  font-size: 14px;
}

/* Hover effect */
.menu-btn:hover {
  opacity: 0.8;
}

/* Hide next level by default */
.menu-level-2,
.menu-level-3 {
  display: none;
  margin-left: 10px;
}

/* RIGHT SIDE */
.book-list {
  text-align: center;
  flex: 1;
  padding: 20px;
  background: #dddddd;
}

.book-title {
  font-size: 20px;
  font-weight: bold;
  background: #000;
  color: #fff;
  padding: 10px;
  margin-bottom: 20px;
}

/* BOOK GRID */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}

.book-item {
  text-align: center;
}

.book-card {
  width: 100%;
  height: 200px;
  background: #ccc;
  border-radius: 8px;
}

.book-name {
  margin-top: 8px;
  font-size: 18px;
  color: #000000;
}

/* ICON ARROWS */
.arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 8px;
  transition: 0.2s;
  vertical-align: middle;
}

/* สีลูกศร */
.arrow-1 {
  border-left: 7px solid black;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.arrow-2 {
  border-left: 7px solid #d9534f;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

/* หมุนตอน active */
.menu-btn.active .arrow {
  transform: rotate(90deg);
}

/* BLUE DOT (ตามรูป) */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
}

.dot-blue {
  background: #005bbb;
}

.menu-level-1,
.menu-level-2,
.menu-level-3 {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.menu-outside {
  padding: 5px;
}

/* PAGE_CATALOG */

.catalog-container {
  max-width: 1200px;
  margin: 0 auto;
  margin-top: 40px;
  padding: 20px;
}

.catalog-text h1 {
  text-align: start;
  margin-bottom: 30px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.catalog-grid {
  display: grid;
  /* แก้ไข 1: กำหนดความกว้างคอลัมน์เป็น 180px ตายตัว (ไม่ใช้ 1fr เพื่อป้องกันการยืด) */
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 25px;
  /* จัดกลุ่มกล่องให้อยู่กึ่งกลางหน้าจอ */
  justify-content: center;
}

.catalog-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;

  /* แก้ไข 2: ให้กล่องมีความกว้างตาม Grid ที่ตั้งไว้ */
  width: 100%;
  display: flex;
  flex-direction: column;
}

.catalog-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.catalog-image {
  width: 100%;
  /* แก้ไข 3: ตัด height: 300px ออก และให้เป็น auto เพื่อสูงตามรูปจริง */
  height: auto;
  background: transparent; /* เอาสีเทาออก */
  display: block;
  overflow: hidden;
  border-bottom: 1px solid #eee; /* เพิ่มเส้นคั่นบางๆ ระหว่างรูปกับชื่อ */
}

.catalog-image img {
  width: 100%;
  height: auto;
  display: block; /* ลบช่องว่างด้านล่างรูป */
  object-fit: cover; /* ใช้ cover เพื่อให้เต็มกรอบความกว้าง */
}

.catalog-content {
  padding: 10px; /* ลด Padding ให้กระชับขึ้น */
  font-size: 14px;
  color: #333;
  background-color: #fff;

  /* ให้เนื้อหายืดเต็มพื้นที่ที่เหลือ */
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-content p {
  margin: 0;
  line-height: 1.4;
}
