body {
  background-color: #ffffff;
 font-family: "Athiti", sans-serif;
  font-weight: 100;
  font-style: normal;
}

/* ===== Header พื้นฐาน ===== */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 30px;
  z-index: 1000;
  font-family: "Athiti", sans-serif;
  font-weight: 100;
  font-style: normal;
}

/* Logo */
.logo img {
  height: 30px;
}

/* ปุ่ม Hamburger */
.menu-toggle {
  display: none; /* ซ่อนใน Desktop */
  cursor: pointer;
}
.menu-toggle img {
  width: 28px;
}

/* Language */
.language img {
  width: 28px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language img:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}


/* เมนู Desktop */
nav {
  display: flex;
  gap: 35px;
  font-size: 18px;
}
nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}
nav a:hover {
  color: #aaa;
}

/* ===== Mobile Layout ===== */
@media (max-width: 768px) {
  header {
    justify-content: space-between;
  }

  .menu-toggle {
    display: block; /* โชว์ใน Mobile */
    order: 1;
  }

  .logo {
    order: 2;
    text-align: center;
    flex: 1;
  }
  .logo img {
    height: 40px;
  }

  .language {
    order: 3;
  }

  /* ซ่อนเมนูปกติ */
  nav {
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #1a1a1a;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  nav.active {
    max-height: 100vh;   /* ใช้เต็มความสูงจอ */
  overflow-y: auto;    /* ถ้าเมนูยาว ให้เลื่อนในตัวได้ */
  }

  nav a {
    padding: 15px 0;
    text-align: center;
    border-bottom: 1px solid #333;
  }
}








/* Search Box */
 
.search-section {
  background: url("img/2.jpg") center/cover no-repeat;
  background-attachment: fixed;
  padding: 80px 20px;
  text-align: center;

  
}
/* .search-box {
  background: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  padding: 15px; */
  /* border-radius: 10px; */
  /* gap: 10px;
  
}
.search-box input,
.search-box select,
.search-box button {
  padding: 10px;
  font-size: 16px;
  color: #000000;
  font-family: "Athiti", sans-serif;
  font-weight: 400;
  font-style: normal;
  border-radius: 10px;
}
.search-box button {
  background: #ffffff;
  border: none;
  cursor: pointer;
  transition: 0.3s;
  border-radius: 10px;
}
.search-box button:hover { background: #757575; } */

 .search-box {
      background: rgb(255, 255, 255);
      padding: 15px;
      /* border-radius: 10px; */
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: center;
        max-width: 1000px;   /* 👈 กำหนดความกว้างสูงสุด */
  margin: 0 auto;      /* 👈 จัดให้อยู่ตรงกลาง */
  
      
    }

    .search-box input, .search-box select, .search-box button {
      padding: 10px;
      border: none;
      border-radius: 5px;
      min-width: 150px;
      font-family: "Athiti", sans-serif;
  font-weight: 400;
  font-style: normal;
  
    }

    .search-box button {
      background-color: #000000;
      color: white;
      font-weight: bold;
      cursor: pointer;
    }

    .search-box .autocomplete {
  flex: 1;          /* 👈 ช่องค้นหาขยายเต็มพื้นที่ */
}

.search-box input[type="text"] {
  width: 100%;           /* กินพื้นที่ทั้งหมดที่ flex ให้ */
  padding: 10px 14px;
  font-size: 16px;
  /* border: 1px solid #ccc; */
  border-radius: 6px;
}

.search-box select,
.search-box button {
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}



/* ประกาศ */

.property-list {
  padding: 20px;
  font-family: Arial, sans-serif;
  text-align: center;
  font-family: "Athiti", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.property-list h2 {
  margin-bottom: 20px;
}

/* แท็บเล็ต (หน้าจอขนาดกลาง) */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ต่อแถว */
  }
}

/* มือถือ (หน้าจอเล็ก) */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr; /* 1 คอลัมน์ต่อแถว */
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;              /* ระยะห่างระหว่างการ์ด */
  justify-content: center; /* ✅ จัด grid ให้อยู่กลาง */
  max-width: 1200px;      /* ✅ กำหนดความกว้างสูงสุดของตาราง */
  margin: 0 auto;         /* ✅ จัดให้อยู่กึ่งกลางหน้าจอ */
}


.property-container {
  display: flex;
  justify-content: center;   /* จัดให้อยู่ตรงกลาง */
  gap: 15px;                 /* ระยะห่างระหว่างการ์ด */
  flex-wrap: wrap;           /* ถ้าจอเล็กจะขึ้นบรรทัดใหม่ */
  max-width: 1200px;         /* ขนาดสูงสุดของแถว */
  margin: 0 auto;            /* จัด container ให้อยู่กลางจอ */
}

.property1 {
  width: 260px;              /* ขนาดการ์ดให้เท่ากัน */
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  
}


.property1:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* main.css หรือ style.css (ที่มี .carousel/.dots อยู่แล้ว) */
.carousel { position: relative; }
.carousel-link { position: relative; z-index: 1; display: block; }
.dots { position: absolute; z-index: 5; pointer-events: auto; } /* ให้จุดอยู่เหนือรูปและคลิกได้ */


.carousel {
  position: relative;
  width: 100%;
  height: 180px;        /* 🔒 ล็อคขนาดรูป */
  overflow: hidden;
}

.carousel img {
  display: none;
  transition: opacity 0.5s ease;
}
.carousel img.active {
  display: block;
}
.dots {
  cursor: pointer;
}
.dots .dot.active {
  background: #000; /* สีจุดเมื่อ active */
}

.status {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #2ecc71;
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}

.sub-status {
  position: absolute;
  top: 35px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 6px;
}

.dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.dot {
  height: 8px;
  width: 8px;
  margin: 0 3px;
  background: #bbb;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
}

.dot.active {
  background: #ffffff;
}

.info {
  padding: 12px;
  text-align: left;
}

.info h3 {
  font-size: 15px;
  margin: 0 0 8px;
}

.price {
  font-size: 16px;
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 8px;
}

.features {
  font-size: 14px;
  margin: 8px 0;
}

.features span {
  margin-right: 10px;
}

.meta {
  font-size: 13px;
  color: #555;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta small {
  font-size: 11px;
  color: #888;
}

.detail-btn {
  display: block;
  text-align: center;
  background: #000000;
  color: #fff;
  padding: 6px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s;
}

.detail-btn:hover {
  background: #444444;
}
/* สำหรับไอคอน */
.features span {
  margin-right: 10px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.features img {
  width: 18px;
  height: 18px;
  margin-right: 5px;
}
/* Info */
.info { padding: 15px; }
.info h3 { margin: 0 0 10px; }
.info p { margin: 5px 0; }


/* ป้ายประเภท (เช่า/ขาย) */
.status.type {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #2ecc71;
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}

/* sub-status = ประเภททรัพย์ + รหัส (ย้ายขึ้นบน type) */
.sub-status {
  position: absolute;
  top: 8px;
  left: 65px; /* ขยับไปข้างขวา */
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 3px 6px;
  font-size: 11px;
  border-radius: 6px;
}

/* ป้ายสถานะ (ว่าง/ไม่ว่าง/ใกล้ว่าง) */
.status.availability {
  position: absolute;
  top: 38px;
  left: 8px;
  color: #fff;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.status.availability.available { 

  background: #28a745;
  box-shadow: 0 0 10px #28a745, 0 0 20px #28a745;
  animation: glow-blink 1.0s infinite;
}
.status.availability.unavailable { 
  background: #dc3545;
  box-shadow: 0 0 10px #ff0000, 0 0 20px #ff9900;
  animation: glow-blink 0.5s infinite;
 }
.status.availability.sold { 
  background: #000000;
  box-shadow: 0 0 10px #dfe218, 0 0 20px #a79028;
  animation: glow-blink 1.0s infinite;
 }

/* ราคา + ตร.ม. */
.price {
  font-size: 16px;
  font-weight: bold;
  color: #e74c3c;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px; /* ระยะห่างระหว่างราคา กับ (บาท/ตร.ม.) */
}

.sqm-price {
  font-size: 10px;
  font-weight: normal;
  color: #555;
}
/* คลิกได้ทั้งรูป */
.carousel-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-link img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: none;
  transition: filter 0.3s ease;
  cursor: pointer;
}

.carousel-link img.active {
  display: block;
}

/* hover เฉพาะรูปที่ active */
.carousel-link:hover img.active {
  filter: brightness(80%);
}
.status, .sub-status {
  position: absolute;
  z-index: 5;   /* ✅ บังคับให้ลอยเหนือรูป */
}

.carousel-link img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: none;
  transition: filter 0.3s ease;
  cursor: pointer;
}

.carousel-link img.active {
  display: block;
}

.carousel-link:hover img.active {
  filter: brightness(80%);
}













/* Pagination */
.pagination {
  text-align: center;
  margin: 30px 0;
  font-family: "Athiti", sans-serif;
  font-weight: 100;
  font-style: normal;
}
.pagination a {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 3px;
  background: #ffffff;
  border-radius: 5px;
  text-decoration: none;
  color: #333;
  border: 1px solid #ddd;
  transition: 0.3s;
}
.pagination a.active,
.pagination a:hover {
  background: #000000;
  color: white;
}



/* Footer */
footer {
  background: rgb(255, 255, 255);
  color: rgb(0, 0, 0);
  text-align: center;
  padding: 20px;
  font-family: "Athiti", sans-serif;
  font-weight: 100;
  font-style: normal;
}
footer .social-icons img {
  height: 23px;
  margin: 0 8px;
  transition: transform 0.3s;
}
footer .social-icons img:hover { transform: scale(1.2); }
* {margin: 0; padding: 0; box-sizing: border-box;}
    body {font-family: sans-serif; line-height: 1.6;}

   /* ปุ่ม */


.autocomplete {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 300px;
}

#autocomplete-list {
  position: absolute;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-top: none;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
}

#autocomplete-list div {
  padding: 10px;
  cursor: pointer;
  background: #fff;
  border-bottom: 1px solid #d4d4d4;
}

#autocomplete-list div:hover {
  background: #e9e9e9;
}

#autocomplete-list .autocomplete-active {
  background: #000;
  color: #fff;
}

/* ==== Search result animation ==== */
.property1 { transition: all 0.4s ease; opacity: 1; }

.property1.hidden { display: none !important; opacity: 0; }

.property1.show { display: block; animation: fadeInScale 0.4s ease; }

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
