/* ==========================================================================
   booking.css — "Đặt chỗ" section of a tour (template-parts/booking-section.php).
   Spec: client sheet "Tính Năng Website Hà Giang", sheet 2 (L-, P-, S- rows).
   Built from the site tokens only; the sheet's #2F5D62 / #F0F5F5 are the
   reference site's brand, so the selected card uses our green instead.
   Loaded only on tour pages that render the section.
   ========================================================================== */

.bk-off { margin: 0 0 var(--space-5); padding: .75rem 1rem; border: 1px dashed var(--orange-500); border-radius: var(--radius-sm); background: #fff8ea; font-size: var(--fs-small); color: var(--color-ink); }

.bk-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }

/* Left column (L-01..L-05) */
.bk-info { position: sticky; top: 100px; }
.bk-eyebrow { display: block; font-size: var(--fs-caption); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--green-600); }
.bk-title { font-family: var(--font-display); font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem); line-height: 1.15; margin: .4rem 0 .8rem; color: var(--color-ink); }
.bk-desc { color: var(--color-muted); font-size: var(--fs-small); margin: 0 0 1rem; }
.bk-base { margin: 0 0 1.2rem; color: var(--color-ink); }
.bk-base b { font-size: 1.75rem; font-weight: 800; color: var(--green-700); }
.bk-base small { color: var(--color-muted); }
.bk-wa { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 48px; padding: .7rem 1rem; border-radius: var(--radius-sm); background: #25D366; color: #fff; font-weight: 700; font-size: var(--fs-small); text-decoration: none; transition: filter .2s; }
.bk-wa:hover { filter: brightness(.94); color: #fff; }
.bk-trust { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: .55rem; font-size: var(--fs-small); color: var(--color-muted); }
.bk-trust li { display: flex; gap: .5rem; align-items: flex-start; }
.bk-trust svg { flex: none; color: var(--green-600); margin-top: .15rem; }

/* Form panel */
.bk-form { background: #fff; border: 1px solid var(--color-line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.bk-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; } /* honeypot: off-screen, never display:none (some bots skip hidden fields) */
.bk-block { padding: 1.1rem clamp(1rem, 3vw, 1.6rem); border: 0; border-bottom: 1px solid var(--color-line-soft); margin: 0; min-width: 0; }
.bk-label { display: flex; align-items: center; gap: .45rem; font-size: var(--fs-caption); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-ink); margin: 0 0 .5rem; padding: 0; }
.bk-label .ico { width: 1rem; height: 1rem; }
.bk-req { color: #d63638; font-style: normal; }
.bk-help { margin: -.2rem 0 .6rem; font-size: var(--fs-caption); color: var(--color-muted); }
.bk-input { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: #fff; font: inherit; color: var(--color-ink); }
.bk-input:focus { outline: 2px solid var(--green-500); outline-offset: 1px; border-color: var(--green-500); }
textarea.bk-input { min-height: 90px; resize: vertical; }

/* Date (P-02): typed dd/mm/yyyy field + calendar button over a hidden native picker */
.bk-date { position: relative; }
.bk-date .bk-input { padding-right: 3.2rem; }
.bk-date-native { position: absolute; right: 0; bottom: 0; width: 44px; height: 44px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.bk-date-btn { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 44px; display: grid; place-items: center; border: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: none; color: var(--green-700); cursor: pointer; }
.bk-date-btn:hover { background: var(--green-50); }
/* Touch screens: iOS Safari ignores showPicker() on a hidden input, so the native
   input itself covers the whole field and the tap opens the system picker; typing
   a date on a phone keyboard is worse anyway. The text field only displays it. */
@media (pointer: coarse) {
	.bk-date-native { top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: auto; -webkit-appearance: none; appearance: none; font-size: 16px; cursor: pointer; }
}

/* Stepper (P-01) */
.bk-stepper { display: inline-flex; align-items: center; gap: .3rem; }
.bk-stepper button { width: 44px; height: 44px; border: 1px solid var(--color-line); border-radius: 50%; background: #fff; font-size: 1.25rem; line-height: 1; color: var(--color-ink); cursor: pointer; }
.bk-stepper button:hover:not(:disabled) { border-color: var(--green-600); color: var(--green-700); }
.bk-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.bk-stepper output { min-width: 5.5rem; text-align: center; font-weight: 700; }

/* Option cards (P-03..P-06, S-01..S-03) */
.bk-options { display: grid; gap: .55rem; }
.bk-button_inline .bk-options { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.bk-card { position: relative; display: flex; gap: .75rem; align-items: flex-start; min-height: 48px; padding: .75rem .9rem; border: 1px solid var(--color-line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.bk-card:hover { border-color: var(--stone-400, #a8a29e); }
.bk-card input { flex: none; width: 18px; height: 18px; margin: .15rem 0 0; accent-color: var(--green-700); }
.bk-card:has(input:checked) { border-color: var(--green-700); background: var(--green-50); box-shadow: inset 0 0 0 1px var(--green-700); }
.bk-card:has(input:checked) .bk-card-name { font-weight: 700; }
.bk-card:has(input:focus-visible) { outline: 2px solid var(--green-500); outline-offset: 2px; }
.bk-card-body { display: grid; gap: .1rem; }
.bk-card-name { color: var(--color-ink); }
.bk-card-price { font-size: var(--fs-caption); font-weight: 700; color: var(--green-700); }
.bk-card-desc { font-size: var(--fs-caption); color: var(--color-muted); }
.bk-button_inline .bk-card { align-items: center; justify-content: center; }

/* Errors (S-04) */
.bk-err { margin: .45rem 0 0; font-size: var(--fs-caption); color: #d63638; }
.bk-invalid .bk-input, .bk-invalid .bk-card { border-color: #d63638; }
.bk-err-form { margin: 0 0 .8rem; }

/* Step 2 */
.bk-back { display: inline-flex; align-items: center; gap: .4rem; margin: 1rem clamp(1rem, 3vw, 1.6rem) 0; padding: 0; border: 0; background: none; color: var(--green-700); font: inherit; font-size: var(--fs-small); cursor: pointer; }
.bk-back .ico { transform: rotate(180deg); width: 1rem; height: 1rem; }
.bk-step[data-step="2"] > .bk-label { padding: 1rem clamp(1rem, 3vw, 1.6rem) 0; margin: 0; }
.bk-fields { display: grid; grid-template-columns: 1fr 1fr; }
.bk-fields .bk-block:nth-child(odd) { border-right: 1px solid var(--color-line-soft); }

/* Summary (P-20..P-22, P-30) */
.bk-summary { padding: 1.2rem clamp(1rem, 3vw, 1.6rem) 1.4rem; background: var(--stone-50, #fafaf9); }
.bk-lines { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .3rem; font-size: var(--fs-small); color: var(--color-muted); }
.bk-lines li { display: flex; justify-content: space-between; gap: 1rem; }
.bk-lines li b { color: var(--color-ink); font-weight: 600; white-space: nowrap; }
.bk-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; padding-top: .8rem; border-top: 1px solid var(--color-line); margin-bottom: 1rem; }
.bk-total span { font-weight: 700; color: var(--color-ink); }
.bk-total b { margin-left: auto; font-size: 1.6rem; font-weight: 800; color: var(--green-700); }
.bk-total small { width: 100%; text-align: right; color: var(--color-muted); font-size: var(--fs-caption); }
.bk-submit { width: 100%; justify-content: center; }
.bk-submit[aria-busy="true"] { opacity: .7; pointer-events: none; }
.bk-submit[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; margin-left: .5rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: bkspin .7s linear infinite; }
@keyframes bkspin { to { transform: rotate(360deg); } }

/* Confirmation (S-08) */
.bk-done { padding: clamp(1.5rem, 4vw, 2.5rem); text-align: center; outline: none; }
.bk-done .bk-ok { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 50%; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; }
.bk-done h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 .4rem; }
.bk-done .bk-code { display: inline-block; margin: .3rem 0 1rem; padding: .35rem .9rem; border-radius: var(--radius-pill); background: var(--green-50); color: var(--green-700); font-weight: 800; letter-spacing: .04em; }
.bk-done p { color: var(--color-muted); font-size: var(--fs-small); }
.bk-done .bk-wa { max-width: 520px; margin: 0 auto; }

/* Receipt table on the confirmation */
.bk-receipt { width: 100%; max-width: 520px; margin: .4rem auto 1.2rem; border-collapse: separate; border-spacing: 0; border: 1px solid var(--color-line); border-radius: var(--radius-md, 12px); overflow: hidden; text-align: left; font-size: var(--fs-small); background: #fff; }
.bk-receipt th, .bk-receipt td { padding: .7rem 1rem; border-bottom: 1px solid var(--color-line-soft); vertical-align: top; }
.bk-receipt tbody th { width: 40%; font-weight: 500; color: var(--color-muted); background: var(--stone-50, #fafaf9); }
.bk-receipt tbody td { color: var(--color-ink); font-weight: 600; overflow-wrap: anywhere; }
.bk-receipt tbody tr:last-child th, .bk-receipt tbody tr:last-child td { border-bottom: 0; }
.bk-receipt tfoot th, .bk-receipt tfoot td { border-bottom: 0; border-top: 2px solid var(--green-700); background: var(--green-50); vertical-align: middle; }
.bk-receipt tfoot th { font-weight: 700; color: var(--color-ink); }
.bk-receipt tfoot td { text-align: right; }
.bk-receipt tfoot b { display: block; font-size: 1.35rem; font-weight: 800; color: var(--green-700); line-height: 1.2; }
.bk-receipt tfoot small { color: var(--color-muted); font-size: var(--fs-caption); }
@media (max-width: 479px) {
	.bk-receipt th, .bk-receipt td { padding: .6rem .7rem; }
	.bk-receipt tbody th { width: 42%; }
}

/* Sticky bar (S-07, mobile) */
.bk-sticky { display: none; }
@media (max-width: 767px) {
	.bk-grid { grid-template-columns: 1fr; }
	.bk-info { position: static; }
	.bk-fields { grid-template-columns: 1fr; }
	.bk-fields .bk-block:nth-child(odd) { border-right: 0; }
	.bk-sticky:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 20px rgba(18, 60, 25, .12); }
	.bk-sticky small { display: block; font-size: var(--fs-caption); color: var(--color-muted); }
	.bk-sticky b { font-size: 1.15rem; color: var(--green-700); }
	.bk-sticky .btn { min-height: 44px; }
}

/* A <legend> sits on the fieldset's border box; floating it puts the group title
   inside the padding like every other block label. */
.bk-group > legend { float: left; width: 100%; }
.bk-group > legend + * { clear: both; }
