/* ================================================================
   BOOKING WIDGET — calendario de citas multi-paso
   ================================================================ */

/* ── Variables de estado ──────────────────────────────────── */
:root {
  --green:      #4ade80;
  --green-bg:   rgba(74, 222, 128, 0.13);
  --yellow:     #fbbf24;
  --yellow-bg:  rgba(251, 191, 36, 0.13);
  --red:        #f87171;
  --red-bg:     rgba(248, 113, 113, 0.13);
  --blue-btn:   #1a4fd6;
  --blue-hover: #2557e0;
}

/* ── Contenedor ───────────────────────────────────────────── */

#booking-widget {
  max-width: 820px;
}

/* ── Barra de progreso ────────────────────────────────────── */

.booking-steps {
  display: flex;
  align-items: center;
  margin-bottom: 48px;
  list-style: none;
}

.bk-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.bk-step__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--white-dim);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.bk-step__label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-dim);
  transition: color 0.3s;
}

.bk-step--active .bk-step__num {
  border-color: var(--white);
  color: var(--white);
  background: var(--white-faint);
}

.bk-step--active .bk-step__label { color: var(--white); }

.bk-step--done .bk-step__num {
  border-color: var(--white);
  background: var(--white);
  color: var(--navy);
}

.bk-step--done .bk-step__label { color: var(--white-dim); }

.bk-step__line {
  flex: 1;
  height: 1px;
  background: var(--accent-line);
  margin: 0 6px 22px;
}

/* ── Paneles de cada paso ─────────────────────────────────── */

.bk-panel { display: none; }
.bk-panel.active { display: block; }

/* ── Back link ────────────────────────────────────────────── */

.bk-back {
  background: none;
  border: none;
  color: var(--white-dim);
  font-family: var(--font-family);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.bk-back:hover { color: var(--white); }

.bk-step-subtitle {
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--white-dim);
  margin-bottom: 28px;
}

/* ================================================================
   PASO 1 — CALENDARIO
   ================================================================ */

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.cal-month-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cal-nav {
  background: none;
  border: 1px solid var(--accent-line);
  color: var(--white);
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-family);
}

.cal-nav:hover { background: var(--white-faint); }
.cal-nav:disabled { opacity: 0.3; cursor: default; }

/* Grid del mes */
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-weekdays { margin-bottom: 6px; }

.cal-weekdays span {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--white-dim);
  padding: 4px 0;
}

.cal-grid { margin-bottom: 20px; }

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  border-radius: 2px;
}

.cal-day__num {
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1;
}

.cal-day__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Estados de disponibilidad */
.cal-day--available   { background: var(--green-bg); }
.cal-day--available   .cal-day__dot { background: var(--green); }
.cal-day--available:hover { border-color: var(--green); }

.cal-day--limited     { background: var(--yellow-bg); }
.cal-day--limited     .cal-day__dot { background: var(--yellow); }
.cal-day--limited:hover { border-color: var(--yellow); }

.cal-day--unavailable { background: var(--red-bg); cursor: not-allowed; }
.cal-day--unavailable .cal-day__dot { background: var(--red); }
.cal-day--unavailable .cal-day__num { color: var(--white-dim); }

.cal-day--past {
  opacity: 0.22;
  cursor: default;
  background: none;
}

.cal-day--today .cal-day__num {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cal-day--selected {
  border-color: var(--white) !important;
  background: var(--white-faint) !important;
}

.cal-day--empty {
  border: none;
  cursor: default;
  background: none;
}

/* Leyenda */
.cal-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.cal-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.63rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--white-dim);
}

.cal-legend__item::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-legend__item--available::before  { background: var(--green); }
.cal-legend__item--limited::before    { background: var(--yellow); }
.cal-legend__item--unavailable::before { background: var(--red); }

/* ================================================================
   PASO 2 — HORARIOS
   ================================================================ */

.slots-date-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.slot-btn {
  background: none;
  border: 1px solid var(--accent-line);
  color: var(--white);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 13px 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.slot-btn:hover:not(:disabled) {
  border-color: var(--white);
  background: var(--white-faint);
}

.slot-btn--selected {
  border-color: var(--white) !important;
  background: var(--white) !important;
  color: var(--navy) !important;
}

.slot-btn--taken {
  opacity: 0.25;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ================================================================
   PASO 3 — MODALIDAD
   ================================================================ */

.therapy-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.therapy-option {
  border: 1px solid var(--accent-line);
  padding: 28px 22px 24px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.therapy-option::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 22px;
  height: 22px;
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
}

.therapy-option:hover {
  border-color: rgba(255,255,255,0.55);
  background: var(--white-faint);
}

.therapy-option--selected {
  border-color: var(--white) !important;
  background: var(--white-faint) !important;
}

.therapy-option__name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 14px;
  line-height: 1.4;
}

.therapy-option__price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.therapy-option__price-unit {
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--white-dim);
  margin-top: 4px;
}

/* ================================================================
   PASO 4 — DATOS PERSONALES
   ================================================================ */

.bk-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 420px;
}

.bk-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.bk-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white-dim);
}

.bk-input {
  background: none;
  border: none;
  border-bottom: 1px solid var(--accent-line);
  color: var(--white);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 300;
  padding: 10px 0;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.bk-input::placeholder { color: rgba(255,255,255,0.25); }
.bk-input:focus { border-color: var(--white); }
.bk-input--error { border-color: var(--red) !important; }

.field-error {
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--red);
  min-height: 14px;
}

.bk-form-actions { margin-top: 8px; }

/* ================================================================
   PASO 5 — RESUMEN
   ================================================================ */

.summary-box {
  border: 1px solid var(--accent-line);
  padding: 28px 32px;
  max-width: 480px;
  margin-bottom: 32px;
  position: relative;
}

.summary-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 28px;
  height: 28px;
  border-top: 2px solid var(--white);
  border-left: 2px solid var(--white);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.summary-row:last-child { border-bottom: none; }

.summary-row__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white-dim);
  flex-shrink: 0;
}

.summary-row__value {
  font-size: 0.88rem;
  font-weight: 300;
  color: var(--white);
  text-align: right;
  margin-left: 16px;
}

.summary-row--total .summary-row__label,
.summary-row--total .summary-row__value {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--white);
}

/* ── Botones ──────────────────────────────────────────────── */

.btn-reserve {
  display: inline-block;
  padding: 14px 40px;
  background: var(--blue-btn);
  border: 1px solid var(--blue-btn);
  color: var(--white);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-reserve:hover:not(:disabled) {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

.btn-reserve:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-outline {
  display: inline-block;
  padding: 14px 24px;
  background: none;
  border: 1px solid var(--accent-line);
  color: var(--white-dim);
  font-family: var(--font-family);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-outline:hover {
  border-color: var(--white);
  color: var(--white);
}

.reserve-error {
  display: block;
  font-size: 0.68rem;
  color: var(--red);
  margin-top: 12px;
  letter-spacing: 0.05em;
  min-height: 16px;
}

/* ── Pantalla de confirmación ─────────────────────────────── */

.bk-confirmation {
  text-align: center;
  padding: 56px 0 32px;
  max-width: 480px;
}

.bk-confirm__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 24px;
}

.bk-confirm__title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.bk-confirm__msg {
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--white-dim);
  margin-bottom: 24px;
}

.bk-confirm__detail {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--white-dim);
  line-height: 2;
}

.bk-confirm__new {
  margin-top: 28px;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--accent-line);
  color: var(--white-dim);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s;
}

.bk-confirm__new:hover {
  border-color: var(--white);
  color: var(--white);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 700px) {
  .therapy-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .bk-step__label { display: none; }

  .booking-steps { gap: 0; }

  .slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-box {
    padding: 24px 20px;
  }
}
