* {
  box-sizing: border-box;
}

:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #202124;
  --muted: #727272;
  --line: #e5e5e2;
  --accent: #222222;
  --radius: 14px;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

/* Espacios reservados según el boceto */
.nav-space {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.filters-space {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.filters-inner {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.filter-field {
  min-width: 0;
}

.filter-field label {
  display: block;
  margin: 0 0 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.filter-field select {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.filter-field select:hover {
  border-color: #c8c8c8;
}

.filter-field select:focus {
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(0,0,0,.05);
}

.results-wrap {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 38px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 22px;
}

.property-card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.property-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}

.photo-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.photo {
  position: relative;
  touch-action: pan-y;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ddd;
}

.photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .3s ease;
}

.property-card:hover .photo img {
  transform: scale(1.025);
}

.photo-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #222;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  z-index: 2;
}

.photo-button:hover {
  background: #fff;
}

.photo-button.prev {
  left: 10px;
}

.photo-button.next {
  right: 10px;
}

.photo-counter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.55);
  font-size: 12px;
  z-index: 2;
}

.card-body {
  padding: 15px 16px 17px;
}

.title {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
}

.location {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
  margin-bottom: 15px;
}

.spec {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #444;
  font-size: 12px;
}

.spec-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: #555;
}

.spec span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #555;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 13px;
}

.price {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin-top: 38px;
}

.page-button {
  min-width: 36px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-size: 13px;
}

.page-button:hover {
  background: #f0f0ee;
}

.page-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-arrow {
  font-size: 18px;
}

.footer-space {
  height: 180px;
  background: #fff;
  border-top: 1px solid var(--line);
}

/* Tablet */
@media (max-width: 1050px) {
  .results-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 760px) {
  .nav-space {
    height: 64px;
  }

  .filters-space {
    padding: 14px 0;
  }

  .filters-inner {
    width: min(100% - 28px, 560px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 10px;
  }

  .filter-field label {
    font-size: 11px;
    margin-bottom: 5px;
  }

  .filter-field select {
    height: 40px;
    font-size: 12px;
  }

  .results-wrap {
    width: min(100% - 28px, 560px);
    padding-top: 24px;
  }

  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .card-body {
    padding: 12px;
  }

  .title {
    font-size: 15px;
  }

  .location {
    font-size: 12px;
    margin-bottom: 11px;
  }

  .specs {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 11px;
  }

  .price {
    font-size: 16px;
  }

  .photo-button {
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 430px) {
  .results-wrap {
    width: calc(100% - 20px);
  }

  .filters-inner {
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .photo {
    aspect-ratio: 16 / 10;
  }
}


/* ===== Página individual de propiedad ===== */

.property-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.property-heading {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}

.property-heading h1 {
  margin: 0 0 7px;
  font-size: clamp(27px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.property-location {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.property-price-block {
  text-align: right;
  flex: 0 0 auto;
}

.property-type {
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #555;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.property-price-block strong {
  display: block;
  font-size: 25px;
  letter-spacing: -.025em;
}

.gallery-section {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 0;
}

.main-gallery {
  position: relative;
  touch-action: pan-y;
  width: 100%;
  height: min(68vh, 690px);
  min-height: 390px;
  overflow: hidden;
  border-radius: 16px;
  background: #ddd;
}

.main-gallery > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  cursor: zoom-in;
}

.gallery-arrow,
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.93);
  color: #222;
  display: grid;
  place-items: center;
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(0,0,0,.18);
  z-index: 2;
}

.gallery-arrow:hover,
.lightbox-arrow:hover {
  background: #fff;
}

.gallery-prev {
  left: 18px;
}

.gallery-next {
  right: 18px;
}

.expand-gallery {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: rgba(0,0,0,.48);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  z-index: 2;
}

.expand-gallery:hover {
  background: rgba(0,0,0,.68);
}

.gallery-counter {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.52);
  color: #fff;
  font-size: 12px;
}

.thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 2px 3px;
}

.thumbnail {
  flex: 0 0 88px;
  height: 66px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 9px;
  overflow: hidden;
  background: #ddd;
  cursor: pointer;
}

.thumbnail.active {
  border-color: #222;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.property-info,
.description-section {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.property-info {
  padding: 40px 0 20px;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-spec {
  min-height: 104px;
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-right: 1px solid var(--line);
}

.detail-spec:last-child {
  border-right: 0;
}

.detail-spec-icon {
  width: 30px;
  height: 30px;
  color: #555;
  flex: 0 0 30px;
}

.detail-spec-icon svg {
  width: 100%;
  height: 100%;
}

.detail-spec strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.detail-spec span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.description-section {
  padding: 28px 0 55px;
  max-width: 900px;
  margin-left: max(24px, calc((100% - 1240px) / 2));
  margin-right: auto;
}

.description-section h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.description-section p {
  margin: 0;
  white-space: pre-line;
  color: #555;
  font-size: 15px;
  line-height: 1.75;
  max-width: 850px;
}

/* Visor de imagen a pantalla completa */
.no-scroll {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.88);
  padding: 50px 80px;
}

.lightbox.open {
  display: flex;
}

.lightbox > img {
  max-width: 92vw;
  touch-action: pan-y;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.lightbox-arrow {
  background: rgba(255,255,255,.92);
  position: fixed;
}

.lightbox-prev {
  left: 25px;
}

.lightbox-next {
  right: 25px;
}

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,.5);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
}

@media (max-width: 900px) {
  .property-heading {
    align-items: start;
    flex-direction: column;
    padding-top: 26px;
  }

  .property-price-block {
    text-align: left;
  }

  .spec-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-spec:nth-child(3n) {
    border-right: 0;
  }

  .detail-spec {
    border-bottom: 1px solid var(--line);
  }

  .detail-spec:nth-last-child(-n + 3) {
    border-bottom: 0;
  }
}

@media (max-width: 650px) {
  .property-heading,
  .gallery-section,
  .property-info,
  .description-section {
    width: calc(100% - 28px);
  }

  .property-heading h1 {
    font-size: 28px;
  }

  .main-gallery {
    height: 58vw;
    min-height: 260px;
    border-radius: 12px;
  }

  .gallery-arrow,
  .lightbox-arrow {
    width: 40px;
    height: 40px;
    font-size: 26px;
  }

  .gallery-prev {
    left: 10px;
  }

  .gallery-next {
    right: 10px;
  }

  .expand-gallery {
    right: 10px;
    top: 10px;
  }

  .gallery-counter {
    left: 10px;
    bottom: 10px;
  }

  .spec-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-spec {
    border-right: 1px solid var(--line);
  }

  .detail-spec:nth-child(2n) {
    border-right: 0;
  }

  .detail-spec:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .lightbox {
    padding: 55px 12px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}


/* ===== Navegación y footer de la inmobiliaria ===== */

.site-nav {
  height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 10;
}

.nav-inner {
  width: min(1240px, calc(100% - 48px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  text-decoration: none;
  color: #fff;
  flex: 0 0 44px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #222;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.nav-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.icon-link {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #3f3f3f;
  text-decoration: none;
  transition: background .16s ease, transform .16s ease;
}

.icon-link:hover {
  background: #f0f0ee;
  transform: translateY(-1px);
}

.icon-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer {
  min-height: 190px;
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

.footer-inner {
  width: min(1240px, calc(100% - 48px));
  min-height: 190px;
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(180px, .8fr) auto;
  align-items: center;
  gap: 45px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
}

.footer-logo .brand-mark {
  width: 46px;
  height: 46px;
}

.footer-brand h2 {
  margin: 0 0 7px;
  font-size: 17px;
}

.footer-brand p {
  max-width: 510px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.footer-address {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.footer-label {
  display: block;
  margin-bottom: 6px;
  color: #999;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
}

.footer-address p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 5px;
}

.footer-icon {
  width: 39px;
  height: 39px;
}

@media (max-width: 760px) {
  .site-nav {
    height: 68px;
  }

  .nav-inner,
  .footer-inner {
    width: calc(100% - 28px);
  }

  .nav-brand-name {
    font-size: 13px;
  }

  .nav-actions {
    gap: 2px;
  }

  .nav-actions .icon-link {
    width: 31px;
    height: 31px;
  }

  .nav-actions .icon-link svg {
    width: 18px;
    height: 18px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 30px 0;
  }

  .footer-address {
    padding-left: 0;
    border-left: 0;
  }

  .footer-social {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    gap: 8px;
  }

  .brand-logo {
    width: 38px;
    flex-basis: 38px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 11px;
  }

  .nav-brand-name {
    max-width: 145px;
    line-height: 1.1;
  }

  .nav-actions .icon-link:nth-child(4),
  .nav-actions .icon-link:nth-child(5) {
    display: none;
  }
}


.operation-badge {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0f0ee;
  color: #555;
  font-size: 10px;
  font-weight: 700;
}

.no-photo {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #888;
  font-size: 12px;
}


.site-logo-image {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  border-radius: 10px;
}

.footer-logo .site-logo-image {
  width: 46px;
  height: 46px;
}

.dynamic-brand-logo {
  overflow: hidden;
}

.public-data-error,
.empty-public-state {
  grid-column: 1 / -1;
  width: 100%;
  padding: 70px 24px;
  text-align: center;
  color: #555;
}

.public-data-error h2,
.empty-public-state h2 {
  margin: 0 0 10px;
  color: #222;
}

.public-data-error p,
.empty-public-state p {
  margin: 0;
  color: #777;
}
