/* =====================================================================
   Kustomisasi RumahPro — dimuat SETELAH style.css template.
   Berisi: perbaikan formulir pencarian hero, tombol WhatsApp
   mengambang, dan widget chat AI. Jangan edit style.css template.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Formulir pencarian di hero beranda
   Template merancang .form-search untuk SATU kolom isian; di sini ada
   1 input + 2 select + tombol, jadi lebar diatur ulang agar teks
   select ("Semua Tipe", "Jual / Sewa") tidak terpotong.
   --------------------------------------------------------------------- */
.hero .form-search {
  max-width: 840px;
  flex-wrap: wrap;
  gap: 10px;
}

.hero .form-search .form-control {
  margin-right: 0;
  /* Akar masalah teks terpotong: tema menetapkan .form-control
     height:52px TETAP, sementara padding vertikal hero 18px+18px —
     sisa ruang teks cuma 16px untuk huruf 16px (line-height ±24px),
     jadi teks select tergunting vertikal ("Jual" -> "Iual").
     Lepas tinggi tetapnya khusus form hero. */
  height: auto;
  min-height: 56px;
  padding-top: 14px;
  padding-bottom: 14px;
  line-height: 1.4;
}

.hero .form-search input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
}

.hero .form-search select.form-control {
  flex: 0 1 190px;
  min-width: 150px;
  padding-left: 20px;
  padding-right: 40px; /* ruang untuk panah dropdown */
  text-overflow: clip;
  white-space: nowrap;
  /* Teks pilihan di tengah kolom (permintaan pengguna 24 Nov 2026). */
  text-align: center;
  text-align-last: center;
}

.hero .form-search .btn {
  flex: 0 0 auto;
  border-radius: 30px;
}

@media (max-width: 767.98px) {
  .hero .form-search input[type="text"],
  .hero .form-search select.form-control,
  .hero .form-search .btn {
    flex: 1 1 100%;
  }
}

/* ---------------------------------------------------------------------
   2. Tombol WhatsApp mengambang (kanan bawah)
   --------------------------------------------------------------------- */
.wa-mengambang {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1030;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  transition: transform 0.2s ease;
  animation: wa-denyut 2.4s ease-out infinite;
}

.wa-mengambang svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

.wa-mengambang:hover,
.wa-mengambang:focus {
  color: #fff;
  transform: scale(1.08);
}

@keyframes wa-denyut {
  0% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0.45);
  }
  70% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 16px rgba(37, 211, 102, 0);
  }
  100% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(37, 211, 102, 0);
  }
}

/* ---------------------------------------------------------------------
   3. Widget chat AI (tombol di atas tombol WhatsApp)
   --------------------------------------------------------------------- */
.chat-ai-tombol {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 1030;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background-color: #005555;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.chat-ai-tombol svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.chat-ai-tombol:hover,
.chat-ai-tombol:focus {
  background-color: #003d3d;
  transform: scale(1.08);
}

.chat-ai-panel {
  position: fixed;
  right: 24px;
  bottom: 164px;
  z-index: 1040;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 190px);
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 85, 85, 0.35);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-ai-panel.terbuka {
  display: flex;
}

.chat-ai-kepala {
  /* Hijau situs (#005555), bukan navy — permintaan pengguna 24 Nov 2026. */
  background-color: #005555;
  color: #fff;
  padding: 13px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.chat-ai-judul {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
}

.chat-ai-subjudul {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

.chat-ai-tutup {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.chat-ai-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background-color: #f4f6f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-ai-gelembung {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.chat-ai-gelembung.pengunjung {
  align-self: flex-end;
  background-color: #005555;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-ai-gelembung.asisten {
  align-self: flex-start;
  background-color: #fff;
  color: #212529;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.chat-ai-gelembung.mengetik {
  color: #64748b;
  font-style: italic;
  animation: chat-ai-kedip 1.1s ease-in-out infinite;
}

@keyframes chat-ai-kedip {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.chat-ai-formulir {
  display: flex;
  gap: 8px;
  padding: 10px;
  background-color: #fff;
  border-top: 1px solid #e2e8f0;
}

.chat-ai-formulir input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
}

.chat-ai-formulir input:focus {
  border-color: #005555;
}

.chat-ai-kirim {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background-color: #005555;
  color: #fff;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.chat-ai-kirim:hover {
  background-color: #003d3d;
}

.chat-ai-kirim:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 575.98px) {
  .chat-ai-panel {
    left: 12px;
    right: 12px;
    top: 64px;
    bottom: 160px;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
  }
}
