/* Form đặt lịch hẹn — booking-schedule 2.1.0
 * Màu đi qua biến: --bk-main (màu chính), --bk-dark (thanh tóm tắt, chữ đậm), --bk-soft (nền ô).
 * Element "Form đặt lịch hẹn" ghi ba biến này lên wrapper từ option; không có thì theo màu chủ đề.
 * Mặc định khai ở :root — element ghi biến lên WRAPPER (tổ tiên gần hơn) nên đè được; khai trên
 * .booking-widget (con của wrapper) thì sẽ che mất option. */
:root {
    --bk-main: var(--theme-color, #15803d);
    --bk-dark: var(--secondary-color, #0b3b24);
    --bk-soft: #effaf3;
    --bk-text: #10261b;
    --bk-muted: #56685e;
    --bk-line: #dcebe2;
}
:where(.booking-widget) { background: #fff; position: relative; color: var(--bk-text); }
.booking-widget__head h3 { color: var(--bk-dark); font-weight: 800; font-size: 22px; line-height: 1.35; margin: 0 0 6px; }
.booking-widget__head p { color: var(--bk-muted); font-size: 14px; margin: 0 0 18px; }

/* ---- bước ---- */
.booking-widget .booking-step { margin-bottom: 26px; }
.booking-widget .booking-step__title {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 17px; font-weight: 700; color: var(--bk-dark); margin-bottom: 14px;
}
.booking-widget .booking-step__num {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--bk-main) 16%, #fff); color: var(--bk-main); font-style: normal; font-size: 13px; font-weight: 800;
}
.booking-widget .booking-step.is-done .booking-step__num { background: var(--bk-main); color: #fff; font-size: 0; }
.booking-widget .booking-step.is-done .booking-step__num::before { content: '\2713'; font-size: 13px; }

.booking-widget .booking-week-nav { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--bk-muted); }
.booking-widget .booking-nav {
    width: 30px; height: 30px; line-height: 1; border: 0; background: var(--bk-soft);
    border-radius: 50%; color: var(--bk-dark); font-size: 18px; cursor: pointer; padding: 0;
}
.booking-widget .booking-nav[disabled] { opacity: .35; cursor: not-allowed; }

/* ---- chip dịch vụ / người phục vụ ---- */
.booking-widget .booking-chips { display: grid; gap: 10px; }
.booking-widget .booking-chips--service { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.booking-widget .booking-chips--staff { display: flex; flex-wrap: wrap; }
.booking-widget .booking-chip {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px 8px 10px;
    border: 0; border-radius: 14px; background: var(--bk-soft); color: var(--bk-dark);
    font: inherit; font-size: 15px; font-weight: 600; text-align: left; line-height: 1.25; cursor: pointer;
    transition: background-color .2s, color .2s, box-shadow .2s;
}
.booking-widget .booking-chip[hidden] { display: none; }
.booking-widget .booking-chip:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bk-main) 40%, transparent); }
.booking-widget .booking-chip.is-active { background: var(--bk-main); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--bk-main) 28%, transparent); }
.booking-widget .booking-chip__icon {
    flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
}
.booking-widget .booking-chip__icon img { width: 100%; height: 100%; object-fit: contain; }
.booking-widget .booking-chip.is-active .booking-chip__icon { background: rgba(255, 255, 255, .18); }
.booking-widget .booking-chip.is-active .booking-chip__icon img { filter: brightness(0) invert(1); }

.booking-widget .booking-chip--person { border-radius: 999px; padding: 6px 18px 6px 6px; min-height: 48px; }
.booking-widget .booking-chip__avatar {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; background: #fff; color: var(--bk-main);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
}
.booking-widget .booking-chip__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.booking-widget .booking-chip__avatar--any { font-size: 18px; }
.booking-widget .booking-chip.is-active .booking-chip__avatar--any { background: rgba(255, 255, 255, .2); color: #fff; }
.booking-widget .booking-chip__text { display: flex; flex-direction: column; }
.booking-widget .booking-chip__text b { font-size: 14px; font-weight: 700; }
.booking-widget .booking-chip__text small { font-size: 12px; font-weight: 400; color: var(--bk-muted); }
.booking-widget .booking-chip.is-active .booking-chip__text small { color: rgba(255, 255, 255, .82); }

/* ---- ngày ---- */
.booking-widget .booking-hint { font-size: 13px; color: var(--bk-muted); margin: -4px 0 12px; }
.booking-widget .booking-hint b { color: var(--bk-main); }
.booking-widget .booking-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.booking-widget .booking-day {
    border-radius: 14px; background: var(--bk-soft); padding: 9px 4px 8px; text-align: center; cursor: pointer;
    color: var(--bk-dark); transition: background-color .2s, box-shadow .2s;
}
.booking-widget .booking-day b { display: block; font-size: 12px; font-weight: 600; }
.booking-widget .booking-day span { display: block; font-size: 19px; font-weight: 800; line-height: 1.25; }
.booking-widget .booking-day em { display: block; font-size: 12px; font-style: normal; }
.booking-widget .booking-day.is-active { background: var(--bk-main); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--bk-main) 30%, transparent); }
.booking-widget .booking-day.is-off { background: #f4f6f5; color: #b2bdb6; cursor: not-allowed; }

/* ---- ca ---- */
.booking-widget .booking-slots { background: var(--bk-soft); border-radius: 18px; padding: 12px 14px; }
.booking-widget .booking-range { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; }
.booking-widget .booking-range__label { flex: 0 0 64px; font-size: 13px; font-weight: 700; color: var(--bk-muted); padding-top: 9px; }
.booking-widget .booking-slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.booking-widget .booking-slot {
    min-width: 62px; height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: #fff;   /* 40px = vùng chạm tối thiểu */
    font: inherit; font-size: 14px; font-weight: 600; color: var(--bk-dark); cursor: pointer;
    box-shadow: 0 1px 3px rgba(11, 59, 36, .08); transition: background-color .2s, color .2s;
}
.booking-widget .booking-slot:hover:not([disabled]) { color: var(--bk-main); }
.booking-widget .booking-slot.is-active { background: var(--bk-main); color: #fff; box-shadow: 0 8px 18px color-mix(in srgb, var(--bk-main) 30%, transparent); }
.booking-widget .booking-slot[disabled] { cursor: not-allowed; background: transparent; box-shadow: none; color: #a5b5ab; }
.booking-widget .booking-slot.is-busy { text-decoration: line-through; }

.booking-widget .booking-empty { font-size: 14px; color: var(--bk-muted); padding: 8px 0; }
.booking-widget .booking-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--bk-muted); }
.booking-widget .booking-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.booking-widget .booking-legend .dot--free { background: #fff; box-shadow: inset 0 0 0 1px var(--bk-line); }
.booking-widget .booking-legend .dot--busy { background: #a5b5ab; }
.booking-widget .booking-legend .dot--short { background: #dfe6e2; }

/* ---- thông tin ---- */
.booking-widget .booking-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.booking-widget .booking-field { margin-bottom: 12px; }
.booking-widget .booking-grid .booking-field { margin-bottom: 0; }
/* nhãn chỉ cho trình đọc màn hình — placeholder đã nói đủ, như bản thiết kế */
.booking-widget .booking-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.booking-widget .booking-input {
    width: 100%; height: 48px; padding: 0 18px; font: inherit; font-size: 15px;
    border: 1px solid transparent; border-radius: 999px; background: var(--bk-soft); color: var(--bk-text); box-shadow: none;
}
.booking-widget .booking-input::placeholder { color: var(--bk-muted); opacity: 1; }
.booking-widget .booking-input:focus { border-color: var(--bk-main); outline: none; background: #fff; }
.booking-widget .booking-textarea { height: 96px; padding: 12px 18px; border-radius: 18px; resize: vertical; }

/* ---- thanh tóm tắt + nút ---- */
.booking-widget .booking-bar {
    display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 22px;
    background: var(--bk-dark); border-radius: 18px; color: #fff;
}
.booking-widget .booking-bar__text { flex: 1 1 auto; min-width: 0; }
.booking-widget .booking-bar__text small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .62); }
.booking-widget .booking-summary { font-size: 15px; line-height: 1.4; }
.booking-widget .booking-summary b { font-weight: 700; }
.booking-widget .booking-summary em { font-style: normal; font-weight: 600; color: #4ade80; }
.booking-widget .booking-submit {
    flex: 0 0 auto; height: 50px; padding: 0 26px; border: 0; border-radius: 999px;
    background: #22c55e; color: #06301b; font-weight: 700; font-size: 16px;
}
.booking-widget .booking-submit::before { display: none; }
.booking-widget .booking-submit[disabled] { opacity: .55; cursor: not-allowed; }

.booking-widget .booking-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.booking-widget.is-loading .booking-form { opacity: .6; pointer-events: none; }

/* ---- xong ---- */
.booking-widget .booking-done { text-align: center; padding: 40px 10px; }
.booking-widget .booking-done[hidden], .booking-widget .booking-form[hidden] { display: none; }
.booking-widget .booking-done__icon {
    width: 60px; height: 60px; line-height: 60px; border-radius: 50%; margin: 0 auto 14px;
    background: var(--bk-main); color: #fff; font-size: 28px;
}
.booking-widget .booking-done__title { font-size: 21px; font-weight: 800; color: var(--bk-dark); margin-bottom: 8px; }
.booking-widget .booking-done__body { font-size: 15px; color: var(--bk-muted); line-height: 26px; margin-bottom: 18px; }

@media (max-width: 767px) {
    .booking-widget .booking-nav { width: 40px; height: 40px; }   /* vùng chạm tối thiểu */
    .booking-widget .booking-chips--service { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .booking-widget .booking-days { grid-template-columns: repeat(7, minmax(42px, 1fr)); overflow-x: auto; }
    .booking-widget .booking-range { flex-direction: column; gap: 4px; }
    .booking-widget .booking-range__label { flex: none; padding-top: 0; }
    .booking-widget .booking-bar { flex-direction: column; align-items: stretch; padding: 16px; }
    .booking-widget .booking-submit { width: 100%; }
}
