/* ================================
   Promo Banner Section
================================ */

.promo-section {
  padding: 40px 0;
  background: #f8fafc;
  font-family: "Kanit", sans-serif;
}

.promo-container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

/* ================================
   Header
================================ */

.promo-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.promo-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.promo-header p {
  margin: 4px 0 0;
  font-size: 15px;
  color: #6b7280;
}

/* ================================
   Controls
================================ */

.promo-controls {
  display: flex;
  gap: 10px;
}

.promo-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

/* เอา hover ออก */
.promo-btn:hover {
  background: #ffffff;
  color: #111827;
  transform: none;
}

/* ถ้า JS ใส่ display none แล้วให้ซ่อนไปเลย */
.promo-btn[style*="display: none"] {
  display: none !important;
}

/* ================================
   Slider
================================ */

.promo-slider {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
}

.promo-track {
  display: flex;
  gap: 32px;
  align-items: center;
  transition: transform 0.55s ease;
  will-change: transform;
}

/* กรณีมีอันเดียว ให้แสดงตรงกลาง */
.promo-track.is-single {
  justify-content: center;
  transform: translateX(0) !important;
}

/* กรณีไม่มีการเลื่อน เช่น รูปน้อยกว่าหรือเท่ากับจำนวนที่แสดง */
.promo-track.is-no-slide {
  transform: translateX(0) !important;
}

/* ================================
   Banner Card
================================ */

.promo-card {
  flex: 0 0 calc((100% - 32px) / 2);
  min-height: 160px;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

/* กรณีมีอันเดียว desktop ให้กว้างประมาณ 1 ช่อง และอยู่กลาง */
.promo-track.is-single .promo-card {
  flex: 0 1 calc((100% - 32px) / 2);
}

/* รูปภาพ: ไม่ crop, ไม่ cover, ไม่บังคับขยายเต็ม */
.promo-card img {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: 100%;

  object-fit: contain;
  object-position: center;
}

/* เอา hover ของรูปออก */
.promo-card:hover img {
  transform: none;
}

/* ซ่อน overlay และข้อความบนรูป */
.promo-overlay,
.promo-content,
.promo-badge,
.promo-title,
.promo-desc {
  display: none !important;
}

/* ================================
   Dots
================================ */

.promo-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.promo-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
}

.promo-dot.active {
  width: 26px;
  background: #ac946e;
}

/* ================================
   Empty State
================================ */

.promo-empty {
  width: 100%;
  padding: 36px 20px;
  text-align: center;
  color: #6b7280;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

/* ================================
   Tablet
================================ */

@media (max-width: 991px) {
  .promo-track {
    gap: 20px;
  }

  .promo-card {
    flex-basis: calc((100% - 20px) / 2);
    min-height: 145px;
  }

  .promo-track.is-single .promo-card {
    flex-basis: calc((100% - 20px) / 2);
  }
}

/* ================================
   Mobile
================================ */

@media (max-width: 767px) {
  .promo-section {
    padding: 28px 0;
  }

  .promo-container {
    width: min(100% - 24px, 1180px);
  }

  .promo-header {
    align-items: center;
  }

  .promo-header h2 {
    font-size: 22px;
  }

  .promo-header p {
    font-size: 13px;
  }

  .promo-btn {
    width: 38px;
    height: 38px;
    font-size: 26px;
  }

  .promo-track {
    gap: 14px;
  }

  .promo-card,
  .promo-track.is-single .promo-card {
    flex: 0 0 100%;
    min-height: 130px;
  }

  .promo-card img {
    max-width: 100%;
    height: auto;
  }
}


/* ความรู้ */
/* ================================
   Knowledge Book Section
================================ */

.knowledge-section {
  font-family: "Kanit", sans-serif;
}

.knowledge-eyebrow {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #AC946E;
}

.knowledge-subtitle {
  max-width: 640px;
  margin: 16px auto 0;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.8;
}

.knowledge-loading {
  text-align: center;
  padding: 32px 16px;
  color: #6b7280;
  font-size: 15px;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 28px;
}

@media (min-width: 768px) {
  .knowledge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .knowledge-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.knowledge-book {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 0;
  min-width: 0;
}

.knowledge-book-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  perspective: 1200px;
}

.knowledge-book-cover {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 8px 14px 14px 8px;
  overflow: hidden;
  background: #efe7d8;
  box-shadow:
    0 16px 34px rgba(17, 24, 39, 0.16),
    inset 10px 0 18px rgba(0, 0, 0, 0.12);
  transform-origin: left center;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.knowledge-book:hover .knowledge-book-cover {
  transform: rotateY(-8deg) translateY(-4px);
  box-shadow:
    0 24px 48px rgba(17, 24, 39, 0.22),
    inset 10px 0 18px rgba(0, 0, 0, 0.14);
}

.knowledge-book-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 18px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.28),
    rgba(255, 255, 255, 0.08),
    rgba(0, 0, 0, 0.08)
  );
  z-index: 2;
}

.knowledge-book-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.28), transparent 48%);
  z-index: 1;
  pointer-events: none;
}

.knowledge-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.knowledge-book-file-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 28px);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #7a6747;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.knowledge-book-file-badge svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.knowledge-book-info {
  padding: 18px 4px 0;
}

.knowledge-book-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #AC946E;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-book-category svg {
  width: 14px;
  height: 14px;
}

.knowledge-book-title {
  margin: 0 0 8px;
  color: #1f2937;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  transition: color 0.25s ease;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-book:hover .knowledge-book-title {
  color: #AC946E;
}

.knowledge-book-desc {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-empty {
  max-width: 520px;
  margin: 0 auto;
  padding: 42px 24px;
  text-align: center;
  border: 1px dashed #d1d5db;
  border-radius: 18px;
  background: #ffffff;
  color: #6b7280;
}

.knowledge-empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(172, 148, 110, 0.12);
  color: #AC946E;
}

.knowledge-empty-icon svg {
  width: 28px;
  height: 28px;
}

.knowledge-empty h3 {
  margin: 0 0 8px;
  color: #1f2937;
  font-size: 18px;
  font-weight: 800;
}

.knowledge-empty p {
  margin: 0;
  font-size: 14px;
}

/* ================================
   Knowledge Modal
================================ */

.knowledge-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.knowledge-modal.is-open {
  display: block;
}

.knowledge-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
}

.knowledge-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 28px));
  height: min(88vh, 860px);
  margin: 5vh auto;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.knowledge-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
}

.knowledge-modal-label {
  margin: 0 0 4px;
  color: #AC946E;
  font-size: 12px;
  font-weight: 700;
}

.knowledge-modal-header h3 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
}

.knowledge-modal-close {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3f4f6;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.knowledge-modal-close:hover {
  background: #AC946E;
  color: #ffffff;
}

.knowledge-modal-close svg {
  width: 20px;
  height: 20px;
}

.knowledge-modal-body {
  flex: 1;
  min-height: 0;
  background: #f8fafc;
}

.knowledge-viewer {
  width: 100%;
  height: 100%;
}

.knowledge-viewer iframe,
.knowledge-viewer img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.knowledge-viewer img {
  object-fit: contain;
  padding: 20px;
}

.knowledge-viewer-message {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  color: #4b5563;
}

.knowledge-viewer-message h4 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
}

.knowledge-viewer-message p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}

.knowledge-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  justify-content: flex-end;
}

.knowledge-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #AC946E;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.knowledge-open-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(172, 148, 110, 0.35);
}

.knowledge-open-btn svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 767px) {
  .knowledge-modal-panel {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
  }

  .knowledge-modal-header {
    padding: 14px 16px;
  }

  .knowledge-modal-header h3 {
    font-size: 17px;
  }

  .knowledge-modal-footer {
    padding: 12px 16px;
  }

  .knowledge-open-btn {
    width: 100%;
    justify-content: center;
  }
}
/* ================================
   Knowledge Section
================================ */

.knowledge-section {
  font-family: "Kanit", sans-serif;
}

.knowledge-eyebrow {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #AC946E;
}

.knowledge-subtitle {
  max-width: 680px;
  margin: 16px auto 0;
  font-size: 15px;
  line-height: 1.8;
  color: #6b7280;
}

.knowledge-loading,
.knowledge-empty {
  text-align: center;
  color: #6b7280;
}

.knowledge-empty {
  padding: 44px 20px;
  border: 1px dashed #d1d5db;
  border-radius: 18px;
  background: #ffffff;
}

.knowledge-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #f5f0e8;
  color: #AC946E;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knowledge-empty-icon svg {
  width: 28px;
  height: 28px;
}

.knowledge-empty h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.knowledge-empty p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

/* ================================
   Knowledge Grid
================================ */

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

@media (min-width: 640px) {
  .knowledge-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .knowledge-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ================================
   Knowledge Card
================================ */

.knowledge-book {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.knowledge-book-cover-wrap {
  width: 100%;
}

/* จุดสำคัญ: บังคับกรอบปกให้เท่ากันทุกใบ */
.knowledge-book-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

/* ให้รูปเต็มกรอบและสูงเท่ากัน */
.knowledge-book-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.knowledge-book:hover .knowledge-book-cover img {
  transform: scale(1.035);
}

.knowledge-book-file-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.knowledge-book-file-badge svg {
  width: 15px;
  height: 15px;
}

/* ================================
   Text
================================ */

.knowledge-book-info {
  padding-top: 18px;
}

.knowledge-book-title {
  min-height: 56px;
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
  color: #111827;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.knowledge-book-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: #6b7280;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ================================
   Mobile
================================ */

@media (max-width: 639px) {
  .knowledge-section {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .knowledge-grid {
    gap: 28px;
  }

  .knowledge-book-cover {
    aspect-ratio: 3 / 4;
  }

  .knowledge-book-title {
    min-height: auto;
    font-size: 17px;
  }
}











/* ================================
   Stepper: เส้นเดียว + current step เด่น
================================ */

#status .ec-stepper {
  --step-progress: 25%;
  position: relative;
  display: flex;
  align-items: flex-start;
  min-width: 1100px;
  padding-top: 4px;
}

/* เส้นเดียวเท่านั้น */
#status .ec-stepper::before {
  content: "";
  position: absolute;
  top: 25px;
  left: calc(100% / 18);
  right: calc(100% / 18);
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #AC946E 0%,
    #AC946E var(--step-progress),
    #e5e7eb var(--step-progress),
    #e5e7eb 100%
  );
  z-index: 0;
}

#status .step-item {
  position: relative;
  z-index: 1;
  width: 11.111%;
  min-width: 122px;
  text-align: center;
  cursor: pointer;
  color: #9ca3af;
  padding: 0 8px;
}

/* ปิดเส้นเก่าที่ทำให้เหมือนมี 2 เส้น */
#status .step-item::before {
  display: none !important;
}

#status .step-circle {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  margin: 0 auto 12px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  transition: all 0.2s ease;
}

#status .step-item.active .step-circle {
  background: #AC946E;
  border-color: #AC946E;
  color: #ffffff;
}

/* ขั้นตอนล่าสุด */
#status .step-item.current .step-circle {
  width: 54px;
  height: 54px;
  margin-top: -6px;
  margin-bottom: 6px;
  background: #AC946E;
  border: 5px solid #f4efe6;
  color: #ffffff;
  box-shadow:
    0 0 0 4px rgba(172, 148, 110, 0.18),
    0 10px 24px rgba(172, 148, 110, 0.35);
  transform: scale(1.04);
}

#status .step-label {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  color: #6b7280;
  white-space: normal;
}

#status .step-item.active .step-label {
  color: #4b5563;
}

#status .step-item.current .step-label {
  color: #374151;
  font-size: 13px;
  font-weight: 900;
}

#status .step-item.selected:not(.current) .step-circle {
  box-shadow: 0 0 0 4px rgba(172, 148, 110, 0.12);
}

@media (max-width: 768px) {
  #status .ec-stepper {
    min-width: 1180px;
  }

  #status .step-item {
    min-width: 132px;
  }

  #status .step-label {
    font-size: 11px;
  }

  #status .step-item.current .step-label {
    font-size: 12px;
  }
}