:root {
  --primary: #4a90e2;
  --primary-dark: #3a7bc8;
  --light-bg: #f8f9fa;
  --border: #e3e7ee;
  --text: #333;
  --text-light: #666;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}


/* 保底 CSS（避免跑版 */
.spa-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.spa-cover img {
  width: 360px;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}

.spa-info {
  flex: 1;
  min-width: 0;
}

.spa-gallery {
  margin: 20px 0;
}

.spa-gallery-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.spa-gallery-grid img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}



/* 基礎樣式 */
.spa-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
}

/* 商家資訊 */
.spa-header {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
  padding: 24px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.spa-header img {
  width: 350px;
  height: 250px;
  border-radius: 8px;
  object-fit: cover;
}

.spa-info {
  flex: 1;
}

.spa-info h1 {
  font-size: 24px;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
}

.spa-info .rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: #f39c12;
  font-size: 32px;
}

.spa-info p {
  color: var(--text-light);
  line-height: 1.6;
  padding: 12px;
  background: var(--light-bg);
  border-radius: 6px;
  font-size: 15px;
}

/* 預約主容器 */
.calendar-box {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.calendar-box h2 {
  font-size: 18px;
  margin: 24px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: #2c3e50;
  font-weight: 600;
}

.calendar-box h2:first-child {
  margin-top: 0;
}

/* 預約者資料 */
.user_box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.user_box label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user_box span {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.user_box input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  transition: border-color 0.2s;
}

.user_box input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 服務選擇 */
.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.service-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.service-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.1);
}

.service-item.active {
  border-color: var(--primary);
  background: #eef5ff;
}

.service-item strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
  color: #2c3e50;
}

.service-item div {
  display: flex;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 14px;
}

/* 日期時間選擇 */
#myDatePicker,
#myTimePicker {
  display: none;
  width: 100%;
  max-width: 300px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  margin-bottom: 8px;
  background: white;
}

#myDatePicker:focus,
#myTimePicker:focus {
  outline: none;
  border-color: var(--primary);
}

.flatpickr-calendar.inline {
  max-width: 100%;
}

.flatpickr-innerContainer {
  overflow: auto !important;
}

.select-booking-time {
  display: flex;
  flex-wrap: wrap;
}

.select-booking-time>div {
  min-width: 50%;
}

/* 選擇顯示 */
.select-display {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px;
  background: var(--light-bg);
  border-radius: 8px;
  margin: 24px 0;
  font-size: 18px;
  align-items: center;
  justify-content: center;
}

.select-display span {
  font-weight: 500;
  color: var(--primary);
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  min-height: 2.5rem;
  min-width: 8rem;
  text-align: center;
  line-height: 1.5;
  vertical-align: middle;
}

/* 預約按鈕 */
.reserve-btn {
  width: 300px;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin: 8px auto 0;
  display: block;
}

.reserve-btn:hover {
  background: var(--primary-dark);
}

.reserve-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* 響應式 */
@media (max-width: 768px) {
  .spa-header {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .spa-header img {
    width: 100%;
    height: auto;
    max-height: 300px;
  }

  .spa-info h1 {
    font-size: 20px;
  }

  .user_box {
    grid-template-columns: 1fr;
  }

  .service-list {
    grid-template-columns: 1fr;
  }

  .calendar-box {
    padding: 20px;
  }

  .select-booking-time>div {
    width: 100%;
  }

  .flatpickr-calendar.inline {
    margin: auto;
  }

  .select-display {
    flex-direction: column;
    gap: 8px;
  }

  .reserve-btn {
    width: 100%;
  }
}

.booking-note {
  max-width: 640px;
  margin: 16px auto 8px;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  text-align: center;
}

/* 手機版維持比較貼近左側閱讀 */
@media (max-width: 768px) {
  .booking-note {
    max-width: none;
    margin: 12px 16px 8px;
    text-align: left;
    font-size: 13px;
  }
}

.time-select {
  font-size: 16px;        /* ✅ 字體大小（建議 16px 起） */
  height: 48px;           /* 與 input 視覺一致 */
  line-height: 48px;      /* 視覺垂直置中 */
  text-align: center;
  text-align-last: center;
  padding: 0 12px;
}

/* 下拉選項本身 */
.time-select option {
  font-size: 16px;
  text-align: center;
}


.time-select-wrap{
  position: relative;
  width: 100%;
}

/* select 本體 */
.time-select{
  width: 100%;
  height: 48px;
  font-size: 18px;

  /* ✅ 真的置中 */
  text-align: center;
  text-align-last: center;

  /* ✅ 關鍵：拿掉 iOS 原生樣式 */
  -webkit-appearance: none;
  appearance: none;

  /* ✅ 左右留一樣的空間，文字才會視覺置中 */
  padding-left: 44px;
  padding-right: 44px;

  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}

/* 下拉箭頭（自己畫） */
.time-select-arrow{
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #666;
  pointer-events: none; /* 不擋點擊 */
}

/* 有些 iOS 會吃 option 的字級，補一下 */
.time-select option{
  font-size: 18px;
  text-align: center;
}