/* properties.css */

/* Import base styles */
@import url('../css/stylesv2.css');

/* Prevent horizontal overflow due to off-canvas sidebar */
html {
  overflow-x: hidden;
}

/* Hide the mobile Filter button by default */
.filter-toggle {
  display: none;
}

/* Global white overlay on all pages */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: -1;
}

/* Ensure mobile nav works under 1000px */
@media (max-width: 1000px) {
  .properties-page .nav-menu nav {
    display: block !important;
  }
}

/* Sticky footer layout */
body.properties-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body.properties-page main {
  flex: 1;
}

/* Layout: sidebar + cards */
.properties-page .property-content {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

/* Sidebar as a frosted card */
.properties-page .filter-sidebar {
  flex: 0 0 280px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
}
.properties-page .filter-sidebar h3 {
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
  color: #023e8a;
  border-bottom: 2px solid rgba(0, 119, 182, 0.5);
  padding-bottom: 0.5rem;
}
.properties-page .filter-group {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.properties-page .filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.properties-page .filter-group h4 {
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
  color: #0077b6;
}
.properties-page .filter-sidebar label {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.properties-page .filter-sidebar input[type="checkbox"] {
  accent-color: #0077b6;
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
}

/* Apply Filters button */
.properties-page .filter-sidebar button {
  width: 100%;
  padding: 0.75rem;
  background-color: #0077b6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 1.5rem;
}
.properties-page .filter-sidebar button:hover {
  background-color: #005f8e;
}

/* Cards: 3-per-row grid */
.properties-page .property-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(250px, 1fr));
  gap: 2rem;
  justify-items: center;
}

/* Square cards (equal height/width) */
.properties-page .property {
  width: 100%;
  max-width: 250px;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: transform 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}
.properties-page .property:hover {
  transform: translateY(-5px);
}
.properties-page .property img {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  border-radius: 10px;
}
.properties-page .property h3 {
  margin: 0.5rem 0;
  font-size: 1.25rem;
  color: #0077b6;
}
.properties-page .property p {
  margin: 0;
  font-size: 1rem;
  color: #555;
  flex-grow: 1;
}

/* Responsive: 2 columns on tablets */
@media (max-width: 1366px) {
  .properties-page .property-content {
    flex-direction: column;
    gap: 1.5rem;
  }
  .properties-page .filter-sidebar {
    position: relative;
    top: auto;
    max-height: none;
    margin-bottom: 1.5rem;
  }
  .properties-page .property-list {
    grid-template-columns: repeat(2, minmax(200px, 1fr));
  }
}

/* Mobile: drawer-style filter sidebar & single-column grid */
@media (max-width: 768px) {
  /* Show the Filter toggle button */
  .filter-toggle {
    display: inline-block;
    background: #0077b6;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  /* Off-canvas sidebar using transform */
  .properties-page .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    height: 100%;
    width: 280px;
    z-index: 2000;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0,0,0,0.2);
  }

  /* Slide in when body has filters-open */
  body.filters-open .filter-sidebar {
    transform: translateX(0);
  }

  /* Dim property grid while filter is open */
  body.filters-open .properties-page .property-list {
    opacity: 0.4;
    pointer-events: none;
  }

  /* Single-column cards */
  .properties-page .property-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}