/* Booking Modal */
.booking-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}

.booking-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 500px;
  background-color: rgba(255, 255, 255, 0.8);
  background-image: url('/static/img/back11.png');
  background-repeat: repeat;
  background-position: center;
  background-blend-mode: overlay;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  animation: bookingSlideIn 0.2s ease;
}

@keyframes bookingSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Auth modal (centered) */
.booking-modal-overlay-auth {
  display: flex;
  align-items: center;
  justify-content: center;
}
.booking-modal-overlay-auth .booking-modal {
  position: relative;
  width: 90%;
  max-width: 400px;
  height: auto;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  animation: bookingFadeIn 0.2s ease;
}
@keyframes bookingFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Header */
.booking-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #E6DDD5;
  background: #6B3E2B;
  color: white;
  flex-shrink: 0;
}
.booking-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: white;
}
.booking-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: white;
  opacity: 0.8;
  transition: opacity 0.2s;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.booking-modal-close:hover { opacity: 1; }

/* Body */
.booking-modal-body {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

/* Field */
.booking-field { margin-bottom: 12px; }

.booking-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid #e6ddd5;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(55, 35, 25, 0.06);
  border-radius: 12px;
}
.booking-field-header.expanded {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-color: #a85a45;
}
.booking-field-header:hover { border-color: #A85A45; }

.booking-field-summary { flex: 1; }
.booking-field-label { font-size: 13px; display: block; margin-bottom: 4px; color: #6F5E55; }
.booking-field-value { min-height: 24px; }
.booking-field-text { font-size: 15px; font-weight: 500; color: #3B2F2A; }
.booking-field-placeholder { color: #999; font-size: 15px; }

.booking-field-actions { display: flex; align-items: center; gap: 8px; }

.booking-clear-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent;
  cursor: pointer; font-size: 20px; color: #6F5E55; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.booking-clear-btn:hover { background: #E6DDD5; color: #A85A45; }

.booking-toggle-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  transition: transform 0.2s; color: #6F5E55; display: flex; align-items: center; justify-content: center;
}
.booking-toggle-btn.expanded { transform: rotate(90deg); }

/* Dropdown */
.booking-dropdown,
.booking-datetime-content {
  margin-top: -1px;
  border: 1px solid #a85a45;
  border-top: none;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(55, 35, 25, 0.06);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  max-height: none;
  overflow-y: visible;
}
.booking-dropdown-multi { max-height: 400px; overflow-y: auto; }
.booking-datetime-content { padding: 16px; }

/* Masters list */
.masters-list { padding: 8px; }

.master-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
  text-align: left;
}
.master-item:hover { background: #F6F1EC; }
.master-item.active { background: #E6DDD5; }

.master-avatar {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, #A85A45 0%, #8A4A37 100%); flex-shrink: 0;
}
.master-avatar img { width: 100%; height: 100%; object-fit: cover; }

.master-avatar-placeholder {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 24px; font-weight: 600; color: #3B2F2A;
  background: #E6DDD5; flex-shrink: 0;
}
.master-avatar-placeholder.master-any { background: #F6F1EC; font-size: 28px; font-weight: normal; }

.master-info { flex: 1; }
.master-name { font-size: 14px; font-weight: 500; color: #3B2F2A; }
.master-description { font-size: 12px; color: #6F5E55; margin-top: 2px; }

/* Services */
.booking-search-wrapper { padding: 8px; }
.booking-search-input {
  width: 100%; padding: 10px 12px; border: 1px solid #E6DDD5; border-radius: 8px;
  font-size: 14px; outline: none; box-sizing: border-box; transition: border-color 0.2s;
}
.booking-search-input:focus { border-color: #A85A45; }
.booking-search-input.error { border-color: #e94560; }

.booking-option-checkbox {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  cursor: pointer; transition: background 0.2s;
}
.booking-option-checkbox:hover { background: #F6F1EC; }
.booking-option-checkbox.active { background: #F6F1EC; }
.booking-option-checkbox input { width: 18px; height: 18px; accent-color: #A85A45; }

.booking-option-info { flex: 1; }
.booking-option-name { font-size: 14px; font-weight: 500; color: #3B2F2A; display: block; }
.booking-option-meta { display: flex; gap: 12px; margin-top: 4px; }
.booking-duration { font-size: 12px; color: #6F5E55; }
.booking-price { font-size: 13px; font-weight: 600; color: #A85A45; }

/* Date/Time */
.booking-week-nav {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.booking-nav-btn {
  width: 36px; height: 36px; border: 1px solid #E6DDD5; background: white; cursor: pointer;
  font-size: 16px; transition: all 0.2s; color: #3B2F2A; border-radius: 12px;
}
.booking-nav-btn:hover:not(:disabled) { border-color: #A85A45; background: #E6DDD5; }
.booking-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.booking-week-label { font-size: 14px; font-weight: 500; color: #3B2F2A; }

.booking-loading, .booking-empty {
  text-align: center; padding: 40px 20px; color: #6F5E55;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.booking-spinner {
  width: 32px; height: 32px; border: 3px solid #E6DDD5; border-top-color: #A85A45;
  border-radius: 50%; animation: bookingSpin 0.8s linear infinite;
}
@keyframes bookingSpin { to { transform: rotate(360deg); } }

.booking-slots { display: flex; flex-direction: column; gap: 20px; max-height: 340px; overflow-y: auto; }
.booking-day-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #3B2F2A; }

.booking-slots-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.booking-slot-btn {
  padding: 10px 18px; font-size: 14px; font-weight: 500; border: 1px solid #E6DDD5;
  background: white; cursor: pointer; transition: all 0.2s; color: #3B2F2A; border-radius: 40px;
}
.booking-slot-btn:hover { border-color: #A85A45; background: #E6DDD5; }
.booking-slot-btn.active { background: #A85A45; color: white; border-color: #A85A45; }

/* User info card */
.booking-user-info { margin: 12px 0; }
.booking-user-card {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: #F6F1EC; border: 1px solid #E6DDD5; border-radius: 12px;
}
.booking-user-name { font-size: 14px; font-weight: 500; color: #3B2F2A; }
.booking-user-phone { font-size: 12px; color: #6F5E55; }
.booking-user-clear {
  margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; font-size: 16px; color: #6F5E55;
  display: flex; align-items: center; justify-content: center;
}
.booking-user-clear:hover { background: #E6DDD5; color: #A85A45; }

/* Summary */
.booking-summary {
  background: #F6F1EC; padding: 16px; margin: 20px 0; border: 1px solid #E6DDD5;
  box-shadow: 0 2px 8px rgba(55, 35, 25, 0.06); border-radius: 12px;
}
.booking-summary-row {
  display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: #3B2F2A;
}
.booking-summary-row:first-child { padding-top: 0; }
.booking-summary-total {
  border-top: 1px solid #E6DDD5; margin-top: 8px; padding-top: 12px; font-weight: 600; color: #A85A45;
}

.booking-submit-btn {
  width: 100%; padding: 14px; background: #A85A45; color: white; border: none;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(55, 35, 25, 0.1); border-radius: 12px;
}
.booking-submit-btn:hover:not(:disabled) { background: #8A4A37; transform: translateY(-1px); }
.booking-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.booking-footer-brand {
  display: block; text-align: center; margin-top: 16px; font-size: 12px; color: #6F5E55;
  text-decoration: none; padding-bottom: 20px;
}

/* Auth fields */
.booking-auth-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.booking-error { font-size: 12px; color: #e94560; margin-top: -8px; }

/* Error style */
.booking-search-input.error { border-color: #e94560; }

/* Mobile */
@media (max-width: 767px) {
  .booking-modal { left: 0; width: 100%; }
  .booking-modal-header { padding: 16px 20px; }
  .booking-modal-header h3 { font-size: 18px; }
  .booking-modal-body { padding: 5px; }
  .booking-field-header { padding: 10px; }
  .booking-field-label { font-size: 12px; }
  .booking-field-text, .booking-field-placeholder { font-size: 14px; }
  .booking-datetime-content { padding: 12px; }
  .booking-summary { padding: 12px; margin: 16px 0; }
  .booking-submit-btn { padding: 12px; font-size: 15px; }
  .master-avatar, .master-avatar-placeholder { width: 48px; height: 48px; font-size: 20px; }
  .master-item { padding: 8px; }
  .master-name { font-size: 12px; }
}