:root {
  --ink: #231a34;
  --muted: #6e657d;
  --paper: #fbf9ff;
  --white: #ffffff;
  --violet: #7657a8;
  --violet-dark: #4e3476;
  --lilac: #ede5f8;
  --rose: #e4707c;
  --peach: #fff0e9;
  --line: #e2dceb;
  --shadow: 0 18px 55px rgba(48, 33, 73, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 85% 4%, #f4e9ff 0, transparent 30rem), var(--paper); }
button, input, select { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 30; padding: 10px 14px; color: white; background: var(--violet-dark); border-radius: 10px; }
.skip-link:focus { top: 12px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px clamp(18px, 5vw, 72px); color: white; background: rgba(35, 26, 52, .96); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px 13px 13px 5px; color: white; background: linear-gradient(135deg, var(--rose), #b95fa2); box-shadow: 0 8px 20px rgba(228, 112, 124, .28); font-family: Georgia, serif; font-size: 1.2rem; }
.updated { color: #ddd2ed; font-size: .82rem; text-align: right; }

main { width: min(1240px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 72px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 46px; align-items: end; }
.hero-copy, .hero-card { min-width: 0; }
.eyebrow { margin: 0 0 10px; color: var(--violet); font-size: .78rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 7vw, 6rem); font-weight: 500; line-height: .91; letter-spacing: -.055em; }
.lead { max-width: 760px; margin: 22px 0 0; color: var(--muted); font-size: clamp(1.02rem, 1.7vw, 1.22rem); line-height: 1.6; }
.criteria { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.criteria span { padding: 8px 11px; border: 1px solid #d9c9eb; border-radius: 999px; color: var(--violet-dark); background: rgba(255,255,255,.78); font-size: .82rem; font-weight: 800; }
.hero-card { display: grid; padding: 28px; border-radius: 26px 26px 26px 8px; color: white; background: linear-gradient(145deg, #3c2a59, #7657a8 72%, #a76491); box-shadow: var(--shadow); }
.hero-card-kicker { color: #e9def7; font-size: .76rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.hero-card > strong { margin-top: 16px; font-family: Georgia, serif; font-size: 4.4rem; font-weight: 500; line-height: .8; }
.hero-card > span:not(.hero-card-kicker) { margin-top: 8px; color: #f5edf9; }
.hero-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.2); }
.hero-breakdown span { display: grid; color: #e9def7; font-size: .76rem; }
.hero-breakdown b { color: white; font-size: 1.15rem; }

.toolbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 42px 0 38px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.88); box-shadow: 0 12px 35px rgba(48, 33, 73, .06); }
.toolbar label { display: grid; gap: 6px; }
.toolbar .search-control { grid-column: span 2; }
.toolbar label > span { color: var(--muted); font-size: .74rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.toolbar input[type="search"], .toolbar select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #d8cee5; border-radius: 11px; color: var(--ink); background: white; }
.toolbar input:focus, .toolbar select:focus { outline: 3px solid rgba(118, 87, 168, .18); border-color: var(--violet); }
.clear-button { min-height: 46px; align-self: end; border: 0; border-radius: 11px; color: var(--violet-dark); background: var(--lilac); cursor: pointer; font-weight: 850; }
.clear-button:hover, .clear-button:focus-visible { background: #dfd0f2; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; }
#visible-count { color: var(--muted); font-weight: 750; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px 22px 22px 8px; background: var(--white); box-shadow: 0 10px 35px rgba(48, 33, 73, .075); }
.photo-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e8e0ec; }
.photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.type-badge, .photo-count { position: absolute; top: 12px; padding: 7px 10px; border-radius: 999px; backdrop-filter: blur(10px); font-size: .74rem; font-weight: 900; }
.type-badge { left: 12px; color: var(--violet-dark); background: rgba(252, 249, 255, .94); }
.photo-count { right: 12px; color: white; background: rgba(35, 26, 52, .72); }
.photo-arrow { position: absolute; top: 50%; width: 38px; height: 46px; border: 0; border-radius: 11px; color: white; background: rgba(35, 26, 52, .68); transform: translateY(-50%); cursor: pointer; font-size: 1.5rem; }
.photo-arrow.previous { left: 10px; }
.photo-arrow.next { right: 10px; }
.photo-arrow[hidden], .photo-count[hidden] { display: none; }
.card-body { padding: 19px; }
.card-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.neighborhood { color: var(--violet); }
.card h3 { margin: 9px 0 11px; font-family: Georgia, serif; font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.price { font-size: 1.4rem; }
.admin { color: var(--muted); font-size: .78rem; }
.facts { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }
.fact { padding: 6px 9px; border-radius: 8px; color: #4a355d; background: #f3edf9; font-size: .8rem; font-weight: 750; }
.description { display: -webkit-box; min-height: 5.6em; margin: 0 0 16px; overflow: hidden; color: var(--muted); font-size: .87rem; line-height: 1.4; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.favorite-group { display: grid; gap: 8px; margin-bottom: 16px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fbf8ff; }
.favorite-group > span { color: var(--muted); font-size: .75rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.favorite-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.favorite-buttons button { min-height: 34px; padding: 6px; border: 1px solid #d8cee5; border-radius: 8px; color: var(--violet-dark); background: white; cursor: pointer; font-size: .72rem; font-weight: 850; }
.favorite-buttons button.is-active { color: white; border-color: var(--violet); background: linear-gradient(135deg, var(--violet-dark), var(--violet)); }
.favorite-buttons button:disabled { cursor: wait; opacity: .65; }
.actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; }
.actions a { min-height: 42px; display: flex; align-items: center; justify-content: center; padding: 9px 10px; border-radius: 10px; text-align: center; text-decoration: none; font-size: .83rem; font-weight: 900; }
.primary { color: white; background: linear-gradient(135deg, var(--violet-dark), var(--violet)); }
.secondary { color: var(--violet-dark); border: 1px solid #d8cee5; background: white; }
.whatsapp { grid-column: 1 / -1; color: #26604b; border-color: #bcd9cc; background: #eff9f4; }
.source { margin: 13px 0 0; color: #8c829a; font-size: .72rem; }
.empty { padding: 58px 20px; text-align: center; border: 1px dashed #c8bad8; border-radius: 20px; background: white; }
.empty > span { color: var(--violet); font-size: 2.5rem; }
.empty h2 { margin: 8px 0 5px; font-family: Georgia, serif; }
.empty p { margin: 0; color: var(--muted); }
.notice { margin: 28px 0 0; padding: 15px 17px; border-left: 4px solid var(--rose); border-radius: 0 12px 12px 0; color: #5a4f64; background: var(--peach); font-size: .88rem; }
footer { padding: 30px 18px; color: #ded3eb; background: var(--ink); text-align: center; font-size: .84rem; }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .hero-card { max-width: 420px; }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .search-control { grid-column: 1 / -1; grid-row: 1; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar { padding-inline: 12px; }
  .updated { max-width: 118px; font-size: .72rem; line-height: 1.25; }
  main { width: min(100% - 24px, 1240px); padding-top: 28px; }
  h1 { font-size: clamp(2.85rem, 15vw, 4.25rem); }
  .lead { margin-top: 16px; }
  .criteria { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .criteria span { flex: 0 0 auto; }
  .hero-card { padding: 22px; }
  .hero-card > strong { font-size: 3.7rem; }
  .toolbar { grid-template-columns: 1fr; margin-top: 28px; padding: 14px; }
  .toolbar .search-control { grid-column: auto; grid-row: auto; }
  .section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .cards { grid-template-columns: 1fr; }
  .photo-wrap { aspect-ratio: 16 / 11; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
