/* =========================================================
   Search Page Styles (scoped)
   ========================================================= */

/* Page-level scope (placeholder for future overrides) */
.search-page {
  /* intentionally empty */
}

/* Results meta */
.search-page .results-meta {
  margin-bottom: 1.25rem;
}

.search-page .results-summary {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.search-page .results-sort-note {
  font-size: 0.9rem;
}

.search-page .sort-hint {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #555;
}

/* Property cards */
/* Kill article-style section spacing on search UI */
.search-page section {
  margin-bottom: 0;
}
.search-page .search-header {
  margin-bottom: 0.1rem;
}

.search-page .results-toolbar {
  margin-bottom: 0.1rem;
}
.property-card {
  border: 1px solid #1f2933; /* light neutral */
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
  background: #e5e5e5;
  margin-bottom: 16px;
  transition: box-shadow 0.2s ease;
  position: relative;
}

.card-save {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 4;
}
.card-badges-left {
  position: absolute;
  top: 10px;
  left: 10px;

  display: flex;
  flex-direction: column;
  gap: 6px;

  z-index: 3;
}

.card-save .icon {
  font-size: 18px;
}

.card-save.is-saved .icon {
  color: #f5b301;
}
@media (max-width: 640px) {
  .property-card {
    padding: 0.75rem;
  }
}
.property-title-link {
  color: inherit;
  text-decoration: none;
}

.property-title-link:hover {
  text-decoration: underline;
}
.property-card-image-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.property-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.property-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f3f4f6;
  overflow: hidden;
}

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-badge {
  position: static; /* or just remove position entirely */
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
}
.card-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555;
}

.card-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  opacity: 0.85;
}
.property-card-body {
  padding: 10px 12px;
}
.property-card-link {
  color: inherit;
  text-decoration: none;
  display: block;
}
.property-price {
  font-size: 1.1rem;
  font-weight: 700;
}

.property-price span {
  font-weight: 400;
  font-size: 0.85rem;
  color: #6b7280;
}

.property-title {
  margin: 6px 0 4px;
  font-size: 1rem;
  font-weight: 600;
}

.property-location {
  font-size: 0.85rem;
  color: #6b7280;
}

.property-reasons {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #6b7280;
}

.property-cta {
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2563eb;
}
.property-meta {
  margin-top: 4px;
  font-size: 0.85rem;
  color: #4b5563;
}

.property-amenities {
  margin-top: 6px;
  font-size: 1rem;
  color: #374151;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.property-amenities span {
  margin-right: 6px;
  cursor: default;
}
.property-availability {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  color: #2b7a2b; /* calm green */
}

.property-availability.available-from {
  color: #555;
}
.availability-next {
    font-size: 0.85rem;
    color: #666;.
    margin-top: 2px;
}
/* Filter checkbox normalization */
.filter-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  transform: none; /* prevent inherited scaling */
  margin-right: 6px;
  vertical-align: middle;
}
/* --------------------------------
   A) Card separation
---------------------------------- */
/* Card spacing handled by margin only */
.search-page .property-card {
  margin-bottom: 1rem;
}
.search-page .property-location {
  color: #555;
}

.search-page .property-price {
  font-weight: 600;
}

.search-page .property-distance {
  font-size: 0.9rem;
  color: #666;
}

/* Badges */
.search-page .badge {
  background-color: #f0f4f8;
  color: #333;
}

.search-page .badge-best {
  background-color: #e8f1ff;
}

.search-page .badge-price {
  background-color: #edf7ed;
}

.search-page .badge-distance {
  background-color: #fff3e0;
}

@media (max-width: 640px) {
  .search-header-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .search-header-fields > * {
    flex: 1 1 calc(50% - 0.5rem);
  }

  .search-header-fields .search-field[data-field="location"] {
    flex: 1 1 100%;
  }
}
@media (max-width: 640px) {
  .search-field {
    padding: 0.55rem 0.65rem;
    font-size: 0.85rem;
  }
}

/* Load more */
.search-page .load-more-wrap button {
  padding: 0.6rem 1rem;
  font-size: 1rem;
}
.search-page .search-submit {
  background: var(--brand-green);
  color: #fff;
  font-weight: 600;
  border-radius: 8px;
}

.search-page .search-submit:hover {
  background: #1f6a3f; /* slightly darker */
}

/* --------------------------------
   B) Search form polish
---------------------------------- */
.filters-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;

  width: 100%;
  max-width: 420px;

  background: #fff;
  z-index: 1000;

  display: none;
  flex-direction: column;
}
.filters-panel form {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
/* Base sizing for filter inputs */
.filters-panel input,
.filters-panel select {
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  min-height: 44px; /* Apple / Google recommended tap size */
}
.filter-row select {
  width: 100%;
}
.filter-group {
  margin-bottom: 1.25rem;
}
.filter-group label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
/* Slightly larger on mobile */
@media (max-width: 480px) {
  .filters-panel input,
  .filters-panel select {
    font-size: 1.05rem;
    min-height: 48px;
  }
}
.filters-footer {
  position: sticky;
  bottom: 0;

  display: flex;
  gap: 0.75rem;

  padding: 1rem;
  background: #fff;
  border-top: 1px solid #e5e5e5;

  z-index: 1;
}
.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 1rem;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;

  position: sticky;
  top: 0;
  z-index: 1;
}
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.option-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.option-row button {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
}

.option-row button.active {
  background: #000;
  color: #fff;
}
.compact-select {
  max-width: 220px;
}
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 480px) {
  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  text-align: left;
  justify-content: flex-start;
}
.filters-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.filters-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.btn-primary {
  flex: 1;
  padding: 0.75rem 1rem;
  font-weight: 600;
}
.filters-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999;

  display: none;
}
.btn-secondary {
  padding: 0.75rem 1rem;
}
body.filters-open {
  overflow: hidden;
}
@media (min-width: 768px) {
  .filters-panel {
    width: 420px;
  }
}
.filters-panel {
  transform: translateX(100%);
  transition: transform .25s ease;
}

body.filters-open .filters-panel {
  transform: translateX(0);
}
/* --------------------------------
   Compact search form layout
---------------------------------- */

.search-page #search-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 500;
}

.search-page #search-form fieldset {
  margin-top: 0.5rem;
  padding: 0.5rem;
}

.search-page #search-form legend {
  font-size: 0.9rem;
  font-weight: 600;
}
.photo-count-pill {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
  align-self: flex-start;
}
.card-badges-left > * {
  align-self: flex-start;
}
/* --------------------------------
   C) Desktop results layout
---------------------------------- */
.search-page .search-context {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
}
@media (max-width: 480px) {
  .search-page .search-context {
    padding: 0 1.75rem;
  }
}
@media (min-width: 900px) {
  .search-page .results-bar {
    grid-column: 1 / -1;
  }
}
@media (min-width: 900px) {
  .search-page #search-results > :not(.property-card) {
    grid-column: 1 / -1;
  }
}
@media (min-width: 900px) {
  .search-page #search-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .search-page .property-card {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }
  .search-page #search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
  }

  .search-layout h1 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
  }
}
@media (min-width: 900px) {
  .search-page .results-toolbar {
    justify-content: space-between;
    align-items: center;
  }

  .search-page .results-toolbar label {
    margin-left: auto;
  }
}
.results-toolbar {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}
.search-page .results-toolbar {
  margin-top: 0;
  padding: 0.5rem 0.75rem;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .search-intro {
    display: none;
  }
  .search-page .results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;

    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
  }
  /* Full-width fields */
  .search-page #search-form fieldset,
  .search-page #search-form button {
    grid-column: 1 / -1;
  }
}
/* --------------------------------
   D) Filters UX polish
---------------------------------- */

.search-page fieldset {
  border-radius: 6px;
  background: #fafafa;
}

/* --------------------------------
   E) saved searches
---------------------------------- */
.saved-searches {
  margin-bottom: 1rem;
}

.saved-search-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.saved-search-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.saved-search-list button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}
/* -------------------------------------
   Save Search (inline)
------------------------------------- */

.save-search-inline {
  margin-left: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1;
  white-space: nowrap;

  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;

  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.save-search-inline:hover {
  background: #eef2f7;
  border-color: #94a3b8;
}

.save-search-inline:active {
  transform: translateY(1px);
}

.card-save.disabled {
  opacity: 0.35;
  cursor: default;
}

.card-save.disabled:hover {
  opacity: 0.5; /* optional */
}
.no-results-card {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 24px;
  margin: 24px 0;
  background: #fafafa;
}

.no-results-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 18px;
}

.no-results-sub {
  margin-bottom: 12px;
  color: #555;
}

.no-results-tips {
  margin: 0 0 16px 20px;
  color: #444;
}

.no-results-tips li {
  margin-bottom: 6px;
}

.no-results-actions {
  margin-top: 16px;
}
/* Results context bar */
.results-bar {
  background: #f8f9f8;
  border: 1px solid #e3e5e3;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #444;

  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
}
.results-sort select {
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
}
.results-sort {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.results-bar-left {
  font-weight: 600;
}

.results-bar-right {
  font-size: 0.8rem;
  color: #555;
}

.results-bar-hint {
  width: 100%;
  font-size: 0.75rem;
  color: #666;
}
@media (max-width: 640px) {
  .results-bar {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }

  .results-bar-hint {
    display: none;
  }
}
