/* Đặt bàn - Quán Nhậu Bờ Kè. Prefix .bk- */

.bk { color: var(--ink); }

.bk-form[hidden] { display: none; }

.bk-form {
  background: var(--paper-2);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--ink);
  border-radius: var(--r);
  padding: clamp(18px, 3vw, 34px);
  display: grid;
  gap: clamp(16px, 2.4vw, 26px);
}

.bk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
}

.bk-fields { display: grid; gap: 18px; min-width: 0; }

.bk-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.7rem, 2.8vw, 2.2rem); letter-spacing: .02em; text-transform: uppercase;
}

.bk-field { display: grid; gap: 7px; min-width: 0; border: 0; padding: 0; margin: 0; }
.bk-field > label,
.bk-field > legend {
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); padding: 0;
}
.bk-field legend { margin-bottom: 2px; }

.bk-count {
  margin-left: 8px; font-size: 10.5px; letter-spacing: .04em;
  text-transform: none; color: var(--chili); font-weight: 600;
}

.bk-field input[type="text"],
.bk-field input[type="tel"],
.bk-field input[type="date"],
.bk-field input[type="number"],
.bk-field select,
.bk-field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.4;
  transition: border-color .2s, background .2s;
}
.bk-field textarea { resize: vertical; min-height: 88px; }
.bk-field select {
  appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A33A24' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.bk-field input:focus-visible,
.bk-field select:focus-visible,
.bk-field textarea:focus-visible,
.bk-slot input:focus-visible + .bk-slot-in {
  outline: none;
  border-color: var(--amber);
  background: var(--paper-2);
}
.bk-field input:disabled,
.bk-field select:disabled { opacity: .55; cursor: not-allowed; }

.bk-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 15px;
}
@media (max-width: 560px) { .bk-row { grid-template-columns: minmax(0, 1fr); } }

.bk-hint, .bk-small { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.bk-optional { text-transform: none; letter-spacing: 0; color: var(--muted-2); font-weight: 400; }

/* ---------- lưới giờ ---------- */
.bk-slots {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px; margin-top: 2px;
}
.bk-slot { position: relative; display: block; cursor: pointer; min-width: 0; }
.bk-slot input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.bk-slot-in {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 56px; padding: 6px 4px;
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: var(--paper); text-align: center;
  transition: border-color .18s, background .18s, color .18s;
}
.bk-slot-in b { font-family: var(--display); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.bk-slot-in small { font-size: 9.5px; letter-spacing: .03em; color: var(--muted); line-height: 1.2; }

.bk-slot:hover .bk-slot-in { border-color: var(--chili); }
.bk-slot input:checked + .bk-slot-in { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bk-slot input:checked + .bk-slot-in small { color: rgba(243, 231, 211, .78); }

.bk-slot.is-full { cursor: not-allowed; }
.bk-slot.is-full .bk-slot-in {
  background: var(--paper); border-style: dashed; color: var(--muted-2); opacity: .66;
}
.bk-slot.is-full:hover .bk-slot-in { border-color: var(--hairline); }

.bk-slots-status { margin: 0; font-size: 12.5px; color: var(--muted); }
.bk-slots.is-loading { opacity: .5; pointer-events: none; }

/* ---------- tóm tắt ---------- */
.bk-summary {
  position: sticky; top: 94px;
  background: var(--paper); border: 1px solid var(--hairline); border-top: 3px solid var(--ink);
  border-radius: var(--r); padding: 22px;
  display: grid; gap: 8px; align-content: start; min-width: 0;
}
.bk-summary-eyebrow {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.bk-sum-name { font-family: var(--display); font-size: 27px; line-height: 1; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.bk-sum-meta { font-size: 13px; color: var(--chili); font-weight: 600; font-variant-numeric: tabular-nums; }

.bk-sum-list { margin: 12px 0 0; display: grid; gap: 9px; }
.bk-sum-list > div {
  display: flex; justify-content: space-between; gap: 14px;
  border-top: 1px dotted var(--hairline); padding-top: 9px;
}
.bk-sum-list dt { font-size: 11.5px; color: var(--muted); flex: none; }
.bk-sum-list dd { margin: 0; font-size: 13px; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.bk-sum-note { margin: 12px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }

/* ---------- lỗi ---------- */
.bk-err { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--chili); font-weight: 500; }
.bk-err:empty { display: none; }
.bk-err-form {
  padding: 12px 14px; border: 1px solid rgba(163, 58, 36, .3);
  border-radius: var(--r); background: rgba(163, 58, 36, .07);
}
.bk-field.has-error input,
.bk-field.has-error select,
.bk-field.has-error textarea { border-color: var(--chili); background: rgba(163, 58, 36, .05); }

/* ---------- nút ---------- */
.bk-submit { display: grid; gap: 10px; }
.bk-submit .btn { min-height: 58px; }
.bk-small { text-align: center; }

/* ---------- thẻ xác nhận ---------- */
.bk-done {
  background: var(--paper-2); border: 1px solid var(--hairline); border-top: 3px solid var(--ink);
  border-radius: var(--r); padding: clamp(22px, 4vw, 40px);
  display: grid; gap: 6px; justify-items: center; text-align: center;
  max-width: 640px; margin-inline: auto;
}
.bk-done[hidden] { display: none; }
.bk-done-icon {
  width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--amber); color: var(--chili);
  font-size: 22px; margin-bottom: 8px;
}
.bk-done-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 3vw, 2.3rem); text-transform: uppercase; }
.bk-done-code {
  margin: 0; font-size: 11.5px; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--hairline); padding-bottom: 8px;
}
.bk-done-code b { color: var(--ink); letter-spacing: .1em; }
.bk-done .bk-sum-list { width: 100%; margin-top: 12px; text-align: left; }
.bk-done-note { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: var(--muted); }
.bk-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }

@media (max-width: 900px) {
  .bk-grid { grid-template-columns: minmax(0, 1fr); }
  .bk-summary { position: static; order: 2; margin-top: 4px; }
}

@media (max-width: 430px) {
  .bk-form { padding: 16px; }
  .bk-slots { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 7px; }
  .bk-slot-in { min-height: 50px; }
  .bk-done-actions { flex-direction: column; width: 100%; }
  .bk-done-actions .btn { width: 100%; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-slot-in, .bk-field input, .bk-field select, .bk-field textarea { transition: none; }
}
