/* FAB Container */
.fab-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* wrapper สำหรับปุ่ม contact */
.fab-btns {
  position: absolute;
  bottom: 70px; /* ให้เมนูปุ่ม contact โผล่เหนือปุ่มฟ้า */
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* ให้ปุ่มขยายเต็มความกว้าง */
  gap: 10px; /* เว้นระยะห่างระหว่างปุ่ม */
  transition: opacity 0.2s ease;
  opacity: 1;
  pointer-events: auto;
}

/* ซ่อนเมนูตอน inactive */
.fab-container:not(.active) .fab-btns {
  opacity: 0;
  pointer-events: none;
}

/* ปุ่มฟ้าหลัก */
.fab-main {
  background-color: #007bff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
  position: relative;
  z-index: 2;
}

/* ปุ่ม contact */
.fab-btn {
  width: 220px; /* กำหนดความกว้างเท่ากัน */
  background-color: white;
  border-radius: 25px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* ชิดซ้าย */
  gap: 8px; /* เว้นระยะห่างระหว่างไอคอนกับข้อความ */
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: #333;
  transition: transform 0.2s ease;
  z-index: 1;
  white-space: nowrap;
}

.fab-btn i {
  font-size: 20px;
}

/* Hover effect ปุ่ม contact */
.fab-btn:hover {
  transform: scale(1.05);
}

/* Bubble ข้อความ */
.fab-cta-bubble {
  background: white;
  color: #333;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 13px;
  position: absolute;
  right: 70px;
  white-space: nowrap;
  top: 15px;
  font-family: 'Kanit', sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: opacity 0.2s ease;
  z-index: 3;
}

.hide {
  display: none;
}

/* Popup Styles */
#customPopup {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
}

#customPopup.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

#customPopup .popup-body {
  background: white;
  padding: 20px;
  border-radius: 12px;
  max-width: 360px;
  width: 90%;
  font-family: 'Kanit', sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 12px;
}

.popup-close {
  font-size: 22px;
  cursor: pointer;
}

.popup-body input {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.popup-submit-btn {
  width: 100%;
  background: #007bff;
  color: white;
  padding: 10px;
  font-weight: bold;
  font-family: 'Kanit', sans-serif;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.popup-submit-btn:hover {
  background: #0056b3;
}
