/* 容器 */
.wptb-booking-app {
  max-width: 1000px;
  margin: 30px auto;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  padding: 24px 24px 30px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    sans-serif;
  box-sizing: border-box;
}

/* 左右 layout */
.wptb-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.wptb-main {
  flex: 2;
  min-width: 0;
}

.wptb-preview {
  flex: 1;
  min-width: 0;
  border-left: 1px solid #e5e7eb;
  padding-left: 20px;
}

/* Stepper */
.wptb-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
}

.wptb-stepper::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 22px;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.wptb-stepper-item {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  cursor: default;
}

.wptb-stepper-circle {
  width: 32px;
  height: 32px;
  margin: 0 auto 6px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.2s ease;
}

.wptb-stepper-label {
  font-size: 13px;
  color: #6b7280;
}

.wptb-stepper-item.active .wptb-stepper-circle {
  background: #3b82f6;
  color: #ffffff;
  transform: scale(1.05);
}

.wptb-stepper-item.active .wptb-stepper-label {
  color: #111827;
  font-weight: 600;
}

.wptb-stepper-item.completed .wptb-stepper-circle {
  background: #22c55e;
  color: #ffffff;
}

.wptb-stepper-item.completed .wptb-stepper-label {
  color: #16a34a;
}

/* Step 標題 */
.wptb-step h3 {
  font-size: 18px;
  margin: 12px 0 0;
  color: #111827;
}

/* Step 容器 */
.wptb-step {
  animation: wptb-fade 0.2s ease;
}

@keyframes wptb-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.wptb-step-actions {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.wptb-next-step,
.wptb-prev-step {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wptb-next-step {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
}

.wptb-next-step:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
}

.wptb-next-step:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wptb-prev-step {
  background: #ffffff;
  color: #374151;
  border-color: #d1d5db;
}

.wptb-prev-step:hover {
  background: #f3f4f6;
}

/* Loading / summary */
.wptb-loading {
  color: #6b7280;
  font-size: 14px;
}

/* Step 1: Services List */
.wptb-service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); */
  gap: 16px;
}

.wptb-service-list li {
  margin: 0;
  padding: 0;
}

.wptb-service-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  background: #f9fafb;
  transition: all 0.15s ease;
  height: 100%;
  box-sizing: border-box;
}

.wptb-service-card:hover {
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
  border-color: #d1d5db;
}

.wptb-service-card.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
  background: #eff6ff;
}

.wptb-service-thumb {
  display: none !important;
  width: 100%;
  padding-top: 56%;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  position: relative;
  margin-bottom: 8px;
}

.wptb-service-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wptb-service-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #6b7280;
}

.wptb-service-info {
  flex: 1;
}

.wptb-service-title {
  font-size: 15px;
  margin: 4px 0;
  color: #111827;
}

.wptb-service-summary {
  font-size: 14px;
  line-height: 24px;
  margin: 0;
  color: #6b7280;
}

/* Step 2: Dates (list mode) */
.wptb-date-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wptb-date-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: all 0.15s ease;
}

.wptb-date-btn:hover {
  background: #f3f4f6;
}

.wptb-date-btn.selected {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

/* Step 2: Calendar view */
.wptb-calendar {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 10px 12px;
  width: 100%;
  min-width: 360px;
}

.wptb-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.wptb-calendar-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.wptb-cal-nav {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  padding: 2px 8px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.2;
}

.wptb-cal-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.wptb-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 12px;
}

.wptb-cal-weekday {
  text-align: center;
  font-weight: 600;
  color: #6b7280;
  padding: 2px 0;
}

.wptb-cal-day {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wptb-cal-day-empty {
  background: transparent;
}

.wptb-cal-day-disabled span {
  color: #d1d5db;
}

.wptb-cal-day-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  background: #ffffff;
  padding: 4px 0;
  width: 100%;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wptb-cal-day-btn:hover {
  background: #f3f4f6;
}

.wptb-cal-day-btn.selected {
  background: #3b82f6;
  color: #ffffff;
}

/* Step 2: Theme 3 */
.wptb-theme3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.wptb-theme3-day-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}

.wptb-theme3-day-btn.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb33;
}

.wptb-theme3-date {
  font-weight: 600;
  margin-bottom: 4px;
}

.wptb-theme3-slot-line {
  font-size: 12px;
  color: #4b5563;
}

/* Step 3: Timeslots */
.wptb-timeslot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.wptb-timeslot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.15s ease;
  font-size: 13px;
}

.wptb-timeslot-item:hover {
  background: #f9fafb;
}

.wptb-timeslot-item.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
  background: #eff6ff;
}

.wptb-timeslot-time {
  color: #111827;
}

.wptb-timeslot-price {
  display: none;
  font-weight: 600;
  color: #16a34a;
}

.wptb-timeslot-item.wptb-timeslot-full {
  opacity: 0.5;
  cursor: not-allowed;
}

.wptb-timeslot-item.wptb-timeslot-full input[type="checkbox"] {
  cursor: not-allowed;
}

.wptb-timeslot-capacity {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #6b7280;
}

.wptb-timeslot-status {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  color: #b91c1c;
}

/* Step 4: Form */
.wptb-form {
  width: 100%;
}

.wptb-form-row {
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
}

.wptb-form-row label {
  font-size: 13px;
  margin-bottom: 4px;
  color: #374151;
}

.wptb-form-row input,
.wptb-form-row textarea {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  box-sizing: border-box;
}

.wptb-form-row input:focus,
.wptb-form-row textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #bfdbfe;
}

.wptb-required {
  color: #ef4444;
}

/* Step 5: Summary */
.wptb-summary {
  margin-top: 10px;
}

.wptb-summary-card {
  border-radius: 10px;
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  padding: 14px 16px;
  font-size: 14px;
  color: #065f46;
}

.wptb-summary-title {
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 15px;
}

.wptb-summary-note {
  margin-top: 8px;
  font-size: 13px;
  color: #047857;
}

.wptb-summary-timeslot-list {
  list-style: disc;
  margin: 4px 0 8px 20px;
  padding: 0;
}

/* 右邊：Preview panel */
#wptb-preview-panel {
  display: none;
}

.wptb-preview-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 10px;
  color: #111827;
}

.wptb-preview-body {
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 12px 12px 14px;
  font-size: 13px;
}

.wptb-preview-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
}

.wptb-preview-label {
  width: 48px;
  color: #6b7280;
}

.wptb-preview-value {
  flex: 1;
  color: #111827;
}

.wptb-preview-timeslot-price {
  display: none;
}

.wptb-preview-total-row {
  display: none;
  border-top: 1px dashed #d1d5db;
  padding-top: 6px;
  margin-top: 6px;
}

.wptb-preview-total {
  font-weight: 700;
  color: #16a34a;
  font-size: 14px;
}

.wptb-preview-timeslot-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wptb-preview-timeslot-list li {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.wptb-preview-timeslot-time {
  color: #111827;
}

.wptb-preview-timeslot-price {
  color: #16a34a;
}

.wptb-preview-note {
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
}

.wptb-inline-option {
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
  font-size: 13px;
  cursor: pointer;
}

.wptb-form-row-html {
  font-size: 13px;
  color: #4b5563;
}

#wptb-event-preview-panel {
  font-size: 14px;
  line-height: 24px;
}

.wptb-event-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 40px;
}

/* RWD 調整 */
@media (max-width: 800px) {
  .wptb-layout {
    flex-direction: column;
  }
  .wptb-preview {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin-top: 12px;
  }
}

@media (max-width: 640px) {
  .wptb-booking-app {
    padding: 16px 14px 20px;
  }
  .wptb-stepper-label {
    font-size: 11px;
  }
  .wptb-stepper::before {
    left: 14%;
    right: 14%;
  }
}
