/* Portal público de propiedades (3.5d, #256; docs/61). Se carga después de publico.css, que define
   la identidad Fuego Sereno, la barra superior y el pie. Las páginas las renderiza la API en el
   dominio del catálogo; este archivo y las fuentes se sirven desde el sitio público. Sin JavaScript. */

/* ---------- Barra superior ---------- */
.lang-switch { display: flex; flex: none; gap: 2px; }
.lang-switch a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 9px;
  border-radius: 999px;
  color: rgb(255 255 255 / 78%);
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
.lang-switch a:hover { color: #fff; background: rgb(255 255 255 / 8%); }
.lang-switch a[aria-current="true"] { color: var(--green-deep); background: var(--mint); }
.site-top .menu { display: none; }

/* ---------- Catálogo ---------- */
.catalog-main { padding-top: 24px; padding-bottom: 56px; }
.catalog-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.catalog-head h1,
.empty h1 {
  margin: 0;
  color: var(--green-deep);
  font: 700 clamp(1.45rem, 4vw, 2.1rem)/1.15 var(--display);
  letter-spacing: -0.02em;
}
.count { margin: 0; color: var(--muted); font-weight: 600; }

.filters {
  margin: 18px 0 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.filters-main,
.filters-grid { display: grid; gap: 12px; }
.filters-main { grid-template-columns: 1fr 1fr; align-items: end; }
.filters-main .field:nth-child(2) { grid-column: 1 / -1; order: -1; }
.filters-main .button { grid-column: 1 / -1; min-height: 44px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field span { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.field select,
.field input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.field select:focus-visible,
.field input:focus-visible { outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.92rem; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.filters-more { margin-top: 12px; }
.filters-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
}
.filters-more[open] summary { margin-bottom: 8px; }
.filters-grid { grid-template-columns: 1fr 1fr; }
.filters-grid .field:first-child { grid-column: 1 / -1; }
.clear { display: inline-block; margin-top: 10px; font-size: 0.9rem; font-weight: 600; }

.sorts { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.sorts a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  text-decoration: none;
}
.sorts a[aria-current="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green-deep); font-weight: 600; }

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card a:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card-photo { position: relative; aspect-ratio: 4 / 3; background: var(--green-soft); }
.card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.no-photo { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 0.9rem; }
.photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgb(0 33 22 / 78%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}
.card-body { display: grid; gap: 2px; padding: 14px 16px 16px; }
.card-body p,
.card-body h2,
.card-body h3 { margin: 0; }
.price { color: var(--green-deep); font: 700 1.3rem/1.2 var(--display); }
.offer { color: var(--gold); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.card .place { font: 600 1rem/1.35 var(--sans); overflow-wrap: anywhere; }
.facts { color: var(--muted); font-size: 0.9rem; }

.empty { display: grid; justify-items: start; gap: 12px; margin: 28px 0; }
.empty p { margin: 0; color: var(--muted); }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 28px; }
.pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 600;
  text-decoration: none;
}
.pagination span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Página de una unidad ---------- */
/* La barra fija de contacto (debajo de 1000 px) no tapa el final del pie legal. */
.property main { padding-bottom: 24px; }
.property .site-footer .bar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.crumbs { padding: 16px 0 8px; font-size: 0.9rem; font-weight: 600; }
.crumbs a::before { content: "← "; }
.property-grid { display: grid; gap: 20px; }
.property-main,
.property-aside { min-width: 0; }

.gallery { position: relative; margin: 0 -16px; }
.gallery ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  list-style: none;
}
.gallery li { flex: 0 0 88%; scroll-snap-align: center; }
.gallery li:only-child { flex-basis: 100%; }
.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--green-soft);
}
.gallery .photo-total { margin: 8px 16px 0; color: var(--muted); font-size: 0.85rem; }

.property-head { margin-top: 18px; }
.property-head h1 {
  margin: 4px 0 2px;
  color: var(--green-deep);
  font: 700 clamp(1.4rem, 4.2vw, 2rem)/1.2 var(--display);
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}
.property-head .place { margin: 0; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.property-main section { margin-top: 24px; }
.property-main h2 { margin: 0 0 10px; font: 700 1.1rem/1.3 var(--display); color: var(--ink); }
.property-main p { margin: 0 0 6px; overflow-wrap: anywhere; }
.features ul,
.amenities ul,
.services ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.features li,
.amenities li,
.services li {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
}
.features li { border-color: transparent; background: var(--green-soft); color: var(--green-deep); font-weight: 600; }

.contact-box {
  display: grid;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}
.contact-box p { margin: 0; }
.price.big { font-size: 1.8rem; }
.also p { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.also ul { margin: 4px 0 0; padding-left: 18px; }
.button.whatsapp { width: 100%; background: var(--green); color: #fff; box-shadow: var(--shadow-2); }
.button.whatsapp:hover { background: var(--green-hover); }
.contact-pending { color: var(--muted); }
.disclaimer { color: var(--muted); font-size: 0.85rem; }
.meta { color: var(--muted); font-size: 0.8rem; }

.similar { margin-top: 40px; }
.similar h2 { margin: 0; color: var(--green-deep); font: 700 1.3rem/1.2 var(--display); }

.sticky-contact {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 -8px 24px -16px rgb(0 0 0 / 40%);
}
.sticky-contact .button { width: auto; min-height: 44px; padding: 10px 14px; font-size: 0.88rem; white-space: nowrap; }
.sticky-price { color: var(--green-deep); font: 700 1.1rem/1.2 var(--display); white-space: nowrap; }

@media (min-width: 560px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters-grid .field:first-child { grid-column: auto; }
}

@media (min-width: 720px) {
  .site-top .menu { display: flex; }
  .site-top .menu .section-link { display: inline; }
  .topbar { justify-content: flex-start; }
  .topbar .menu { margin-left: auto; }
  .filters-main { grid-template-columns: 1fr 1.4fr 1fr auto; }
  .filters-main .field:nth-child(2) { grid-column: auto; order: 0; }
  .filters-main .button { grid-column: auto; }
  .gallery { margin: 0; }
  .gallery ul { padding: 0; }
  .gallery li { flex-basis: 72%; }
  .gallery .photo-total { margin-left: 0; }
}

@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .property-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 32px; }
  .property-aside { position: sticky; top: calc(var(--top) + 16px); }
  .sticky-contact { display: none; }
  .property main { padding-bottom: 56px; }
  .property .site-footer .bar { padding-bottom: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .card a { transition: none; }
  .card a:hover { transform: none; }
}
