/* 預約訊息浮動按鈕 —— 沿用 go-top-btn 圓形風格,定位於其正上方 */
.message-btn {
  position: fixed;
  bottom: 134px; /* goTopBtn(80) + 高度(44) + 間距(10) */
  right: 80px;
  width: 44px;
  height: 44px;
  background-color: var(--accent-color);
  backdrop-filter: blur(10px);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0.725;
  z-index: 41;
}

.message-btn:hover {
  opacity: 1;
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 對話框開啟時,按鈕圖示切換為關閉提示(以 class 控制) */
.message-btn.is-open {
  opacity: 1;
}

/* 對話框面板 —— 桌機錨定右下角,於按鈕上方展開 */
.booking-chat {
  position: fixed;
  bottom: 190px; /* message-btn 上方 */
  right: 80px;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 220px);
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 60;
  transform-origin: bottom right;
  /* 預設收合狀態 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.booking-chat.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.booking-chat__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background-color: var(--accent-color);
  color: #fff;
}

.booking-chat__title {
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin: 0;
}

.booking-chat__close {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.booking-chat__close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.booking-chat__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  color: var(--text-color);
}

/* 對話框遮罩 —— 僅手機版使用 */
.booking-chat-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 55;
}

.booking-chat-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* 手機版:對話框改為底部全寬彈出 sheet,並啟用遮罩 */
@media (max-width: 767px) {
  .message-btn {
    bottom: 108px; /* goTopBtn(60) + 高度(40) + 間距(8) */
    right: 20px;
    width: 40px;
    height: 40px;
  }

  .message-btn svg {
    width: 20px;
    height: 20px;
  }

  .booking-chat {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 16px 16px 0 0;
    transform-origin: bottom center;
    transform: translateY(100%);
  }

  .booking-chat.is-open {
    transform: translateY(0);
  }
}
