/* Reset and Base Styles */
:root {
    --primary-blue: #1a3a6c;
    --secondary-blue: #2a5a8c;
    --accent-red: #e63946;
    --light-red: #ff6b7c;
    --light-gray: #f5f7fa;
    --dark-gray: #2d3748;
    --medium-gray: #718096;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #fff;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.search-input::placeholder {
    color: var(--medium-gray);
}

.search-form {
  margin-top: 110px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  color: #1f2937;
  padding-top: 16px;
}


@media (min-width: 768px) {
  .search-form {
    grid-template-columns: repeat(4, 1fr);
  }
}

.search-input, .search-select {
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  transition: ring 0.2s;
}

.search-input:focus, .search-select:focus {
  ring: 2px;
  ring-color: #e63946;
}

/* Clear Filters Button */
.clear-filters-btn {
  background-color: #6b7280;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.clear-filters-btn:hover {
  background-color: #4b5563;
}

/* Active Filters Display */
.active-filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.filter-label {
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  background-color: #dbeafe;
  color: #1e40af;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
}

.remove-filter {
  color: #dc2626;
  text-decoration: none;
  font-weight: bold;
  padding: 0 2px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.remove-filter:hover {
  background-color: #fee2e2;
}

/* Results Count */
.results-count {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

/* Error Message */
.error-message {
  background-color: #fef2f2;
  color: #dc2626;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  border: 1px solid #fecaca;
}

/* No Properties Message */
.no-properties {
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
  grid-column: 1 / -1;
}

.no-properties h3 {
  color: #374151;
  margin-bottom: 8px;
}

.no-properties a {
  color: #1a3a6c;
  text-decoration: underline;
}

.no-properties a:hover {
  color: #153259;
}

/* Listings Section */
.listings-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
  display: grid;
  gap: 40px;
}

@media (min-width: 768px) {
  .listings-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .listings-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Property Cards */
.property-card {
  position: relative;
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.property-card:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.property-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.property-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  color: white;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  background-color: #e63946;
}

.property-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.property-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px;
}

.property-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a3a6c;
}

.property-specs {
  display: flex;
  gap: 7px;
  justify-content: space-between;
}

.property-price {
  color: var(--primary-blue);
  font-size: 1rem;
 
}

.property-location {
  color: var(--accent-red);
  font-weight: bold;
}

.property-availability {
  color: #e63946;
  font-weight: 500;
  font-size: 0.9rem;
  margin-top: 4px;
}

.property-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-size: 0.9rem;
  margin-top: 16px;
  flex-grow: 1;
  list-style: none;
}

.property-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-contact {
  background-color: #1a3a6c;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s;
}

.btn-contact:hover {
  background-color: #153259;
}

.btn-gallery {
  color: #1a3a6c;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  transition: color 0.2s;
}

.btn-gallery:hover {
  color: #153259;
}

.btn-call {
  background-color: #e63946;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.2s;
}

.btn-call:hover {
  background-color: #c5303f;
}

/* Contact Section */
.contact-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
  background-color: #f3f4f6;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.contact-title {
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #1a3a6c;
}

.contact-address {
  margin-bottom: 8px;
}

.contact-phone {
  margin-top: 8px;
  margin-bottom: 24px;
}

.phone-link {
  color: #1d4ed8;
  text-decoration: underline;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  background-color: #059669;
  color: white;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: background-color 0.2s;
}

.whatsapp-btn:hover {
  background-color: #047857;
}

.whatsapp-icon {
  height: 24px;
  width: 24px;
  margin-right: 8px;
}

/* Gallery Modal */
.gallery-modal {
  display: none;
  position: fixed;
  padding-top: 60px;
  inset: 0;
  align-items: flex-start;
  background-color: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gallery-modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 768px;
  width: 100%;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  max-height: 90vh;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #374151;
  background: none;
  border: none;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #111827;
}

.modal-image {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  background-color: #f3f4f6;
}

.modal-controls {
  padding: 16px;
  display: flex;
  justify-content: center;
  gap: 16px;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.modal-btn {
  padding: 8px 16px;
  background-color: #1a3a6c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-btn:hover {
  background-color: #153259;
}


@media (max-width: 480px) {
  .clear-filters-btn {
    flex-shrink: 0;
    padding: 10px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .active-filters {
   padding: 12px 16px;
   font-size: 12px;
  }

  .filter-tag {
    font-size: 11px;
    padding: 3px 6px;
  }

  .results-count {
    padding: 12px 16px;
    font-size: 13px;
  }

  .mobile-scroll-container {
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .mobile-scroll-container::-webkit-scrollbar {
    height: 4px;
  }

  .mobile-scroll-container::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
  }

  .search-form {
    padding: 12px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    align-items: center;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .search-select {
    min-width: 160px;
    font-size: 13px;
    padding: 8px 10px;
    scroll-snap-align: start;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .listings-container {
    padding: 0 5px;
  }
  .property-card {
    box-shadow: none;
  }

  .property-content {
    padding: 16px;
  }

  .property-features {
    grid-template-columns: 1fr;
  }

  .property-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .btn-contact,
  .btn-gallery {
    width: 100%;
    font-size: 14px;
    padding: 5px;
    text-align: center;
  }

  .btn-call {
    width: 100%;
    text-align: center;
  }

  .contact-section {
    padding: 32px 16px;
  }

  .contact-title {
    font-size: 22px;
  }

  .whatsapp-btn {
    flex-direction: column;
    padding: 10px;
  }

  .whatsapp-icon {
    margin: 0 0 6px 0;
  }

}
