/* ============================================================
   WebKMT Booking Modal (Cal.com native booking — js/booking.js)
   RTL-safe via logical properties. Works on top of any page
   that loads the main CSS bundles (variables have fallbacks).
   ============================================================ */

.bk-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(5, 10, 15, 0.6);
  backdrop-filter: blur(6px);
}
.bk-overlay.active { display: flex; }

.bk-modal {
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 22px;
  background: var(--color-surface, #ffffff);
  color: var(--text-primary, #111827);
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.25));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  padding: 1.6rem 1.6rem 1.8rem;
  animation: bk-in 0.25s ease;
}
@keyframes bk-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.bk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.bk-title { font-size: 1.35rem; line-height: 1.3; margin: 0; }
.bk-sub { color: var(--text-secondary, #6b7280); font-size: 0.92rem; margin: 0.35rem 0 0; line-height: 1.55; }
.bk-close {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.3));
  background: transparent;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.bk-close:hover { border-color: var(--color-primary, #0aacb8); color: var(--color-primary, #0aacb8); }

.bk-label-text { font-weight: 700; font-size: 0.95rem; margin: 1.1rem 0 0.55rem; }
.bk-type-line { font-weight: 600; color: var(--color-primary, #0aacb8); margin: 0 0 0.2rem; }
.bk-tz { color: var(--text-secondary, #6b7280); font-size: 0.8rem; margin-top: 0.9rem; }
.bk-empty { color: var(--text-secondary, #6b7280); font-size: 0.92rem; padding: 0.6rem 0; }
.bk-error { color: #dc2626; font-size: 0.88rem; min-height: 1.1em; margin: 0.2rem 0 0; }
.bk-summary {
  background: rgba(var(--color-primary-rgb, 10, 172, 184), 0.1);
  border: 1px solid rgba(var(--color-primary-rgb, 10, 172, 184), 0.25);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
}

.bk-dates {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}
.bk-date {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 64px;
  padding: 0.6rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.3));
  background: transparent;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bk-date span { font-size: 0.75rem; color: var(--text-secondary, #6b7280); }
.bk-date strong { font-size: 0.85rem; }
.bk-date:hover { border-color: var(--color-primary, #0aacb8); }
.bk-date.is-active {
  background: var(--color-primary, #0aacb8);
  border-color: var(--color-primary, #0aacb8);
  color: #fff;
}
.bk-date.is-active span { color: rgba(255, 255, 255, 0.85); }

.bk-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.55rem;
}
.bk-slot {
  padding: 0.65rem 0.4rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.3));
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bk-slot:hover {
  border-color: var(--color-primary, #0aacb8);
  background: rgba(var(--color-primary-rgb, 10, 172, 184), 0.12);
  transform: translateY(-1px);
}

.bk-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.35));
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 0.95rem;
}
.bk-input:focus {
  outline: none;
  border-color: var(--color-primary, #0aacb8);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 10, 172, 184), 0.18);
}
textarea.bk-input { resize: vertical; }

.bk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.bk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.3rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.93rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  border: 1px solid transparent;
}
.bk-btn--primary { background: var(--color-primary, #0aacb8); color: #fff; }
.bk-btn--primary:hover { background: var(--color-primary-dark, #088a94); transform: translateY(-1px); }
.bk-btn--primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.bk-btn--wa { background: #1faa55; color: #fff; }
.bk-btn--wa:hover { background: #178a44; transform: translateY(-1px); }
.bk-btn--ghost { background: transparent; color: inherit; border-color: var(--glass-border, rgba(127, 140, 160, 0.4)); }
.bk-btn--ghost:hover { border-color: var(--color-primary, #0aacb8); color: var(--color-primary, #0aacb8); }

.bk-loading { text-align: center; padding: 2.2rem 0; color: var(--text-secondary, #6b7280); }
.bk-loading--sm { padding: 1rem 0; }
.bk-spinner {
  width: 38px; height: 38px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  border: 4px solid rgba(var(--color-primary-rgb, 10, 172, 184), 0.2);
  border-top-color: var(--color-primary, #0aacb8);
  animation: bk-spin 0.8s linear infinite;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

.bk-fallback, .bk-success { text-align: center; padding: 1.2rem 0 0.6rem; }
.bk-fallback h4, .bk-success h4 { font-size: 1.2rem; margin: 0 0 0.6rem; }
.bk-fallback p, .bk-success p { color: var(--text-secondary, #6b7280); line-height: 1.65; margin: 0 auto 1.1rem; max-width: 440px; }
.bk-fallback .bk-actions { justify-content: center; }
.bk-success-icon { font-size: 2.6rem; margin-bottom: 0.6rem; }
.bk-success p strong { color: var(--text-primary, #111827); }

@media (max-width: 560px) {
  .bk-modal { padding: 1.25rem 1.1rem 1.4rem; border-radius: 18px; }
  .bk-slots { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}
