﻿/* ==========================================================================
   NETBULB · Booking widget (reemplazo de TidyCal)
   Dise\u00f1o: vertical, limpio, mobile-first, sin emojis
   ========================================================================== */

.nb-booking {
  --bk-bg: #ffffff;
  --bk-ink: #0a1628;
  --bk-ink-soft: #4a5568;
  --bk-muted: #6b7280;
  --bk-accent: #1a78c2;
  --bk-accent-dark: #1468a3;
  --bk-accent-soft: #EBF4FB;
  --bk-success: #16A34A;
  --bk-success-soft: #ECFDF5;
  --bk-border: #E2E8F0;
  --bk-radius: 18px;
  --bk-shadow: 0 24px 60px -20px rgba(10,22,40,.18), 0 4px 12px -4px rgba(10,22,40,.06);

  background: var(--bk-bg);
  border: 1px solid var(--bk-border);
  border-radius: var(--bk-radius);
  box-shadow: var(--bk-shadow);
  overflow: hidden;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--bk-ink);
  position: relative;
}

/* ---------- Header con resumen ---------- */
.nb-booking__head {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--bk-border);
  background: linear-gradient(180deg, #FAFCFE 0%, #fff 100%);
  text-align: center;
}
.nb-booking__head h3 {
  margin: 0 0 .5rem;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bk-ink);
}
.nb-booking__head p {
  margin: 0 0 1.25rem;
  font-size: .95rem;
  color: var(--bk-muted);
  line-height: 1.5;
  max-width: 38rem;
  margin-inline: auto;
}
.nb-booking__head p strong { color: var(--bk-ink); font-weight: 600; }
.nb-booking__meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: center;
}
.nb-booking__meta li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bk-accent-soft);
  color: var(--bk-accent);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.nb-booking__meta svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- Body: calendario + slots ---------- */
.nb-booking__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 460px;
}
@media (max-width: 760px) {
  .nb-booking__body { grid-template-columns: 1fr; }
  .nb-booking__cal-wrap { border-right: 0; border-bottom: 1px solid var(--bk-border); }
}

/* Calendario */
.nb-booking__cal-wrap {
  padding: 1.5rem 1.75rem;
  border-right: 1px solid var(--bk-border);
}
.nb-booking__cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.nb-booking__month {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bk-ink);
  text-transform: capitalize;
  letter-spacing: -0.01em;
}
.nb-booking__nav { display: flex; gap: .25rem; }
.nb-booking__nav button {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--bk-border);
  border-radius: 8px;
  background: var(--bk-bg);
  color: var(--bk-ink);
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
}
.nb-booking__nav button:hover {
  border-color: var(--bk-accent);
  color: var(--bk-accent);
}
.nb-booking__nav svg { width: 14px; height: 14px; }

.nb-booking__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}
.nb-booking__weekdays span {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bk-muted);
  text-align: center;
  padding: .25rem 0;
}
.nb-booking__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.nb-booking__day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: .9rem;
  font-weight: 500;
  color: var(--bk-ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  min-height: 40px;
}
.nb-booking__day:hover:not(:disabled) {
  border-color: var(--bk-accent);
  color: var(--bk-accent);
}
.nb-booking__day.is-disabled {
  opacity: .25;
  cursor: not-allowed;
}
.nb-booking__day.is-today { color: var(--bk-accent); font-weight: 700; }
.nb-booking__day.is-selected {
  background: var(--bk-accent);
  color: #fff;
  font-weight: 700;
  border-color: var(--bk-accent);
}

/* Slots */
.nb-booking__slots-wrap {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
}
.nb-booking__slots-label {
  font-size: .85rem;
  color: var(--bk-ink-soft);
  margin-bottom: 1rem;
  font-weight: 500;
}
.nb-booking__slots-label strong { color: var(--bk-ink); font-weight: 600; }
.nb-booking__slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  flex: 1;
  align-content: start;
}
.nb-booking__slot {
  padding: .7rem .35rem;
  background: var(--bk-bg);
  border: 1.5px solid var(--bk-border);
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--bk-ink);
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all .15s ease;
}
.nb-booking__slot:hover {
  border-color: var(--bk-accent);
  color: var(--bk-accent);
}
.nb-booking__slot.is-selected {
  background: var(--bk-accent);
  color: #fff;
  border-color: var(--bk-accent);
}
.nb-booking__slot.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  text-decoration: line-through;
}
.nb-booking__empty {
  display: grid; place-items: center;
  text-align: center;
  color: var(--bk-muted);
  font-size: .85rem;
  flex: 1;
  padding: 1rem;
}

/* Form */
.nb-booking__form {
  padding: 1.5rem 2rem 2rem;
  border-top: 1px solid var(--bk-border);
  background: linear-gradient(180deg, #FAFCFE 0%, #fff 100%);
  display: none;
}
.nb-booking__form.is-active { display: block; }
.nb-booking__form-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: var(--bk-muted);
  flex-wrap: wrap;
}
.nb-booking__form-head strong { color: var(--bk-ink); font-weight: 600; }
.nb-booking__form-head > span { font-weight: 500; }
.nb-booking__form-head button {
  background: none;
  border: 0;
  color: var(--bk-accent);
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  margin-left: auto;
  font-weight: 600;
}

.nb-booking__error {
  background: #FEE2E2;
  color: #991B1B;
  padding: .65rem .9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .85rem;
  display: none;
}
.nb-booking__error.is-visible { display: block; }

.nb-booking__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 560px) {
  .nb-booking__grid { grid-template-columns: 1fr; }
}
.nb-booking__field { display: block; }
.nb-booking__field.is-full { grid-column: 1 / -1; }
.nb-booking__field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .35rem;
  color: var(--bk-ink);
}
.nb-booking__field label span { color: #DC2626; }
.nb-booking__field input,
.nb-booking__field textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1.5px solid var(--bk-border);
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--bk-ink);
  background: var(--bk-bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nb-booking__field input:focus,
.nb-booking__field textarea:focus {
  outline: 0;
  border-color: var(--bk-accent);
  box-shadow: 0 0 0 3px rgba(26,120,194,.12);
}
.nb-booking__field textarea { resize: vertical; min-height: 70px; }
.nb-booking__field input.error,
.nb-booking__field textarea.error {
  border-color: #DC2626;
}

.nb-booking__submit {
  width: 100%;
  padding: .9rem;
  background: var(--bk-accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background .15s ease, transform .15s ease;
}
.nb-booking__submit:hover { background: var(--bk-accent-dark); transform: translateY(-1px); }
.nb-booking__submit:disabled { opacity: .6; cursor: not-allowed; }
.nb-booking__submit svg { width: 16px; height: 16px; }
.nb-booking__legal {
  margin: .75rem 0 0;
  font-size: .75rem;
  color: var(--bk-muted);
  text-align: center;
  line-height: 1.5;
}

/* Success */
.nb-booking__success {
  padding: 3rem 2rem;
  text-align: center;
  display: none;
  background: var(--bk-success-soft);
}
.nb-booking__success.is-active { display: block; }
.nb-booking__success-icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  background: var(--bk-success);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
}
.nb-booking__success-icon svg { width: 32px; height: 32px; }
.nb-booking__success h4 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 .5rem;
  color: var(--bk-ink);
}
.nb-booking__success p {
  font-size: .9rem;
  color: var(--bk-ink-soft);
  margin: 0 0 1.5rem;
  line-height: 1.5;
  max-width: 32rem;
  margin-inline: auto;
}
.nb-booking__success p strong { color: var(--bk-ink); }
.nb-booking__meet {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  background: #fff;
  border: 1.5px solid var(--bk-accent);
  border-radius: 8px;
  margin: 0 auto 1.25rem !important;
  font-size: .85rem;
  text-align: left;
  max-width: 32rem;
  line-height: 1.4;
}
.nb-booking__meet svg { flex-shrink: 0; color: var(--bk-accent); }
.nb-booking__meet a {
  color: var(--bk-accent);
  font-weight: 600;
  word-break: break-all;
  text-decoration: none;
}
.nb-booking__meet a:hover { text-decoration: underline; }
.nb-booking__success-actions {
  display: flex; gap: .65rem; justify-content: center; flex-wrap: wrap;
}
.nb-booking__success a {
  padding: .65rem 1.1rem;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--bk-border);
  background: #fff;
  color: var(--bk-ink);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  transition: all .15s ease;
}
.nb-booking__success a:hover {
  border-color: var(--bk-accent);
  color: var(--bk-accent);
}

/* Loading */
.nb-booking__loading {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.85);
  display: none;
  align-items: center; justify-content: center;
  z-index: 5;
  border-radius: var(--bk-radius);
}
.nb-booking__loading.is-visible { display: flex; }
.nb-booking__spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--bk-border);
  border-top-color: var(--bk-accent);
  border-radius: 50%;
  animation: nb-spin .8s linear infinite;
}
@keyframes nb-spin { to { transform: rotate(360deg); } }
