.khb-woo-form,
.khb-woo-quick,
.khb-woo-confirm {
  --khb-navy: #1d2b53;
  --khb-gold: #7a6532;
  --khb-line: #e3dccb;
  --khb-soft: #fbf3dc;
  color: var(--khb-navy);
  font-family: inherit;
}

.khb-woo-live-loading { padding: 24px 0; text-align: center; color: #5b6075; }
.khb-woo-month { margin: 28px 0 12px; font-size: 1.25em; }
.khb-woo-list { display: flex; flex-direction: column; gap: 12px; }

/* การ์ดรอบเรียน: ซ้าย = ติ๊ก/วันที่/ชื่อ (label) ขวา = ราคา + ตัวนับจำนวนผู้เรียนของรอบนั้น */
.khb-woo-round {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; min-height: 44px; box-sizing: border-box;
  border: 2px solid var(--khb-line); border-radius: 12px; background: #fff;
}
.khb-woo-round.is-checked { border-color: var(--khb-navy); background: var(--khb-soft); }
.khb-woo-round.is-full { background: #f1f0ec; color: #5b6075; }
.khb-woo-round:focus-within { outline: 3px solid var(--khb-navy); outline-offset: 2px; }

.khb-woo-round-main { flex: 1 1 auto; display: flex; align-items: center; gap: 16px; min-width: 0; cursor: pointer; }
.khb-woo-round.is-full .khb-woo-round-main { cursor: not-allowed; }
.khb-woo-round input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--khb-navy); flex-shrink: 0; margin: 0; }

.khb-woo-date { display: flex; flex-direction: column; align-items: center; width: 64px; flex-shrink: 0; line-height: 1.15; }
.khb-woo-dow, .khb-woo-mon { font-size: 0.8em; color: #5b6075; }
.khb-woo-day { font-size: 1.9em; font-weight: 700; }

.khb-woo-info { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.khb-woo-name { font-weight: 600; font-size: 1.05em; }

.khb-woo-round-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.khb-woo-price { font-weight: 700; white-space: nowrap; }
.khb-woo-round-qty { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.khb-woo-qty-label { font-size: 0.9em; font-weight: 600; white-space: nowrap; }
.khb-woo-qty-unit { font-size: 0.9em; }

.khb-woo-seats { align-self: flex-start; font-size: 0.85em; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.khb-seat-open { background: #e4efe3; color: #245a2c; }
.khb-seat-few  { background: #fde8d9; color: #8a3410; }
.khb-seat-full { background: #e2e1dc; color: #4a4d5c; }

/* ตัวนับ − / + ขนาดกะทัดรัด (กำหนดความสูงตายตัวและล็อกค่าที่ธีมมักเปลี่ยน เช่น padding/margin/height ของ input และ button) */
.khb-woo-form .khb-woo-stepper, .khb-woo-quick .khb-woo-stepper, .khb-woo-pkform .khb-woo-stepper{
  display: inline-flex; align-items: center; height: 36px; box-sizing: border-box;
  border: 1px solid #9aa0ae; border-radius: 8px; overflow: hidden; background: #fff; margin: 0; padding: 0; width: auto;
}
.khb-woo-form .khb-woo-stepper .khb-step, .khb-woo-quick .khb-woo-stepper .khb-step, .khb-woo-pkform .khb-woo-stepper .khb-step{
  width: 34px; height: 34px; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
  background: #fff; color: #1565c0; font-size: 20px; line-height: 34px; font-weight: 400; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.khb-woo-stepper .khb-step:disabled { color: #9aa0ae; cursor: not-allowed; background: #fff; }
.khb-woo-form .khb-woo-stepper input[type="number"], .khb-woo-quick .khb-woo-stepper input[type="number"], .khb-woo-pkform .khb-woo-stepper input[type="number"]{
  width: 36px; height: 34px; min-height: 0; max-width: none; box-sizing: border-box; margin: 0; padding: 0;
  border: 0; border-radius: 0; box-shadow: none; text-align: center; font-size: 16px; font-weight: 600; line-height: 34px;
  color: #111; background: #fff; -moz-appearance: textfield; appearance: textfield;
}
.khb-woo-stepper input[type="number"]::-webkit-outer-spin-button,
.khb-woo-stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.khb-woo-stepper .khb-step:focus-visible, .khb-woo-stepper input:focus-visible { outline: 2px solid #1565c0; outline-offset: -2px; }

.khb-woo-people-label { font-weight: 600; }
.khb-woo-people-inline { display: inline-flex; align-items: center; gap: 8px; }

.khb-woo-summary {
  margin-top: 24px; padding: 20px; border: 1px solid var(--khb-line); border-radius: 12px; background: #fff;
  display: flex; flex-direction: column; gap: 14px;
}
.khb-woo-mode { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.khb-woo-mode legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.khb-woo-mode label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.khb-woo-total { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 1.05em; }
.khb-woo-total strong { font-size: 1.25em; }

.khb-woo-submit, .khb-woo-btn {
  display: inline-block; min-height: 48px; padding: 0 28px; border: 0; border-radius: 10px;
  background: var(--khb-navy); color: #fff; font-weight: 700; font-size: 1.05em; cursor: pointer; text-decoration: none; line-height: 48px; text-align: center;
}
.khb-woo-submit:disabled { background: #8c90a0; cursor: not-allowed; }
.khb-woo-submit:focus-visible, .khb-woo-btn:focus-visible { outline: 3px solid var(--khb-navy); outline-offset: 2px; }

.khb-woo-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.khb-woo-quick .khb-woo-mode legend { position: absolute; left: -9999px; }

.khb-woo-confirm { margin: 24px 0; padding: 20px 24px; border-radius: 12px; border: 2px solid var(--khb-line); background: #fff; }
.khb-woo-confirm-ok { border-color: #245a2c; }
.khb-woo-confirm-wait { border-color: #b8860b; background: var(--khb-soft); }
.khb-woo-confirm h2 { margin-top: 0; }
.khb-woo-confirm-list { padding-left: 20px; }
.khb-woo-confirm-list a { margin-left: 8px; }

/* ปุ่มสลับมุมมอง */
.khb-woo-view { display: flex; justify-content: flex-end; gap: 6px; margin: 0 0 4px; }
.khb-woo-form .khb-view-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; margin: 0; padding: 0 12px;
  border: 1px solid #9aa0ae; border-radius: 8px; background: #fff; color: #444; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: none; text-transform: none;
}
.khb-woo-form .khb-view-btn[aria-pressed="true"] { background: var(--khb-navy); border-color: var(--khb-navy); color: #fff; }
.khb-woo-form .khb-view-btn:focus-visible { outline: 2px solid var(--khb-navy); outline-offset: 2px; }

/* มุมมองแบบรายการ: แถวเดียวต่อรอบ ดูรอบเยอะๆ ได้สะดวก */
.khb-woo-form.is-list .khb-woo-month { margin: 20px 0 8px; font-size: 1.1em; }
.khb-woo-form.is-list .khb-woo-list { gap: 0; border: 1px solid var(--khb-line); border-radius: 10px; overflow: hidden; background: #fff; }
.khb-woo-form.is-list .khb-woo-round { border: 0; border-bottom: 1px solid var(--khb-line); border-radius: 0; padding: 6px 14px; gap: 12px; min-height: 52px; }
.khb-woo-form.is-list .khb-woo-round:last-child { border-bottom: 0; }
.khb-woo-form.is-list .khb-woo-round.is-checked { box-shadow: inset 4px 0 0 var(--khb-navy); }
.khb-woo-form.is-list .khb-woo-round:focus-within { outline-offset: -3px; }
.khb-woo-form.is-list .khb-woo-round-main { gap: 12px; }
.khb-woo-form.is-list .khb-woo-date { flex-direction: row; align-items: baseline; width: auto; min-width: 118px; gap: 6px; }
.khb-woo-form.is-list .khb-woo-day { font-size: 1.2em; }
.khb-woo-form.is-list .khb-woo-dow, .khb-woo-form.is-list .khb-woo-mon { font-size: 0.9em; }
.khb-woo-form.is-list .khb-woo-info { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.khb-woo-form.is-list .khb-woo-seats { align-self: center; }
.khb-woo-form.is-list .khb-woo-round-side { flex-direction: row; align-items: center; gap: 14px; }
.khb-woo-form.is-list .khb-woo-price { min-width: 84px; text-align: right; }
.khb-woo-form.is-list .khb-woo-qty-label { position: absolute; left: -9999px; }
.khb-woo-form.is-list .khb-woo-round-qty { min-width: 128px; justify-content: flex-end; }

@media (max-width: 520px) {
  .khb-woo-round { flex-wrap: wrap; gap: 10px 12px; padding: 12px; }
  .khb-woo-round-main { flex: 1 1 100%; gap: 12px; }
  /* แถวล่างของการ์ด: ราคาอยู่ซ้าย ตัวนับอยู่ขวา บรรทัดเดียว (ถ้าจอแคบมากให้ตัวนับลงบรรทัดใหม่ชิดขวา) */
  .khb-woo-round-side { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 10px; margin: 0; padding-top: 10px; border-top: 1px dashed var(--khb-line); }
  .khb-woo-round-qty { flex-wrap: nowrap; gap: 6px; margin-left: auto; }
  .khb-woo-qty-label, .khb-woo-qty-unit { font-size: 0.85em; }
  .khb-woo-form .khb-woo-stepper, .khb-woo-quick .khb-woo-stepper, .khb-woo-pkform .khb-woo-stepper{ height: 32px; }
  .khb-woo-form .khb-woo-stepper .khb-step, .khb-woo-quick .khb-woo-stepper .khb-step, .khb-woo-pkform .khb-woo-stepper .khb-step{ width: 30px; height: 30px; line-height: 30px; font-size: 18px; }
  .khb-woo-form .khb-woo-stepper input[type="number"], .khb-woo-quick .khb-woo-stepper input[type="number"], .khb-woo-pkform .khb-woo-stepper input[type="number"]{ width: 32px; height: 30px; line-height: 30px; font-size: 15px; }
  /* มือถือ + มุมมองรายการ: 2 บรรทัดต่อรอบ  บน = ติ๊ก · วันที่ · ชื่อ · ราคา  ล่าง = ที่นั่งเหลือ · ตัวนับ (จัดด้วย grid) */
  .khb-woo-form.is-list .khb-woo-round {
    display: grid; grid-template-columns: 24px auto minmax(0, 1fr) auto; grid-template-areas: "chk date name price" ". seats seats qty";
    align-items: center; gap: 4px 8px; padding: 8px 12px; min-height: 0;
  }
  .khb-woo-form.is-list .khb-woo-round.has-days { grid-template-areas: "chk date name price" ". days days days" ". seats seats qty"; }
  .khb-woo-form.is-list .khb-woo-days { grid-area: days; }
  .khb-woo-form.is-list .khb-woo-round-main, .khb-woo-form.is-list .khb-woo-info, .khb-woo-form.is-list .khb-woo-round-side { display: contents; }
  .khb-woo-form.is-list .khb-woo-round input[type="checkbox"] { grid-area: chk; align-self: start; margin-top: 4px; }
  .khb-woo-form.is-list .khb-woo-date { grid-area: date; min-width: 0; gap: 3px; }
  .khb-woo-form.is-list .khb-woo-dow, .khb-woo-form.is-list .khb-woo-mon { font-size: 0.8em; }
  .khb-woo-form.is-list .khb-woo-day { font-size: 1.1em; }
  .khb-woo-form.is-list .khb-woo-name { grid-area: name; font-size: 0.95em; overflow-wrap: anywhere; }
  .khb-woo-form.is-list .khb-woo-price { grid-area: price; min-width: 0; text-align: right; font-size: 0.95em; }
  .khb-woo-form.is-list .khb-woo-seats { grid-area: seats; justify-self: start; }
  .khb-woo-form.is-list .khb-woo-round-qty { grid-area: qty; min-width: 0; justify-self: end; }
  .khb-woo-view { justify-content: stretch; }
  .khb-woo-form .khb-view-btn { flex: 1 1 0; justify-content: center; }
}

/* Package [khb_package] */
.khb-woo-pkform { --khb-navy: #1d2b53; --khb-gold: #7a6532; --khb-line: #e3dccb; --khb-soft: #fbf3dc; color: var(--khb-navy); font-family: inherit; }
.khb-woo-pk-banner { margin: 0 0 16px; padding: 16px 18px; border: 2px solid var(--khb-line); border-radius: 12px; background: var(--khb-soft); }
.khb-woo-pk-title { font-size: 1.3em; font-weight: 700; margin-bottom: 6px; }
.khb-woo-pk-price { margin-top: 8px; font-size: 1.1em; }
.khb-woo-pk-price strong { font-size: 1.5em; }
.khb-woo-pk-price small { color: #5b6075; font-size: .8em; }
.khb-woo-pk-child { margin: 0 0 14px; padding: 12px 14px 14px; border: 2px solid var(--khb-line); border-radius: 12px; background: #fff; min-width: 0; }
.khb-woo-pk-child legend { padding: 0 8px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.khb-woo-pk-child legend i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; }
.khb-woo-pk-rounds { display: flex; flex-wrap: wrap; gap: 8px; }
.khb-woo-pk-round { display: flex !important; align-items: center; gap: 8px; margin: 0 !important; padding: 8px 12px !important; min-height: 44px; box-sizing: border-box; border: 2px solid var(--khb-line); border-radius: 10px; background: #fff; cursor: pointer; line-height: 1.3; }
.khb-woo-pk-round.is-checked { border-color: var(--khb-navy); background: var(--khb-soft); }
.khb-woo-pk-round.is-full { opacity: .55; cursor: not-allowed; }
.khb-woo-pk-round input[type=radio] { -webkit-appearance: none !important; appearance: none !important; flex: 0 0 18px; width: 18px !important; height: 18px !important; min-width: 18px; margin: 0 !important; padding: 0 !important; border: 2px solid #8a7a66 !important; border-radius: 50% !important; background: #fff !important; box-shadow: none !important; position: static !important; }
.khb-woo-pk-round input[type=radio]:checked { border-color: var(--khb-navy) !important; background: radial-gradient(circle, var(--khb-navy) 0 45%, #fff 50%) !important; }
.khb-woo-pk-date { font-weight: 600; }
.khb-woo-pk-msg { margin: 8px 0; color: #b3261e; font-weight: 600; }
.khb-woo-days { display: block; font-size: .85em; color: var(--khb-gold); }
@media (max-width: 600px) { .khb-woo-pk-round { width: 100%; } }

/* ปุ่มของ Package: สีตั้งได้ที่ KHB Booking > ตั้งค่า (ส่งมาเป็นตัวแปร CSS บนฟอร์ม) */
.khb-woo-pkform .khb-woo-submit, .khb-woo-pkform .khb-woo-pk-line { display: block !important; width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 28px; border: 0 !important; border-radius: 10px !important; font-weight: 700; font-size: 1.05em; line-height: 48px; text-align: center; text-decoration: none !important; cursor: pointer; }
.khb-woo-pkform .khb-woo-submit { background: var(--khb-pk-pay-bg, #1d2b53) !important; color: var(--khb-pk-pay-fg, #fff) !important; }
.khb-woo-pkform .khb-woo-submit:disabled { opacity: .45; cursor: not-allowed; }
.khb-woo-pkform .khb-woo-pk-line { margin-top: 10px; background: var(--khb-pk-line-bg, #06c755) !important; color: var(--khb-pk-line-fg, #fff) !important; }
.khb-woo-pkform .khb-woo-pk-line:hover, .khb-woo-pkform .khb-woo-pk-line:focus-visible { opacity: .9; }
.khb-woo-pk-hint { margin: 8px 0; color: #7a6532; font-weight: 600; }

/* ปุ่มสมัครทางไลน์ ในฟอร์มจองคอร์ส */
.khb-woo-form .khb-woo-line-btn { display: block !important; width: 100%; box-sizing: border-box; min-height: 48px; margin-top: 10px; padding: 0 28px; border: 0 !important; border-radius: 10px !important; font-weight: 700; font-size: 1.05em; line-height: 48px; text-align: center; text-decoration: none !important; background: var(--khb-pk-line-bg, #06c755) !important; color: var(--khb-pk-line-fg, #fff) !important; }
.khb-woo-form .khb-woo-line-btn:hover, .khb-woo-form .khb-woo-line-btn:focus-visible { opacity: .9; }

/* ปุ่มจอง + ปุ่มไลน์: กว้างเท่ากันเต็มแถว ชิดกัน (ธีมมักใส่ margin ให้ปุ่มทำให้กว้างไม่เท่าและห่างกัน) */
.khb-woo-form .khb-woo-summary .khb-woo-submit, .khb-woo-pkform .khb-woo-summary .khb-woo-submit,
.khb-woo-form .khb-woo-line-btn, .khb-woo-pkform .khb-woo-line-btn {
  display: block !important; width: 100% !important; max-width: none !important; box-sizing: border-box !important;
  min-height: 48px !important; margin: 0 !important; padding: 0 28px !important; line-height: 48px !important; float: none !important;
}
.khb-woo-form .khb-woo-line-btn, .khb-woo-pkform .khb-woo-line-btn { margin-top: -6px !important; } /* summary มี gap 14px อยู่แล้ว -> เหลือห่างกัน 8px */

/* สีปุ่มจอง (ตั้งที่ KHB Booking > ตั้งค่า) ใช้กับฟอร์มจองคอร์สและปุ่มจองรอบเดียวด้วย */
.khb-woo-form .khb-woo-submit, .khb-woo-quick .khb-woo-submit { background: var(--khb-pk-pay-bg, #1d2b53) !important; color: var(--khb-pk-pay-fg, #fff) !important; }
.khb-woo-form .khb-woo-submit:disabled, .khb-woo-quick .khb-woo-submit:disabled { opacity: .45; }

/* กล่องข้อความใต้ปุ่มไลน์ (แก้ข้อความที่ KHB Booking > ตั้งค่า) */
.khb-woo-line-note { margin: 0; padding: 12px 14px; border: 0; border-radius: 10px; background: #f4faf0; color: #2f4a2a; font-size: .92em; line-height: 1.6; text-align: center; }
.khb-woo-line-note a { color: inherit; text-decoration: underline; }
.khb-woo-pkform .khb-woo-line-btn { background: var(--khb-pk-line-bg, #06c755) !important; color: var(--khb-pk-line-fg, #fff) !important; border-radius: 10px !important; font-weight: 700; font-size: 1.05em; text-align: center; text-decoration: none !important; }
.khb-woo-pkform .khb-woo-line-btn:hover, .khb-woo-pkform .khb-woo-line-btn:focus-visible { opacity: .9; }
