:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --primary: #85adff;
  --primary-dark: #558dff;
  --text: #1f2937;
  --muted: #64748b;
  --border: #dbe2ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-width: 0;
}

.container {
  width: min(1200px, 100%);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 2.5rem 0;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 3rem);
}

.site-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

.search-bar {
  margin: -2rem auto 1.5rem;
  max-width: 720px;
}

#searchInput {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 1rem;
  background: white;
}

.listings {
  display: grid;
  /* 320px é o padrão de 'card premium'. Nem muito fino, nem muito largo */
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2; 
  overflow: hidden;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.card-media img {
  width: 100%;
  height: 100%;
  /* Mantém a proporção e corta o excesso */
  object-fit: cover; 
  /* Garante que o centro da foto sempre apareça */
  object-position: center; 
  display: block;
}

.card-content {
  padding: 1rem;
  display: grid;
  gap: 0.5rem;
  flex: 1;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

.card-description {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.card-price-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-price {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.card-price strong {
  font-size: 1.3rem;
}

.card-price small {
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.card-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.feature {
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  text-align: center;
  color: var(--text);
  font-size: 0.85rem;
}

.feature strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.card-location {
  display: grid;
  gap: 0.15rem;
}

.card-location .location-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
}

.card-location .location-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.details-button {
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.status {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: white;
}

.status.available {
  background: #16a34a;
}

.status.rented {
  background: #ef4444;
}

.loading,
.error-message,
.empty-message {
  grid-column: 1 / -1;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
}

.footer {
  padding: 1.5rem 0 2rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 640px) {
  .card-details {
    grid-template-columns: 1fr;
  }
}

a {
  text-decoration: none;
}