/* ==========================================================================
   CLC | BOOKING MODAL + EMBEDDED SLOT PICKER
   Owns the "Agenda tu Sesión Diagnóstica" popup and the inline date/time
   picker. Uses only the CLC tokens already defined in styles.css
   (--ink navy, --gold, --cream). Appended as its own file so specificity
   never fights the base sheet.
   ========================================================================== */

/* ---------- modal shell ---------- */
.bk-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 4vh, 3rem) 1rem;
  overflow-y: auto;
  background: rgb(var(--ink-rgb) / 0.62);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.bk-modal.is-open { display: flex; }
body.bk-locked { overflow: hidden; }

.bk-modal__panel {
  position: relative;
  width: min(38rem, 100%);
  background: var(--paper);
  border-radius: 1.25rem;
  padding: clamp(1.6rem, 3vw, 2.4rem);
  box-shadow: 0 24px 70px rgb(var(--ink-rgb) / 0.32);
  animation: bk-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bk-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bk-modal__panel { animation: none; }
}

.bk-modal__close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.bk-modal__close:hover { background: var(--gold-soft); }

.bk-modal__title {
  font-family: var(--ff-sans);
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
  line-height: 1.15;
  margin: 0 0 0.45rem;
}
.bk-modal__intro {
  color: var(--gray-dark);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 1.4rem;
}

/* ---------- form fields inside the modal ---------- */
.bk-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.3rem;
}
.bk-form input,
.bk-form select,
.bk-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--gray-warm);
  border-radius: 0.55rem;
  padding: 0.7rem 0.85rem;
  margin: 0 0 0.85rem;
}
.bk-form textarea { min-height: 5.5rem; resize: vertical; }
.bk-form input:focus-visible,
.bk-form select:focus-visible,
.bk-form textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.bk-form__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.7rem;
}
.bk-form__consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 0.7rem;
}
.bk-form__consent input { width: auto; margin: 0.2rem 0 0; }
.bk-form__consent label {
  margin: 0;
  font-weight: 400;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--gray-dark);
}

/* ---------- the slot picker ---------- */
.bk-picker {
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
  padding: 1rem 0 1.1rem;
  margin: 0.4rem 0 1.1rem;
}
.bk-picker[hidden] { display: none; }

.bk-picker__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.7rem;
}
.bk-picker__label span {
  font-weight: 400;
  color: var(--gray-mid);
}

.bk-picker__toggle {
  display: none;
  width: 100%;
  text-align: left;
  background: var(--cream);
  border: 1px solid var(--gold-soft);
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}
.bk-picker__toggle::after { content: " ▾"; color: var(--gold-dark); }

.bk-picker__row {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.45rem;
  scrollbar-width: thin;
}
.bk-picker__row + .bk-picker__row { margin-top: 0.6rem; }

.bk-chip {
  flex: 0 0 auto;
  border: 1px solid var(--gray-warm);
  background: var(--paper);
  color: var(--ink);
  border-radius: 2rem;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bk-chip:hover { border-color: var(--gold); }
.bk-chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 600;
}
.bk-chip:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; }

.bk-picker__note {
  font-size: 0.78rem;
  color: var(--gray-dark);
  line-height: 1.5;
  margin: 0.75rem 0 0;
}

/* ---------- submit + status ---------- */
.bk-form__submit {
  width: 100%;
  border: 0;
  border-radius: 2rem;
  background: var(--gold);
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  font-size: var(--fs-btn);
  padding: 0.95rem 1.4rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.bk-form__submit:hover { background: var(--gold-dark); color: var(--paper); }
.bk-form__submit[aria-busy="true"] { opacity: 0.75; cursor: progress; }

.bk-form__status {
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0.8rem 0 0;
  color: var(--gray-dark);
  min-height: 1.2em;
}
.bk-form__status.is-error { color: #a3323d; font-weight: 600; }

/* ---------- mobile: collapse the picker to one row ---------- */
@media (max-width: 640px) {
  .bk-picker__toggle { display: block; }
  .bk-picker__body { display: none; margin-top: 0.7rem; }
  .bk-picker.is-expanded .bk-picker__body { display: block; }
  .bk-modal__panel { padding: 1.4rem 1.15rem 1.6rem; border-radius: 1rem; }
  .bk-form__row { grid-template-columns: 6.5rem 1fr; }
}
