/* ═══════════════════════════════════════════════════════════════════════
   Lazzo Bienestar · Cliente — Calendario + slots (C4-α)
   Replicación fiel del diseño Claude Design (cliente-reservas-styles.css §02-03).
   Scope `.bcl-cal-*` para no chocar con global ni welcome.
   ═══════════════════════════════════════════════════════════════════════ */

.bcl-cal-overlay {
  position: fixed; inset: 0;
  z-index: 1050;
  background: var(--bcl-bg, #fdf6f0);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.bcl-cal-overlay.open { transform: translateX(0); pointer-events: auto; }

.bcl-cal-inner {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--bcl-txt);
}
/* Wrapper que crece para empujar el footer al final del scroll */
.bcl-cal-content-grow { flex: 1 0 auto; }

/* ── Topbar ─────────────────────────────────────────────────────────────── */
.bcl-cal-topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 18px 8px;
  background: linear-gradient(180deg, var(--bcl-bg) 70%, transparent 100%);
}
.bcl-cal-back, .bcl-cal-info {
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  box-shadow: 0 1px 6px -2px rgba(0,0,0,.10);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--bcl-txt);
  flex-shrink: 0;
}
.bcl-cal-back i, .bcl-cal-info i { width: 18px; height: 18px; }
.bcl-cal-back:active, .bcl-cal-info:active { transform: scale(.95); }
.bcl-cal-info { color: var(--bcl-muted); }
.bcl-cal-title {
  flex: 1;
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: 18px;
  color: var(--bcl-txt);
}

/* ── Pro strip ──────────────────────────────────────────────────────────── */
.bcl-cal-pro-strip {
  margin: 0 18px 6px;
  display: flex; gap: 12px; align-items: center;
  background: white;
  border: 1px solid var(--bcl-line);
  border-radius: 16px;
  padding: 10px 12px;
}
.bcl-cal-pro-av {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bcl-grad);
  color: white;
  font-weight: 700;
  font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bcl-cal-pro-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.bcl-cal-pro-meta { flex: 1; min-width: 0; }
.bcl-cal-pro-meta .nm {
  font-weight: 600; font-size: 14px;
  display: flex; align-items: center; gap: 6px;
  color: var(--bcl-txt);
}
.bcl-cal-pro-meta .nm i {
  width: 13px; height: 13px;
  color: var(--bcl-c1-d);
}
.bcl-cal-pro-meta .role {
  font-size: 12px;
  color: var(--bcl-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bcl-cal-pro-rate {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700;
  color: var(--bcl-c2-d);
  flex-shrink: 0;
}
.bcl-cal-pro-rate i { width: 13px; height: 13px; fill: currentColor; }

/* ── Mes header ─────────────────────────────────────────────────────────── */
.bcl-cal-month-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 8px;
}
.bcl-cal-month-h .m {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--bcl-txt);
}
.bcl-cal-month-h .nav { display: flex; gap: 6px; }
.bcl-cal-nav-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--bcl-line);
  color: var(--bcl-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.bcl-cal-nav-btn:hover { color: var(--bcl-txt); background: var(--bcl-bg-soft); }
.bcl-cal-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bcl-cal-nav-btn i { width: 16px; height: 16px; }

/* ── Grid calendario ───────────────────────────────────────────────────── */
.bcl-cal-grid { padding: 0 18px; }
.bcl-cal-dows {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.bcl-cal-dows > div {
  text-align: center;
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; font-weight: 700;
  color: var(--bcl-muted);
  padding: 4px 0;
}
.bcl-cal-days {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.bcl-cal-day {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500;
  color: var(--bcl-txt);
  background: transparent;
  border: 1px solid transparent;
  position: relative;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s;
  cursor: pointer;
}
.bcl-cal-day.outside { visibility: hidden; pointer-events: none; }
.bcl-cal-day.past { color: var(--bcl-muted); cursor: not-allowed; opacity: 0.55; }
.bcl-cal-day.unavailable {
  color: var(--bcl-muted);
  cursor: not-allowed;
  opacity: 0.55;
  background: var(--bcl-bg-soft);
  border-color: var(--bcl-line);
}
.bcl-cal-day.available {
  background: color-mix(in srgb, var(--bcl-c1) 8%, white);
  border-color: color-mix(in srgb, var(--bcl-c1) 22%, transparent);
  color: var(--bcl-txt);
}
.bcl-cal-day.available::after {
  content: "";
  position: absolute;
  bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--bcl-c1);
}
.bcl-cal-day.available:hover {
  background: color-mix(in srgb, var(--bcl-c1) 16%, white);
  border-color: color-mix(in srgb, var(--bcl-c1) 38%, transparent);
  transform: scale(1.04);
}
.bcl-cal-day.selected {
  background: var(--bcl-grad) !important;
  color: white !important;
  border-color: transparent !important;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--bcl-c1) 35%, transparent);
}
.bcl-cal-day.selected::after { background: white; }
.bcl-cal-day.today {
  font-weight: 800;
  outline: 1px dashed var(--bcl-c2);
  outline-offset: -3px;
}

/* ── Leyenda ───────────────────────────────────────────────────────────── */
.bcl-cal-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px 6px;
  font-size: 12px; color: var(--bcl-muted);
}
.bcl-cal-legend .leg {
  display: inline-flex; align-items: center; gap: 6px;
}
.bcl-cal-legend .leg .sw {
  width: 10px; height: 10px; border-radius: 3px;
  background: color-mix(in srgb, var(--bcl-c1) 14%, white);
  border: 1px solid color-mix(in srgb, var(--bcl-c1) 30%, transparent);
}
.bcl-cal-legend .leg .sw.sel {
  background: var(--bcl-grad);
  border-color: transparent;
}
.bcl-cal-legend .leg .sw.un {
  background: var(--bcl-bg-soft);
  border-color: var(--bcl-line);
}

/* ── Day detail card ───────────────────────────────────────────────────── */
.bcl-cal-day-detail {
  margin: 12px 18px 0;
  background: white;
  border: 1px solid var(--bcl-line);
  border-radius: 18px;
  padding: 14px;
}
.bcl-cal-day-detail .lab {
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  color: var(--bcl-c1-d);
}
.bcl-cal-day-detail .d {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 19px;
  margin: 4px 0 4px;
  color: var(--bcl-txt);
}
.bcl-cal-day-detail .meta {
  font-size: 13px;
  color: var(--bcl-muted);
}
.bcl-cal-day-detail .meta strong {
  color: var(--bcl-txt);
  font-weight: 600;
}

/* ── Time of day groups + slots ────────────────────────────────────────── */
.bcl-cal-loading {
  display: flex; justify-content: center;
  padding: 24px 0;
}
.bcl-cal-loading .spinner {
  width: 28px; height: 28px;
  border: 3px solid color-mix(in srgb, var(--bcl-c1) 20%, white);
  border-top-color: var(--bcl-c1);
  border-radius: 50%;
  animation: bcl-cal-spin 0.7s linear infinite;
}
@keyframes bcl-cal-spin { to { transform: rotate(360deg); } }

.bcl-cal-tod-group { padding: 14px 18px 0; }
.bcl-cal-tod-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 700;
  color: var(--bcl-muted);
  margin-bottom: 8px;
}
.bcl-cal-tod-h i {
  width: 14px; height: 14px;
  color: var(--bcl-c2-d);
}
.bcl-cal-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bcl-cal-slot {
  padding: 11px 0;
  background: white;
  border: 1.5px solid var(--bcl-line);
  border-radius: 12px;
  font: inherit;
  font-size: 14px; font-weight: 600;
  color: var(--bcl-txt);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s, background 0.15s, color 0.15s;
}
.bcl-cal-slot:hover:not(.sel) {
  border-color: color-mix(in srgb, var(--bcl-c1) 50%, transparent);
  transform: translateY(-1px);
}
.bcl-cal-slot:active { transform: translateY(0); }
.bcl-cal-slot.sel {
  background: var(--bcl-grad);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--bcl-c1) 35%, transparent);
}

.bcl-cal-empty {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 18px;
  background: var(--bcl-bg-soft);
  border: 1px dashed var(--bcl-line);
  border-radius: 14px;
  margin: 14px 18px 0;
  text-align: center;
}
.bcl-cal-empty i {
  width: 32px; height: 32px;
  color: color-mix(in srgb, var(--bcl-c1) 60%, var(--bcl-muted));
}
.bcl-cal-empty strong {
  font-size: 14px;
  color: var(--bcl-txt);
}
.bcl-cal-empty span {
  font-size: 12.5px;
  color: var(--bcl-muted);
  max-width: 260px;
  line-height: 1.5;
}

/* ── Footer CTA ────────────────────────────────────────────────────────── */
.bcl-cal-cta {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(253,246,240,.95);
  -webkit-backdrop-filter: blur(20px);
          backdrop-filter: blur(20px);
  border-top: 1px solid var(--bcl-line);
  box-shadow: 0 -8px 24px -16px rgba(0,0,0,.08);
}
.bcl-cal-summary {
  flex: 1;
  font-size: 13px;
  color: var(--bcl-muted);
  line-height: 1.35;
}
.bcl-cal-summary strong {
  color: var(--bcl-txt);
  font-weight: 600;
}
.bcl-cal-summary .pr {
  font-family: 'DM Serif Display', Georgia, serif;
  color: var(--bcl-txt);
  font-size: 16px;
}
.bcl-cal-btn-primary {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 20px;
  background: var(--bcl-grad);
  color: white;
  font: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.15s;
  box-shadow: 0 6px 18px -8px rgba(155,127,212,.55);
}
.bcl-cal-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(155,127,212,.7); }
.bcl-cal-btn-primary:active { transform: translateY(0); }
.bcl-cal-btn-primary.disabled,
.bcl-cal-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.bcl-cal-btn-primary i { width: 16px; height: 16px; }

@media (max-width: 380px) {
  .bcl-cal-day { font-size: 13px; }
  .bcl-cal-month-h .m { font-size: 19px; }
  .bcl-cal-slot-grid { grid-template-columns: repeat(2, 1fr); }
}
