/* ============================================
   137Foundry — Booking Widget
   Matches warm industrial design system
   ============================================ */

.booking-widget {
  max-width: 640px;
}

.booking-noscript {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
}

/* --- Steps --- */
.booking-steps {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.booking-step {
  flex: 1;
  text-align: center;
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border-color);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast), border-color var(--transition-fast);
  letter-spacing: 0.01em;
}

.booking-step.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.booking-step.completed {
  color: var(--text-secondary);
  border-bottom-color: var(--color-accent);
}

/* --- Calendar --- */
.booking-calendar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.calendar-header h3 {
  font-size: 1rem;
  margin-bottom: 0;
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  gap: var(--space-sm);
}

.calendar-nav button {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--border-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.calendar-nav button:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.calendar-nav button:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.calendar-nav button svg {
  width: 16px;
  height: 16px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: var(--space-xs);
}

.calendar-weekday {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-xs) 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  border: none;
  background: none;
  color: var(--text-primary);
  min-width: 44px;
  min-height: 44px;
}

.calendar-day:hover:not(.disabled):not(.selected) {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.calendar-day.selected {
  background: var(--color-accent);
  color: #fff;
}

.calendar-day.today {
  border: 1px solid var(--border-color);
}

.calendar-day.disabled {
  color: var(--text-muted);
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-day.weekend {
  color: var(--text-muted);
  opacity: 0.35;
}

.calendar-day.other-month {
  visibility: hidden;
}

/* --- Slots --- */
.booking-slots {
  margin-bottom: var(--space-lg);
}

.slots-label {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.slots-group-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
  margin-top: var(--space-md);
}

.slots-group-label:first-child {
  margin-top: 0;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: var(--space-sm);
}

.slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.55rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.slot-btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.slot-btn.selected {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

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

.slot-et {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.slot-btn.selected .slot-et {
  color: rgba(255, 255, 255, 0.7);
}

.slots-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  gap: var(--space-sm);
  font-size: 0.9rem;
}

.slots-empty {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Form --- */
.booking-form {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
}

.booking-form .form-group {
  margin-bottom: var(--space-md);
}

.booking-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-glow);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-lg);
  font-size: 0.875rem;
}

.booking-summary-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 500;
}

.booking-summary-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}

.char-count {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* --- Confirmation --- */
.booking-confirmation {
  text-align: center;
  padding: var(--space-2xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
}

.confirmation-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-subtle);
  border: 1px solid var(--color-accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.confirmation-icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}

.booking-confirmation h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
}

.booking-confirmation p {
  margin: 0 auto var(--space-md);
}

/* --- Spinner --- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
}
