/* ==========================================================================
   FDliving.com - Design System
   Layout language: light rounded panels, dark feature blocks, wide display type.
   Palette: FD pink (#E05D84) + ink (#1D181B) on white.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800&display=swap');

:root {
  --accent: #E05D84;
  --accent-dark: #C73E67;
  --accent-soft: #FFF0F4;
  --ink: #1D181B;
  --ink-2: #2A2326;
  --ink-3: #383034;
  --panel: #F4F1F2;
  --field: #EAE5E7;
  --page: #FFFFFF;
  --text: #1D181B;
  --muted: #7C7478;
  --line: #E9E3E5;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* legacy names still used by admin */
  --primary-pink: var(--accent);
  --primary-pink-dark: var(--accent-dark);
  --primary-pink-light: var(--accent-soft);
  --dark-hero: var(--ink);
}

* { box-sizing: border-box; }

body {
  font-family: 'Kanit', sans-serif;
  color: var(--text);
  background-color: var(--page);
  overflow-x: hidden;
}

.font-heading,
.fd-display {
  font-family: 'Kanit', sans-serif;
  letter-spacing: 0;
}
.fd-display { font-weight: 600; line-height: 1.18; }

/* หัวข้อหลักของหน้า: เว้นบรรทัดกว้างขึ้นให้สระและวรรณยุกต์ไทยไม่ชนกัน
   และให้เบราว์เซอร์เกลี่ยความยาวบรรทัดเองเมื่อข้อความตัดบรรทัด */
.fd-h1 { line-height: 1.32; text-wrap: balance; }
.fd-h1 + p { text-wrap: pretty; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: #CFC6CA; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Layout ---------- */
.fd-shell { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .fd-shell { padding: 0 24px; } }

.fd-panel { background: var(--panel); border-radius: var(--radius-xl); }
.fd-dark { background: var(--ink); color: #fff; border-radius: var(--radius-xl); }

.fd-muted { color: var(--muted); }
.fd-accent { color: var(--accent); }

/* ---------- Icons (inline SVG filled by JS) ---------- */
.fd-ico { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.fd-ico svg { width: 1em; height: 1em; }

/* ---------- Buttons ---------- */
.btn-pink,
.fd-btn {
  background-color: var(--accent);
  color: #fff;
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-pink:hover,
.fd-btn:hover {
  background-color: var(--accent-dark);
  box-shadow: 0 10px 24px -8px rgba(224, 93, 132, .55);
}
.fd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
}

.btn-dark,
.fd-btn-dark {
  background-color: var(--ink);
  color: #fff;
  transition: background-color .2s ease;
}
.btn-dark:hover,
.fd-btn-dark:hover { background-color: var(--ink-3); }
.fd-btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px; font-size: 12px; font-weight: 600;
}

.fd-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: #fff; border: 1px solid var(--line);
  transition: border-color .2s ease, color .2s ease;
}
.fd-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.fd-round {
  width: 38px; height: 38px; border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; transition: background-color .2s ease, opacity .2s ease;
}
.fd-round-dark { background: var(--ink); color: #fff; }
.fd-round-dark:hover { background: var(--accent); }
.fd-round-light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.fd-round-light:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.fd-round[disabled] { opacity: .4; pointer-events: none; }

/* ---------- Header ---------- */
.fd-logo {
  font-family: 'Kanit', sans-serif; font-weight: 700;
  font-size: 18px; letter-spacing: .04em; color: var(--ink);
}
.fd-logo b { color: var(--accent); font-weight: 700; }

.nav-link {
  font-size: 13px; font-weight: 500; color: var(--ink);
  transition: color .2s ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); font-weight: 600; }

.fd-lang {
  position: relative; display: inline-flex; align-items: center;
  padding: 3px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  cursor: pointer;
}
.fd-lang:hover { border-color: var(--accent); }
.fd-lang:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fd-lang-knob {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px); border-radius: 999px;
  background: var(--ink);
  transition: transform .25s ease;
}
.fd-lang[data-lang="en"] .fd-lang-knob { transform: translateX(100%); }
.fd-lang-opt {
  position: relative; z-index: 1;
  width: 32px; padding: 5px 0; text-align: center;
  color: var(--muted); transition: color .25s ease;
}
.fd-lang[data-lang="th"] .fd-lang-opt:nth-child(2),
.fd-lang[data-lang="en"] .fd-lang-opt:nth-child(3) { color: #fff; }

/* ---------- Hero ---------- */
.fd-hero-media {
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 22%);
}
.fd-hero-media img { width: 100%; height: 100%; object-fit: cover; }

.fd-chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; border-radius: var(--radius-md);
  padding: 10px 14px; box-shadow: 0 18px 40px -18px rgba(29, 24, 27, .45);
  color: var(--ink);
}
.fd-chip .fd-ico { font-size: 22px; }


/* ---------- Cinematic CTA band ---------- */
.fd-cta {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  min-height: 340px; display: flex; align-items: flex-end;
  background: var(--ink);
}
@media (min-width: 640px) { .fd-cta { min-height: 420px; align-items: center; } }
.fd-cta-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fd-cta-veil {
  position: absolute; inset: 0;
  /* phones: text sits over the whole photo, so darken from the bottom up */
  background:
    linear-gradient(to top, rgba(20,16,18,.95) 0%, rgba(20,16,18,.85) 45%, rgba(20,16,18,.62) 75%, rgba(20,16,18,.48) 100%);
}
@media (min-width: 640px) {
  .fd-cta-veil {
    background:
      linear-gradient(to right, rgba(20,16,18,.92) 0%, rgba(20,16,18,.78) 38%, rgba(20,16,18,.25) 68%, rgba(20,16,18,.05) 100%),
      linear-gradient(to top, rgba(20,16,18,.85) 0%, rgba(20,16,18,0) 55%);
  }
}
.fd-cta-body {
  position: relative; z-index: 1;
  padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
}
@media (min-width: 640px) { .fd-cta-body { padding: 44px 48px; } }

.fd-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent);
}

.fd-btn-clear {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.35);
  backdrop-filter: blur(6px);
  transition: background-color .2s ease, border-color .2s ease;
}
.fd-btn-clear:hover { background: rgba(255,255,255,.22); border-color: #fff; }

/* ---------- Dark feature tiles ---------- */
.fd-tile {
  background: var(--ink-2); border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-md); aspect-ratio: 1 / 0.82;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 12px; transition: background-color .2s ease, border-color .2s ease;
}
.fd-tile:hover { background: var(--ink-3); border-color: rgba(224, 93, 132, .45); }
.fd-tile .fd-ico { font-size: 34px; color: #fff; }
.fd-tile span.fd-tile-label { font-size: 12px; font-weight: 600; color: #fff; }

/* "Why FD Living" tiles: stacked rows on phones (tile beside its text), three columns from 640px */
.fd-why-item { display: flex; align-items: center; gap: 16px; }
.fd-why-item .fd-tile { width: 132px; flex-shrink: 0; aspect-ratio: auto; padding: 14px 8px; }
@media (min-width: 640px) {
  .fd-why-item { display: block; }
  .fd-why-item > * + * { margin-top: .75rem; }
  .fd-why-item .fd-tile { width: auto; aspect-ratio: 1 / 0.82; padding: 12px; }
}

/* ---------- Property detail: info tiles + listing-post details ---------- */
.fd-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fd-info-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--panel); display: flex; align-items: center; justify-content: center; }
.fd-info-ico .fd-ico { font-size: 21px; color: var(--ink); }
.fd-info-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.fd-info-text small { font-size: 12px; color: var(--muted); }
.fd-info-text b { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

.fd-post { border-top: 1px solid var(--line); padding-top: 16px; font-size: 14px; line-height: 1.75; color: #3A3236; }
.fd-post-list { display: grid; gap: 4px; }
.fd-post-list li { display: flex; gap: 8px; align-items: flex-start; }
.fd-post-list b { font-weight: 600; color: var(--ink); }
.fd-post-emoji { flex-shrink: 0; width: 22px; text-align: center; }
.fd-post-head { margin-top: 18px; margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.fd-post-text { padding-left: 30px; }
.fd-post-link { color: var(--accent); font-weight: 600; }
.fd-post-link:hover { text-decoration: underline; }
.fd-post-map { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-weight: 600; color: var(--accent); }
.fd-post-map:hover { text-decoration: underline; }
@media (min-width: 768px) { .fd-post-cols { grid-template-columns: 1fr 1fr; column-gap: 24px; } }


/* ---------- Carousel ---------- */
.fd-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding-bottom: 4px; scrollbar-width: none;
}
.fd-track::-webkit-scrollbar { display: none; }
/* property popup: full-width photo slider in the hero */
.fd-hero-track { gap: 0; padding-bottom: 0; }
.fd-hero-track > * { width: 100%; height: 100%; }
.fd-hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 42px; height: 42px; border-radius: 9999px; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .88); color: var(--ink); font-size: 18px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .4);
  transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.fd-hero-arrow:hover { background: var(--accent); color: #fff; }
.fd-hero-count {
  position: absolute; top: 12px; right: 12px; z-index: 5; padding: 4px 10px; border-radius: 9999px;
  background: rgba(29, 24, 27, .7); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
@media (max-width: 639px) { .fd-hero-arrow { width: 36px; height: 36px; font-size: 16px; } }
.fd-track > * { scroll-snap-align: start; flex-shrink: 0; }

.fd-dots { display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; margin-right: 12px; }
.fd-dots span {
  width: 18px; height: 3px; border-radius: 9999px; background: #D5CDD0; transition: all .25s ease;
  cursor: pointer; background-clip: content-box; padding: 8px 0; box-sizing: content-box;
}
.fd-dots span:hover { background-color: #A89EA3; }
.fd-dots span.on { width: 28px; background: var(--ink); }

/* ---------- Property cards ---------- */
.property-card {
  background: #fff; border-radius: var(--radius-lg); padding: 12px;
  transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s ease;
}
.property-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -22px rgba(29, 24, 27, .35); }
.property-card .fd-card-img { border-radius: var(--radius-md); overflow: hidden; background: var(--panel); }
.property-card .fd-card-img img { transition: transform .6s cubic-bezier(.16, 1, .3, 1); }
.property-card:hover .fd-card-img img { transform: scale(1.05); }

.fd-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 600; background: rgba(255,255,255,.95); color: var(--ink);
}
.fd-tag-accent { background: var(--accent); color: #fff; }
.fd-tag-dark { background: rgba(29,24,27,.88); color: #fff; }
/* red "NEW !" badge for listings posted in the last 14 days */
.fd-tag-new { background: #D23F1E; color: #fff; font-weight: 600; font-style: italic; letter-spacing: .04em; padding-left: 12px; padding-right: 13px; box-shadow: 0 2px 8px rgba(210, 63, 30, .35); }

/* ---------- Contact rows ---------- */
.fd-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-md);
  background: #fff; border: 1px solid var(--line);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
a.fd-row:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 14px 30px -20px rgba(29, 24, 27, .45);
}
.fd-row-static { background: var(--panel); border-color: transparent; }
.fd-row-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: 20px;
}
.fd-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fd-row-text small { font-size: 11px; color: var(--muted); }
.fd-row-text b { font-size: 15px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.fd-row-go { margin-left: auto; font-size: 16px; color: #B9B0B4; transition: color .2s ease; }
.fd-row-text em { font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.fd-row-lg { padding: 22px 24px; gap: 18px; }
.fd-row-lg .fd-row-ico { width: 58px; height: 58px; border-radius: 16px; font-size: 24px; }
.fd-row-lg .fd-row-text b { font-size: 20px; }
.fd-row-lg .fd-row-go { font-size: 20px; }
/* the email address is long: keep it on one line on phones */
.fd-row-lg .fd-row-text b.fd-row-email { font-size: clamp(15px, 4.4vw, 20px); overflow-wrap: normal; white-space: nowrap; }
a.fd-row:hover .fd-row-go { color: var(--accent); }

.fd-social {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); color: var(--ink); font-size: 14px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.fd-social:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Map ---------- */
/* Google's embed always shows a place card in the top-left corner.
   The iframe is taller than its frame and shifted up so that card sits outside the visible area;
   the Google logo and attribution at the bottom stay visible. */
.fd-map {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--panel); min-height: 340px;
}
.fd-map iframe {
  position: absolute; left: 0; top: -130px;
  width: 100%; height: calc(100% + 130px); border: 0;
  filter: grayscale(.35) saturate(.9);
}
.fd-map-card {
  position: absolute; left: 12px; right: 12px; top: 12px; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 10px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  box-shadow: 0 14px 30px -18px rgba(29, 24, 27, .45);
}
@media (min-width: 640px) { .fd-map-card { right: auto; min-width: 340px; } }

/* ---------- Forms ---------- */
.fd-input {
  width: 100%; background: var(--field); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; color: var(--ink);
  transition: border-color .2s ease, background-color .2s ease;
}
.fd-input::placeholder { color: #9B9296; }
.fd-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.fd-panel .fd-input { background: #fff; }
.fd-panel .fd-input:focus { background: #fff; }
.fd-label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

/* ---------- Filters ---------- */
/* Filter dropdown (zone / category) */
.fd-dd-wrap { position: relative; min-width: 0; }
.fd-dd { position: relative; }
.fd-dd-btn {
  display: inline-flex; align-items: center; gap: 10px; width: 100%; min-width: 240px; max-width: 100%;
  padding: 9px 14px 9px 18px; border-radius: 9999px; background: #fff; border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink); text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.fd-dd-btn:hover, .fd-dd-btn[aria-expanded="true"] { border-color: var(--accent); }
.fd-dd-btn[aria-expanded="true"] { box-shadow: 0 0 0 4px rgba(224, 93, 132, .12); }
.fd-dd-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-dd-count { font-size: 11px; font-weight: 700; min-width: 22px; padding: 1px 7px; border-radius: 9999px; background: var(--ink); color: #fff; text-align: center; }
.fd-dd-chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); transition: transform .25s var(--ease-out); }
.fd-dd-btn[aria-expanded="true"] .fd-dd-chev { transform: rotate(180deg); color: var(--accent); }
.fd-dd-menu {
  position: fixed; z-index: 85; width: max-content; max-width: min(340px, calc(100vw - 24px));
  max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 18px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 24px 50px -20px rgba(29, 24, 27, .35); animation: fd-drop .25s var(--ease-out);
}
.fd-dd-menu[hidden] { display: none; }
.fd-dd-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px;
  font-size: 13px; font-weight: 500; color: var(--ink); text-align: left; transition: background-color .15s ease;
}
.fd-dd-opt > span:first-child { flex: 1; }
.fd-dd-opt:hover, .fd-dd-opt:focus-visible { background: var(--panel); outline: none; }
.fd-dd-opt.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.fd-dd-opt.is-empty { color: #B3AAAE; }
.fd-dd-opt-count { font-size: 11px; font-weight: 700; color: var(--muted); }
.fd-dd-opt.active .fd-dd-opt-count { color: var(--accent); }
.fd-dd-check { width: 16px; height: 16px; flex-shrink: 0; visibility: hidden; }
.fd-dd-opt.active .fd-dd-check { visibility: visible; }
@media (max-width: 639px) { .fd-dd-btn { min-width: 0; } }

/* ---------- Footer ---------- */
.fd-foot-link { font-size: 13px; color: #B9B0B4; transition: color .2s ease; }
.fd-foot-link:hover { color: #fff; }
/* phones: taller footer links so they are easy to tap */
@media (max-width: 767px) { .fd-foot-link { padding-block: 6px; } }

/* ---------- Modal ---------- */
.modal-overlay { background: rgba(15, 12, 14, .72); backdrop-filter: blur(6px); }

/* Property popup (site + admin form): close button pinned to the corner + a slim scrollbar that fits the rounded card */
.fd-modal-close-bar { position: sticky; top: 0; z-index: 20; height: 0; display: flex; justify-content: flex-end; }
.fd-modal-close {
  margin: 20px 20px 0 0; width: 38px; height: 38px; flex-shrink: 0; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .95); color: var(--ink);
  box-shadow: 0 6px 18px -6px rgba(29, 24, 27, .35); transition: background-color .2s ease, color .2s ease;
}
.fd-modal-close:hover { background: var(--ink); color: #fff; }
@media (min-width: 640px) { .fd-modal-close { margin: 28px 28px 0 0; } }
#property-modal > div::-webkit-scrollbar,
#admin-property-modal > div::-webkit-scrollbar { width: 6px; }
#property-modal > div::-webkit-scrollbar-track,
#admin-property-modal > div::-webkit-scrollbar-track { background: transparent; margin: 28px 0; }
#property-modal > div::-webkit-scrollbar-thumb,
#admin-property-modal > div::-webkit-scrollbar-thumb { background: #DCD0D5; border-radius: 9999px; }
#property-modal > div::-webkit-scrollbar-thumb:hover,
#admin-property-modal > div::-webkit-scrollbar-thumb:hover { background: var(--accent); }
@supports not selector(::-webkit-scrollbar) {
  #property-modal > div, #admin-property-modal > div { scrollbar-width: thin; scrollbar-color: #DCD0D5 transparent; }
}

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Bilingual content blocks (toggled by <html lang>) ---------- */
html[lang="th"] [data-lang-block="en"],
html[lang="en"] [data-lang-block="th"] { display: none; }

/* posted / updated line on listing cards */
.fd-card-times { margin-top: 10px; font-size: 11px; line-height: 1.5; color: #9B9296; }

/* ---------- Sale / rent split ---------- */
.fd-deal-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 9999px; background: var(--panel); border: 1px solid var(--line); align-self: flex-start; }
.fd-deal-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9999px;
  font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background-color .2s ease, color .2s ease;
}
@media (max-width: 639px) {
  .fd-deal-tabs { display: flex; width: 100%; }
  .fd-deal-tab { flex: 1; justify-content: center; padding: 8px 10px; }
}
.fd-deal-tab span { font-size: 11px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 9999px; background: #fff; color: var(--ink); text-align: center; }
.fd-deal-tab:hover:not(.active):not([disabled]) { color: var(--ink); }
.fd-deal-tab.active { background: var(--ink); color: #fff; }
.fd-deal-tab.active span { background: var(--accent); color: #fff; }
.fd-deal-tab[disabled] { opacity: .45; cursor: not-allowed; }
.fd-deal-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.fd-deal-head:not(:first-child) { margin-top: 28px; }
.fd-deal-head h2 { font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.fd-deal-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 9999px; margin-right: 10px; vertical-align: middle; background: var(--accent); }
.fd-deal-head-sale h2::before { background: var(--ink); }
.fd-deal-head span { font-size: 13px; color: var(--muted); }
.fd-deal-head-project h2::before { background: transparent; border: 2px solid var(--accent); }

/* ---------- Project headings (units of one project listed together on the condo page) ---------- */
.fd-project-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 16px 20px; border-radius: 18px; background: var(--panel);
}
.fd-project-head:not(:first-child) { margin-top: 18px; }
.fd-project-head h3 { font-size: 20px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.fd-project-head p { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.fd-project-sides { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-project-side { display: inline-flex; align-items: baseline; gap: 8px; padding: 8px 14px; border-radius: 9999px; background: #fff; font-size: 12px; }
.fd-project-side b { font-size: 13px; font-weight: 600; color: var(--ink); }
.fd-project-side span { font-weight: 600; color: var(--accent); }

/* ---------- Listing tags (admin tick boxes + chips on the listing) ---------- */
.fd-feature-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9999px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--ink);
}
.fd-tick { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px;
  border: 1px solid #F1E5E9; background: #fff; cursor: pointer; user-select: none; transition: border-color .15s ease, background-color .15s ease; }
.fd-tick:hover { border-color: #E9C3CF; }
.fd-tick input { position: absolute; opacity: 0; pointer-events: none; }
.fd-tick-box { width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px; border: 1.5px solid #D6CDD1; display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent; transition: all .15s ease; }
.fd-tick-emoji { font-size: 15px; line-height: 1; }
.fd-tick-label { font-size: 12px; font-weight: 600; color: #4A4246; }
.fd-tick:has(input:checked) { border-color: #22A06B; background: #F0FAF5; }
.fd-tick input:checked + .fd-tick-box { background: #22A06B; border-color: #22A06B; color: #fff; }
.fd-tick input:focus-visible + .fd-tick-box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Share ---------- */
.fd-share-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 9999px;
  font-size: 12px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line);
  transition: border-color .2s ease, color .2s ease;
}
.fd-share-pill:hover { border-color: var(--accent); color: var(--accent); }
.fd-share-pill .fd-ico { font-size: 14px; }
.fd-share {
  position: fixed; inset: 0; z-index: 110; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 12, 14, .55); backdrop-filter: blur(4px); animation: fd-fade .2s ease;
}
.fd-share[hidden] { display: none; }
.fd-share-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 24px 24px 0 0; padding: 22px 20px 26px;
  animation: fd-pop .4s var(--ease-out);
}
@media (min-width: 640px) { .fd-share { align-items: center; } .fd-share-card { border-radius: 24px; } }
.fd-share-card h4 { font-size: 17px; font-weight: 700; color: var(--ink); }
.fd-share-card p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.fd-share-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.fd-share-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px;
  font-size: 12px; font-weight: 600; color: var(--ink); background: var(--panel); transition: background-color .2s ease;
}
.fd-share-opt:hover { background: var(--field); }
.fd-share-opt i, .fd-share-opt .fd-ico { font-size: 26px; }
.fd-share-link { display: flex; gap: 8px; margin-top: 14px; }
.fd-share-link input {
  flex: 1; min-width: 0; font-size: 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
}
.fd-share-close { position: absolute; top: 14px; right: 14px; }

/* ---------- Photo lightbox ---------- */
.fd-lb {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 12, 14, .92); backdrop-filter: blur(8px);
  animation: fd-fade .25s ease;
}
.fd-lb[hidden] { display: none; }
.fd-lb.is-closing { animation: fd-fade-out .2s ease forwards; }
.fd-lb-stage { margin: 0; padding: 64px 72px; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.fd-lb-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6);
  user-select: none; -webkit-user-drag: none;
}
.fd-lb-img.is-next { animation: fd-lb-in-next .45s var(--ease-out); }
.fd-lb-img.is-prev { animation: fd-lb-in-prev .45s var(--ease-out); }
.fd-lb-img.is-open { animation: fd-pop .45s var(--ease-out); }
@keyframes fd-lb-in-next { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes fd-lb-in-prev { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.fd-lb-btn {
  position: absolute; width: 46px; height: 46px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 18px;
  transition: background-color .2s ease;
}
.fd-lb-btn[hidden] { display: none; }
.fd-lb-btn:hover { background: var(--accent); }
.fd-lb-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fd-lb-close { top: 16px; right: 16px; }
.fd-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.fd-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.fd-lb-count {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 9999px; background: rgba(255, 255, 255, .12);
  color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .05em;
}
@media (max-width: 640px) {
  .fd-lb-stage { padding: 64px 8px 76px; }
  .fd-lb-prev, .fd-lb-next { top: auto; bottom: 12px; transform: none; }
}

/* ---------- Motion ---------- */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }

@keyframes fd-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fd-fade-out { to { opacity: 0; } }
@keyframes fd-zoom { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes fd-pop { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fd-drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Page-to-page transition (Chrome, Edge, Safari 18.2+) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fd-fade-out .25s ease both; }
::view-transition-new(root) { animation: fd-fade .35s ease both; }

/* Hero entrance on page load (fill-mode backwards keeps hover transforms working afterwards) */
main > section:first-child .fd-panel { animation: fd-fade .5s ease backwards; }
main > section:first-child :is(h1, h1 ~ *, :has(+ h1)) { animation: fd-rise .8s var(--ease-out) backwards; }
main > section:first-child :has(+ h1) { animation-delay: .05s; }
main > section:first-child h1 { animation-delay: .12s; }
main > section:first-child h1 + * { animation-delay: .22s; }
main > section:first-child h1 + * + * { animation-delay: .32s; }
main > section:first-child h1 + * + * + * { animation-delay: .42s; }
.fd-hero-media img { animation: fd-zoom 1.4s var(--ease-out) .1s backwards; }
main > section:first-child .fd-chip { animation: fd-pop .7s var(--ease-out) .6s backwards; }
main > section:nth-child(2) { animation: fd-rise .9s var(--ease-out) .35s backwards; }

/* Property cards rise in, staggered (also replays when filtering / switching language) */
.property-card { animation: fd-rise .7s var(--ease-out) backwards; }
:nth-child(2) > .property-card, .property-card:nth-child(2) { animation-delay: .06s; }
:nth-child(3) > .property-card, .property-card:nth-child(3) { animation-delay: .12s; }
:nth-child(4) > .property-card, .property-card:nth-child(4) { animation-delay: .18s; }
:nth-child(5) > .property-card, .property-card:nth-child(5) { animation-delay: .24s; }
:nth-child(6) > .property-card, .property-card:nth-child(6) { animation-delay: .3s; }

/* Scroll reveal (class added by app.js only to sections below the fold) */
.fd-reveal { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.fd-reveal.is-in { opacity: 1; transform: none; }
.fd-reveal:not(.is-in) .grid > * { opacity: 0; }
.fd-reveal.is-in .grid > * { animation: fd-rise .8s var(--ease-out) backwards; }
.fd-reveal.is-in .grid > :nth-child(2) { animation-delay: .1s; }
.fd-reveal.is-in .grid > :nth-child(3) { animation-delay: .2s; }
.fd-reveal.is-in .grid > :nth-child(4) { animation-delay: .3s; }

/* Language switch: new text fades in */
.fd-lang-swap [data-i18n] { animation: fd-fade .45s ease backwards; }

/* Mobile menu + property modal */
#mobile-nav:not(.hidden),
.fd-sticky-nav:not(.hidden) { animation: fd-drop .3s var(--ease-out); }
#property-modal:not(.hidden) { animation: fd-fade .3s ease; }
#property-modal:not(.hidden) > div { animation: fd-pop .5s var(--ease-out); }
#property-modal.is-closing { animation: fd-fade-out .22s ease forwards; }

/* Parallax on the big photos (JS sets --py while scrolling) */
.fd-parallax { overflow: hidden; }
.fd-parallax img { scale: 1.18; translate: 0 var(--py, 0px); will-change: translate; }

/* Headlines slide up line by line (padding keeps Thai vowels/tone marks inside the mask) */
.fd-line { display: block; overflow: hidden; padding: .16em 0; margin: -.16em 0; }
.fd-line-in { display: block; transform: translateY(115%); transition: transform 1.1s var(--ease-out); }
.fd-lines.is-in .fd-line-in { transform: none; }
main > section:first-child h1.fd-lines { animation: none; }

/* Sticky glass header, shown once the page header scrolls away */
.fd-sticky {
  position: fixed; top: 10px; left: 50%; z-index: 80;
  width: min(1152px, calc(100% - 32px)); padding: 10px 14px 10px 22px;
  border-radius: 16px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(233, 227, 229, .8);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 14px 40px -24px rgba(29, 24, 27, .45);
  transform: translate(-50%, -140%); transition: transform .55s var(--ease-out);
}
.fd-sticky.is-shown { transform: translate(-50%, 0); }
.fd-sticky .fd-logo { font-size: 15px; }
body.overflow-hidden .fd-sticky { display: none; }

/* Hover details: nav underline, magnetic buttons, arrow nudge */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px;
  background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-out);
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); transform-origin: left; }
.fd-magnetic { transition-property: background-color, color, border-color, box-shadow, opacity, translate; transition-duration: .2s, .2s, .2s, .2s, .2s, .35s; transition-timing-function: ease, ease, ease, ease, ease, var(--ease-out); }
[data-icon="arrow"] { display: inline-flex; transition: translate .3s var(--ease-out); }
a:hover [data-icon="arrow"] { translate: 5px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  .fd-reveal, .fd-reveal .grid > * { opacity: 1 !important; transform: none !important; }
}
