/* ============================================
   Booking Page CSS - Solar Surge
   Calendar Grid, Time Slots, Booking Form
   ============================================ */

/* --- Booking Layout --- */
.booking-section {
  padding: var(--section-padding);
}

.booking-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

/* --- Booking Main & Sidebar --- */
.booking-main {
  min-width: 0;
}

.booking-sidebar {
  max-width: 600px;
  margin: 0 auto;
}

.sidebar-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: var(--space-lg);
}

.sidebar-card h4 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-secondary);
}

.expect-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.expect-list li {
  padding: 6px 0;
  font-size: var(--fs-sm);
  color: var(--color-text-light);
  position: relative;
  padding-left: 20px;
}

.expect-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: var(--fw-bold);
}

/* --- Booking Steps Indicator --- */
.booking-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.step .step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  border: 2px solid var(--color-border);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  color: var(--color-text-light);
  transition: all var(--transition);
}

.step.active .step-number {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-white);
}

.step .step-label {
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text-light);
}

.step.active .step-label {
  color: var(--color-primary);
  font-weight: var(--fw-semibold);
}

.step-line {
  width: 40px;
  height: 2px;
  background: var(--color-border);
}

/* --- Service Selection --- */
.booking-services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.booking-service-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
}

.booking-service-option:hover {
  border-color: var(--color-secondary);
}

.booking-service-option.selected {
  border-color: var(--color-secondary);
  background: rgba(26, 26, 26, 0.04);
}

.booking-service-option input[type="radio"] {
  display: none;
}

.booking-service-radio {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  position: relative;
  margin-top: 2px;
  transition: border-color var(--transition);
}

.booking-service-option.selected .booking-service-radio {
  border-color: var(--color-secondary);
}

.booking-service-option.selected .booking-service-radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  border-radius: var(--radius-full);
  background: var(--color-secondary);
}

.booking-service-info h4 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-xs);
}

.booking-service-info p {
  font-size: var(--fs-xs);
  color: var(--color-text-light);
  margin-bottom: var(--space-xs);
}

.booking-service-duration {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-secondary);
}

/* --- Calendar Grid --- */
.booking-calendar {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-primary);
}

.calendar-header h3 {
  font-size: var(--fs-lg);
  color: var(--color-white);
  margin-bottom: 0;
}

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

.calendar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.calendar-nav-btn svg {
  width: 16px;
  height: 16px;
  fill: var(--color-white);
}

.calendar-month {
  font-size: var(--fs-lg);
  color: var(--color-primary);
  margin-bottom: 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
  padding: var(--space-lg);
}

.calendar-day-header {
  text-align: center;
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-text-light);
  text-transform: uppercase;
  padding: var(--space-sm) 0;
}

.calendar-day.empty {
  visibility: hidden;
}

.calendar-day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition-fast);
}

.calendar-day:hover {
  background: var(--color-bg-alt);
}

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

.calendar-day.selected {
  background: var(--color-secondary);
  color: var(--color-white);
  font-weight: var(--fw-bold);
}

.calendar-day.disabled {
  color: var(--color-border);
  cursor: not-allowed;
  pointer-events: none;
}

.calendar-day.other-month {
  color: var(--color-border);
}

.calendar-day.has-slots::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--color-success);
}

.calendar-day {
  position: relative;
}

/* --- Wizard Hidden State & Reveal --- */
.booking-time.hidden,
.booking-form.hidden,
.booking-calendar.hidden,
.booking-sidebar.hidden {
  display: none;
}

.step.completed .step-number {
  background: var(--color-success);
  border-color: var(--color-success);
  color: transparent;
  font-size: 0;
}

.step.completed .step-number::after {
  content: '✓';
  color: var(--color-white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.step.completed .step-label {
  color: var(--color-success);
}

.booking-submit-btn {
  margin-top: var(--space-lg);
}

/* --- Time Slots --- */
.booking-time {
  margin-top: var(--space-xl);
}

.booking-time h3 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-lg);
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.time-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--color-text);
  background: var(--color-white);
  cursor: pointer;
  transition: all var(--transition);
}

.time-slot:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.time-slot.selected {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-white);
  font-weight: var(--fw-bold);
}

.time-slot.unavailable,
.time-slot.disabled {
  background: var(--color-bg-alt);
  color: var(--color-text-light);
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
}

.no-slots-message {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-light);
  font-size: var(--fs-sm);
}

/* --- Booking Summary Sidebar --- */
.booking-summary {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  position: sticky;
  top: 100px;
  overflow: hidden;
}

.booking-summary-header {
  padding: var(--space-lg) var(--space-xl);
  background: var(--color-primary);
}

.booking-summary-header h3 {
  font-size: var(--fs-lg);
  color: var(--color-white);
  margin-bottom: 0;
}

.booking-summary-body {
  padding: var(--space-xl);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-label {
  font-size: var(--fs-sm);
  color: var(--color-text-light);
}

.summary-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  text-align: right;
}

.summary-value.not-selected {
  color: var(--color-text-light);
  font-style: italic;
  font-weight: var(--fw-regular);
}

.booking-summary-footer {
  padding: 0 var(--space-xl) var(--space-xl);
}

.booking-summary-footer .btn {
  width: 100%;
}

/* --- Booking Form (Details Step) --- */
.booking-form {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  margin-top: var(--space-xl);
}

.booking-form h3 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-xl);
}

.booking-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

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

.booking-form .form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.booking-form .form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--color-text);
  transition: border-color var(--transition);
}

.booking-form .form-control:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.booking-form textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* --- Confirmation Screen --- */
.booking-confirmation {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  max-width: 600px;
  margin: 0 auto;
}

.confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  margin-bottom: var(--space-xl);
}

.confirmation-icon svg {
  width: 36px;
  height: 36px;
  fill: var(--color-success);
}

.booking-confirmation h2 {
  font-size: var(--fs-3xl);
  margin-bottom: var(--space-md);
}

.booking-confirmation > p {
  font-size: var(--fs-base);
  color: var(--color-text-light);
  margin-bottom: var(--space-xl);
}

.confirmation-details {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  text-align: left;
}

.confirmation-detail-row {
  display: flex;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--color-border);
}

.confirmation-detail-row:last-child {
  border-bottom: none;
}

.confirmation-detail-row .detail-label {
  color: var(--color-text-light);
}

.confirmation-detail-row .detail-value {
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}

.confirmation-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .booking-services {
    grid-template-columns: 1fr;
  }

  .time-slots {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  /* Steps indicator - compact on mobile */
  .booking-steps {
    gap: var(--space-xs);
  }

  .step .step-label {
    display: none;
  }

  .step .step-number {
    width: 32px;
    height: 32px;
    font-size: var(--fs-xs);
  }

  .step-line {
    width: 24px;
  }

  /* Time slots - 3 columns */
  .time-slots {
    grid-template-columns: repeat(3, 1fr);
  }

  .time-slot {
    padding: var(--space-sm) var(--space-xs);
    font-size: var(--fs-xs);
    min-height: 44px;
  }

  /* Booking form */
  .booking-form .form-row {
    grid-template-columns: 1fr;
  }

  .booking-form {
    padding: var(--space-lg);
  }

  .booking-form h3 {
    font-size: var(--fs-xl);
  }

  .booking-form .form-control {
    padding: 14px 16px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  /* Calendar */
  .calendar-grid {
    padding: var(--space-md);
    gap: 2px;
  }

  .calendar-day {
    font-size: var(--fs-xs);
    min-height: 38px;
  }

  .calendar-day-header {
    font-size: 0.65rem;
    padding: var(--space-xs) 0;
  }

  .calendar-header {
    padding: var(--space-md) var(--space-lg);
  }

  .calendar-header h3,
  .calendar-month {
    font-size: var(--fs-base);
  }

  .calendar-nav {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Booking time section */
  .booking-time h3 {
    font-size: var(--fs-base);
  }

  /* Sidebar cards */
  .sidebar-card {
    padding: var(--space-lg);
  }

  .sidebar-card h4 {
    font-size: var(--fs-base);
    margin-bottom: var(--space-md);
  }

  /* Summary items */
  .summary-item {
    padding: var(--space-sm) 0;
  }

  /* Confirmation */
  .confirmation-actions {
    flex-direction: column;
  }

  .booking-confirmation h2 {
    font-size: var(--fs-2xl);
  }

  .booking-confirmation {
    padding: var(--space-2xl) var(--space-md);
  }
}

@media (max-width: 480px) {
  /* Time slots - 2 columns on very small screens */
  .time-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .time-slot {
    padding: var(--space-md) var(--space-sm);
    min-height: 48px;
  }

  /* Calendar tighter */
  .calendar-grid {
    padding: var(--space-sm);
    gap: 1px;
  }

  .calendar-day {
    min-height: 34px;
    font-size: 0.7rem;
  }

  .calendar-day-header {
    font-size: 0.6rem;
  }

  /* Form */
  .booking-form {
    padding: var(--space-md);
  }

  .booking-form .form-control {
    padding: 12px 14px;
  }

  /* Sidebar */
  .sidebar-card {
    padding: var(--space-md);
  }

  /* Section spacing */
  .booking-section {
    padding: 40px 0;
  }
}
