* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.site-header {
  min-height: 82px;
  padding: 12px max(22px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .08em; text-decoration: none; }
.site-brand img { width: 56px; height: 56px; object-fit: contain; }
.site-brand small { display: block; margin-top: 3px; letter-spacing: .24em; }
.site-header nav { display: flex; align-items: center; gap: 24px; }
.site-header nav a { font-weight: 700; text-decoration: none; }
.site-header nav a:hover, .site-header nav .nav-current { text-decoration: underline; text-underline-offset: 5px; }

.home-main { width: min(100% - 40px, 1120px); margin: 0 auto; padding: 36px 0 58px; display: grid; align-content: start; gap: 19px; flex: 1 0 auto; }
.home-brand-panel, .home-search-panel, .home-latest-panel, .home-location-panel, .home-contact-panel { border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.9); box-shadow: 0 12px 30px rgba(24,70,26,.055); }
.home-brand-panel { min-height: 175px; padding: 25px; display: flex; align-items: center; justify-content: center; gap: 22px; text-align: left; }
.home-brand-panel > img { width: 102px; height: 112px; object-fit: contain; }
.home-brand-panel > div > span { display: block; color: var(--green-dark); font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; letter-spacing: .11em; line-height: 1; }
.home-brand-panel small { display: block; margin-top: 8px; color: var(--ink); font-size: .83rem; font-weight: 700; letter-spacing: .34em; }
.home-search-panel { padding: 26px 28px 28px; }
.home-latest-panel { padding: 26px 28px 28px; }
.home-section-heading { margin-bottom: 18px; }
.latest-properties-state { margin: 0; padding: 25px 18px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.55); font-size: .9rem; text-align: center; }
#latest-properties .property-cards { max-width: 960px; margin-inline: auto; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#latest-properties .card-image-link > img { aspect-ratio: 1.65; }
#latest-properties .card-content { padding: 13px; }
#latest-properties .card-content h3 { font-size: 1rem; }
#latest-properties .card-address { font-size: .8rem; }
#latest-properties .card-facts { margin-top: 10px; gap: 6px 9px; font-size: .73rem; }
#latest-properties .card-price { margin-top: 9px; font-size: 1.05rem; }
.home-eyebrow { margin: 0 0 5px; color: var(--green-dark); font-size: .73rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.home-section-heading h1, .home-section-heading h2, .home-location-copy h2 { margin: 0; color: var(--ink); font-size: 1.42rem; line-height: 1.2; }
.home-search-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.home-select-field { min-width: 0; display: grid; gap: 6px; }
.home-select-field > span { color: #405347; font-size: .83rem; font-weight: 700; }
.home-select-field select { width: 100%; min-height: 46px; padding: 8px 35px 8px 11px; border: 1px solid #cbd8cb; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: .9rem; }
.home-select-field select:focus-visible { border-color: var(--green); outline: 3px solid rgba(49,158,39,.14); }
.home-search-button { grid-column: 1 / -1; min-height: 46px; margin-top: 3px; border: 0; border-radius: 8px; color: #fff; background: var(--green-dark); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background 150ms ease, transform 150ms ease; }
.home-search-button:hover, .home-search-button:focus-visible { background: #1d7615; transform: translateY(-1px); outline: 3px solid rgba(37,147,23,.2); outline-offset: 2px; }
.home-location-panel { padding: 18px; display: grid; grid-template-columns: .8fr 1.2fr; align-items: stretch; gap: 20px; }
.home-location-copy { padding: 13px 10px; align-self: center; }
.home-location-copy h2 { margin-bottom: 10px; }
.home-location-copy > p:not(.home-eyebrow) { margin: 0 0 12px; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.home-location-copy > a { color: var(--green-dark); font-size: .87rem; font-weight: 700; }
.home-location-panel iframe { width: 100%; min-height: 230px; border: 0; border-radius: 8px; display: block; background: #eaf2e6; }
.home-about-contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 19px; }
.home-about-panel, .home-contact-panel { min-width: 0; padding: 22px 25px 20px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.9); box-shadow: 0 12px 30px rgba(24,70,26,.055); }
.home-about-panel, .home-contact-panel { display: flex; flex-direction: column; }
.home-about-panel h2, .home-contact-panel h2 { margin: 0 0 12px; color: var(--ink); font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.home-about-preview { max-height: 174px; overflow: hidden; color: #435248; font-size: .92rem; line-height: 1.58; -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); mask-image: linear-gradient(to bottom, #000 78%, transparent 100%); }
.home-about-preview strong, .home-about-dialog-content > strong { color: var(--ink); font-size: .86rem; font-weight: 800; letter-spacing: .04em; }
.home-about-preview p { margin: 8px 0 0; }
.home-about-more { align-self: flex-start; margin-top: 10px; padding: 0; border: 0; color: var(--green-dark); background: transparent; font: inherit; font-size: .88rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.home-about-more:focus-visible, .home-about-dialog-close:focus-visible { outline: 3px solid rgba(49,158,39,.25); outline-offset: 3px; }
.home-contact-panel > p { margin: 0 0 17px; color: #435248; font-size: .91rem; line-height: 1.55; }
.social-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.social-link { min-height: 58px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #fff; font-size: .82rem; font-weight: 700; text-decoration: none; transition: filter 150ms ease, transform 150ms ease; }
.social-link:hover, .social-link:focus-visible { filter: brightness(.94); transform: translateY(-2px); outline: 3px solid rgba(29,104,22,.23); outline-offset: 2px; }
.social-icon { width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-items: center; font-size: 1.15rem; line-height: 1; }
.social-icon img { width: 100%; height: 100%; display: block; object-fit: contain; filter: brightness(0) invert(1); }
.instagram { background: linear-gradient(135deg, #79559d, #a65b91); }
.facebook { background: #467bb5; }
.whatsapp { background: #4d9c60; }
.email { border-color: #d3ded0; color: #34513a; background: #f7faf6; }

.home-about-dialog { width: min(720px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(12,35,15,.24); font: inherit; }
.home-about-dialog::backdrop { background: rgba(15,28,17,.62); backdrop-filter: blur(3px); }
.home-about-dialog-content { position: relative; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 30px clamp(22px, 5vw, 42px); color: #435248; font-size: .96rem; line-height: 1.7; }
.home-about-dialog-content h2 { margin: 0 38px 20px 0; color: var(--ink); font-size: 1.55rem; font-weight: 800; line-height: 1.2; }
.home-about-dialog-content > strong { display: block; margin: 18px 0 8px; }
.home-about-dialog-content p { margin: 0 0 14px; }
.home-about-dialog-content .home-about-quote { margin: 22px 0; color: var(--green-dark); text-align: center; }
.home-about-dialog-content .home-about-signature { margin: 22px 0 0; color: var(--muted); text-align: center; }
.home-about-signature strong { color: var(--green-dark); letter-spacing: .08em; }
.home-about-dialog-close { position: absolute; top: 15px; right: 16px; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--green-dark); background: #f7faf6; font: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; }

.chat-widget {
  position: fixed;
  z-index: 10;
  right: 22px;
  bottom: 22px;
}

.chat-launcher {
  min-height: 53px;
  padding: 10px 17px 10px 11px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  background: #26a845;
  box-shadow: 0 10px 25px rgba(21, 112, 40, 0.28);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease;
}

.chat-launcher:hover,
.chat-launcher:focus-visible {
  background: #1d9639;
  transform: translateY(-3px);
  outline: none;
}

.chat-launcher:focus-visible,
.chat-close:focus-visible,
.chat-form input:focus-visible,
.chat-form button:focus-visible {
  outline: 3px solid rgba(37, 147, 23, 0.38);
  outline-offset: 3px;
}

.chat-launcher-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
}

.chat-launcher-icon img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.chat-panel {
  width: min(360px, calc(100vw - 32px));
  margin-bottom: 12px;
  padding: 24px;
  border: 1px solid rgba(45, 144, 49, 0.2);
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 16px 44px rgba(22, 65, 31, 0.2);
}

.chat-panel[hidden] {
  display: none;
}

.chat-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  float: right;
  color: #547057;
  background: #eff5ef;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.35rem;
  line-height: 1;
}

.chat-greeting {
  margin: 0 35px 7px 0;
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.chat-panel h2 {
  margin: 0 0 8px;
  font-size: 1.28rem;
  text-align: left;
}

.chat-description {
  margin: 0 0 17px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.chat-form {
  display: grid;
  gap: 10px;
}

.chat-form input {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd8cb;
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  font-size: 0.87rem;
}

.chat-form button {
  padding: 11px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #26a845;
  cursor: pointer;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 700;
}

@media (max-width: 650px) {
  .site-header { min-height: 70px; padding-inline: 16px; }
  .site-brand { gap: 8px; }
  .site-brand img { width: 46px; height: 46px; }
  .site-header nav { gap: 13px; }
  .home-main { width: min(100% - 24px, 560px); padding: 22px 0 38px; gap: 14px; }
  .home-brand-panel { min-height: 140px; padding: 20px 14px; gap: 14px; }
  .home-brand-panel > img { width: 72px; height: 82px; }
  .home-brand-panel > div > span { font-size: clamp(1.55rem, 8vw, 2.2rem); }
  .home-brand-panel small { margin-top: 6px; font-size: .68rem; letter-spacing: .27em; }
  .home-search-panel { padding: 20px 16px; }
  .home-latest-panel { padding: 20px 16px; }
  #latest-properties .property-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-search-form { grid-template-columns: 1fr; gap: 10px; }
  .home-search-button { grid-column: auto; margin-top: 3px; }
  .home-location-panel { grid-template-columns: 1fr; gap: 12px; padding: 15px; }
  .home-location-copy { padding: 8px 6px; }
  .home-location-panel iframe { min-height: 220px; }
  .home-about-contact { grid-template-columns: 1fr; gap: 14px; }
  .home-about-panel, .home-contact-panel { padding: 19px 15px 17px; }
  .home-about-preview { max-height: 150px; }
  .home-contact-panel > p { font-size: .88rem; }
  .social-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .social-link { min-height: 54px; padding-inline: 6px; font-size: .78rem; }

  .chat-widget {
    right: 12px;
    bottom: 12px;
  }

  .chat-launcher {
    padding-right: 13px;
    font-size: 0.77rem;
  }
}

@media (max-width: 390px) {
  #latest-properties .property-cards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .social-link, .home-search-button { transition: none; }
}
