/* Reusable UI components: buttons, cards, forms, modal, pagination */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.92rem; border: 1.5px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-lg { padding: 16px 30px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: var(--ink-900); }
.btn-accent:hover { background: var(--accent-dark); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* Property card */
.property-card {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.property-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.property-media { position: relative; height: 220px; overflow: hidden; background: var(--ink-100); }
.property-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.property-card:hover .property-media img { transform: scale(1.06); }
.property-badge {
  position: absolute; top: 14px; left: 14px;
  background: var(--white); color: var(--primary-dark);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 6px 10px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.property-badge.accent { background: var(--accent); color: var(--ink-900); }
.property-body { padding: 22px; }
.property-price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--primary-dark); }
.property-title { margin: 8px 0 6px; font-size: 1.1rem; }
.property-location { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--text-muted); }
.property-location svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--support); }
.property-meta { display: flex; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ink-100); font-size: 0.82rem; color: var(--text-muted); }
.property-meta span { display: inline-flex; align-items: center; gap: 5px; }
.property-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

/* Category tiles */
.category-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.category-tile {
  position: relative; height: 190px; border-radius: var(--radius);
  overflow: hidden; display: flex; align-items: flex-end; padding: 18px;
  color: var(--white); font-weight: 700; font-size: 1.02rem;
}
.category-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; transition: transform .4s; }
.category-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,42,94,0) 30%, rgba(10,42,94,0.82)); z-index: 1; }
.category-tile span { position: relative; z-index: 2; }
.category-tile:hover img { transform: scale(1.08); }

/* Event card */
.event-card { display: grid; grid-template-columns: 96px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--ink-100); border-radius: var(--radius); overflow: hidden; }
.event-date { background: var(--primary); color: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 8px; }
.event-date strong { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; }
.event-date small { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em; margin-top: 6px; }
.event-body { padding: 20px 22px; }
.event-body h3 { margin-bottom: 6px; }
.event-meta { font-size: 0.82rem; color: var(--support); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.event-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* Forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; font-size: 0.82rem; margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-alt); transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--blue-100); background: var(--white);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-message { margin-top: 14px; font-size: 0.9rem; font-weight: 600; }
.form-message.success { color: var(--support); }
.form-message.error { color: #b3261e; }

/* Finder search card */
.finder { position: relative; z-index: 5; margin-top: -64px; }
.finder-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 26px; }
.finder-tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.finder-tab { padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: 0.85rem; background: var(--surface-alt); color: var(--text-muted); }
.finder-tab.active { background: var(--primary); color: var(--white); }
.finder-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 14px; }
.finder-field { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 4px 14px; background: var(--surface-alt); }
.finder-field svg { width: 18px; height: 18px; color: var(--support); flex-shrink: 0; }
.finder-field input, .finder-field select { border: 0; background: transparent; width: 100%; padding: 11px 0; }
.finder-field input:focus, .finder-field select:focus { outline: none; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination button { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 700; }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: var(--white); }
.pagination button:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(10,20,40,0.72); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--radius); width: min(760px, 100%); max-height: 90vh; overflow-y: auto; position: relative; }
.modal-media { height: 280px; }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-body { padding: 28px; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; background: var(--white); border: 0; display: grid; place-items: center; box-shadow: var(--shadow-sm); z-index: 3; }

/* Value / feature rows */
.feature-list { border-top: 1px solid var(--ink-100); }
.feature-row { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--ink-100); }
.feature-row .icon-badge { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-100); color: var(--primary); display: grid; place-items: center; }
.feature-row .icon-badge svg { width: 22px; height: 22px; }
.feature-row h3 { margin-bottom: 4px; font-size: 1.02rem; }
.feature-row p { font-size: 0.92rem; }

@media (max-width: 960px) {
  .property-grid, .category-grid, .event-grid { grid-template-columns: repeat(2, 1fr); }
  .finder-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .property-grid, .category-grid, .event-grid, .finder-grid, .field-row { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 1fr; }
  .event-date { flex-direction: row; gap: 10px; padding: 12px; }
}
