/* ===================== 
   SEARCH RESULTS WRAPPER
===================== */
#pac-search-results {
  margin: 20px auto;
  padding: 0 15px;
  max-width: 1200px;
  font-family: 'Arial', sans-serif;
}

/* Page Title */
.page-title {
  font-size: 2em;
  margin-bottom: 20px;
  text-align: center;
}

/* Overall layout for results area using flex */
#pac-results-wrapper {
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

/* Listings and Map columns */
#pac-listings,
#pac-map {
  padding: 10px;
}
#pac-listings {
  flex: 1 1 50%;
}
#pac-map {
  flex: 1 1 50%;
  min-height: 400px;
  height: 300px;
  position: relative;
  overflow: hidden;
}

/* Card container */
.pac-property-card {
  background: #fff;
  margin: 8px 0;
  border-radius: 35px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}
.pac-property-card:hover {
  transform: translateY(-3px);
}

/* Card structure in a row: image left, details right */
.pac-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border-radius: 15px;
  overflow: hidden; /* Ensures the media doesn't pop out of corners */
}

/* Media: left column */
.pac-card-media {
  flex: 0 0 40%;
  max-width: 40%;
  overflow: hidden;
}
.pac-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Details: right column */
.pac-card-details {
  flex: 1 1 60%;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Title styling */
.pac-card-title {
  margin: 0 0 8px;
  font-size: 1.2em;
}
.pac-card-title a {
  text-decoration: none;
  color: #2a2a2a;
  transition: color 0.2s ease;
}
.pac-card-title a:hover {
  color: #0056b3;
}

/* Address and Category list */
.pac-card-info {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.pac-card-info li {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 4px;
}

/* Units list */
.pac-unit-list {
  padding-top: 8px;
  list-style: disc;
  margin: 0;
  padding-left: 30px; /* Increased left padding */
}
.pac-unit-list li {
  margin-bottom: 4px; /* Reduced margin between list items */
  font-size: 0.9em;
  color: #555;
}

/* New Unit List Row */
.pac-unit-row {
  width: 100%;
}
.pac-unit-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Creates a 2x2 grid */
  gap: 10px; /* Reduced the gap between columns */
  padding-left: 30px; /* Consistent left padding */
  list-style: disc; /* Ensures bullet points are displayed */
}
.pac-unit-list li {
  font-size: 0.9em;
  color: #555;
  list-style-type: disc; /* Ensures bullets are shown */
}

/* ========================================
   Tablet Responsive Styles (769px - 1024px)
======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
  #pac-listings,
  #pac-map {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .pac-card {
    flex-direction: column;
    margin: 5px 0;
  }
  .pac-card-media {
    max-width: 100%;
    height: 200px;  /* Reduced image height */
  }
  .pac-card-details {
    padding: 10px;
    padding-left: 15px; /* Added left padding */
  }
  .pac-card-title {
    margin-bottom: 6px;
    font-size: 1.1em;
  }
  .pac-card-info {
    margin: 0;
    padding: 0 0 0 15px; /* Added left padding */
    font-size: 0.9em;
  }
  .pac-unit-row {
    padding-left: 15px; /* Added left padding */
  }
  .pac-unit-list {
    padding-left: 20px;
    grid-template-columns: 1fr 1fr; /* Two columns on tablet */
  }
}

/* ========================================
   Mobile Responsive Styles (up to 768px)
======================================== */
@media (max-width: 768px) {
  #pac-results-wrapper {
    display: block;
  }
  #pac-listings,
  #pac-map {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .pac-card {
    flex-direction: column;
    margin: 5px 0;
  }
  .pac-card-media {
    max-width: 100%;
    height: 180px; /* Reduced image height */
  }
  .pac-card-details {
    padding: 5px;
    padding-left: 10px; /* Added left padding */
  }
  .pac-card-title {
    margin: 0 0 4px;
    font-size: 1.1em;
  }
  .pac-card-info {
    margin: 0;
    padding: 0 0 0 10px; /* Added left padding */
    font-size: 0.85em;
  }
  .pac-unit-row {
    padding-left: 10px; /* Added left padding */
  }
  .pac-unit-list {
    padding-top: 4px;
    padding-left: 15px;
    grid-template-columns: 1fr; /* Single column for mobile */
  }
  .pac-unit-list li {
    margin-bottom: 2px;
  }
}

/* ========================================
   Portrait Tablet Responsive Styles (600px - 768px, Portrait Orientation)
======================================== */
@media (min-width: 600px) and (max-width: 768px) and (orientation: portrait) {
  /* Increase text sizes for a better reading experience */
  .pac-card-title {
    font-size: 1.3em;
  }
  .pac-card-info,
  .pac-card-info li {
    font-size: 1em;
  }
  .pac-unit-list li {
    font-size: 1em;
  }
  /* Optionally, adjust the page title if needed */
  .page-title {
    font-size: 2.2em;
  }
}

/* Error message styling */
.error {
  color: red;
  text-align: center;
  font-size: 1em;
  font-weight: bold;
}

/* No Results Styles */
.pac-no-results {
  text-align: center;
  padding: 60px 20px;
  max-width: 600px;
  margin: 40px auto;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
}

.pac-no-results-icon {
  color: #6c757d;
  margin-bottom: 24px;
}

.pac-no-results-icon svg {
  width: 64px;
  height: 64px;
}

.pac-no-results-title {
  font-size: 28px;
  font-weight: 600;
  color: #495057;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.pac-no-results-message {
  font-size: 18px;
  color: #6c757d;
  margin: 0 0 32px 0;
  line-height: 1.5;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.pac-no-results-suggestions {
  background: #ffffff;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin-top: 24px;
  text-align: left;
}

.pac-no-results-suggestions p {
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  margin: 0 0 16px 0;
  text-align: center;
}

.pac-no-results-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pac-no-results-suggestions li {
  font-size: 15px;
  color: #6c757d;
  margin: 12px 0;
  padding-left: 0;
  position: relative;
}

/* Responsive adjustments for no results */
@media (max-width: 768px) {
  .pac-no-results {
    padding: 40px 16px;
    margin: 20px 16px;
  }

  .pac-no-results-title {
    font-size: 24px;
  }

  .pac-no-results-message {
    font-size: 16px;
  }

  .pac-no-results-suggestions {
    padding: 20px;
  }

  .pac-no-results-icon svg {
    width: 48px;
    height: 48px;
  }
}

/* =====================
   (Optional) SEARCH FORM STYLES
   If you have a search form on the same page
===================== */
#pac-search-form-container {
  margin: 20px 0;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.pac-inline-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.pac-form-group {
  flex: 0 1 200px;     /* Don’t grow, allow shrink, base width 200px */
  min-width: 160px;
}

.pac-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9em;
}

.pac-form-group select,
.pac-form-group input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9em;
}

/* Search button adjustments */
#pac-search-form-container button {
  flex: 0 0 120px;
  height: 38px;
  padding: 0 15px;
}

/* Responsive adjustments for search form */
@media (max-width: 992px) {
  .pac-inline-form {
    gap: 8px;
  }
  .pac-form-group {
    flex-basis: 180px;
    min-width: 140px;
  }
}

@media (max-width: 768px) {
  .pac-form-group {
    flex: 1 1 100%;
    max-width: 100%;
  }
  #pac-search-form-container button {
    width: 100%;
    flex-basis: 100%;
  }
}

/* Elementor compatibility (optional) */
.elementor-widget-container #pac-search-form-container {
  max-width: 100% !important;
  padding: 0 17px !important;
}
.elementor-section .elementor-column #pac-search-form-container {
  padding: 0 !important;
}

@media (width: 768px) {
  .elementor-widget-container #pac-search-form-container {
    max-width: 100% !important;
    padding: 0 40px !important;
  }
}

/* =====================
   iPad Air Responsive Fix (820px - 834px)
   Stack search form fields vertically
===================== */
@media (min-width: 820px) and (max-width: 834px) {
  .pac-inline-form {
    flex-direction: column;
    align-items: stretch;
  }
  .pac-form-group {
    flex: 1 1 100%;
    max-width: 100%;
  }
  #pac-search-form-container button {
    width: 100%;
    flex-basis: 100%;
  }
}
