@media (min-width: 781px) {
/* Cards layout (desktop + mobile, flexbox only) */
#searchResults{
  width: 100%;
  margin: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;   /* To let cards overflow to the line below */
  gap: 19px;
  justify-content: center;
}


.search-card { 
  width: 250px;
  height: 360px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.search-card:hover {
  box-shadow: 0px 4px 12px rgba(0,0,0,0.18);
  transform: translateY(-3px);
}

/* --- Container for Search Card Image --- */
    .search-img-container {
        position: relative; /* Anchor for the rating badge */
        width: 100%;
        height: 140px;      /* Fixed height based on your original img style */
        overflow: hidden;
        border-top-left-radius: 9px;
        border-top-right-radius: 9px;
    }

    .search-img-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        background-color: #fafafa;
    }

    /* --- Floating Badge --- */
    .search-rating-badge {
        position: absolute;
        bottom: 8px;
        left: 8px;
        z-index: 10;
        font-size: 14px;
        font-weight: bold;
        color: white !important;
        padding: 3px 7px;
        border-radius: 4px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }

        /* Styling for the parentheses and review count */
    .rating-count {
        font-size: 12px;      /* Makes it smaller than the rating */
        margin-left: 4px;       /* Adds a tiny gap after the rating number */
        font-weight: normal;    /* Keeps it from being too heavy */
    } 


    /* Rating Colors */
    .rating-high { background-color: #27ae60 !important; }
    .rating-mid  { background-color: #f39c12 !important; }
    .rating-low  { background-color: #c0392b !important; }


.search-card-name {
  font-size: 15px;
  color: #555;
  margin: 6px 0; /* top/bottom 3px, left/right 0 */
  line-height: 1.4;
}
.search-card-price {
  color: #0b4e0b;
  font-size: 16px;
  margin: 3px 0; /* top/bottom 3px, left/right 0 */
}
.search-card-city {
  font-size: 13px;
  margin: 3px 0; /* top/bottom 3px, left/right 0 */
}
.search-card-description {
  font-size: 14px;
  color: #555;
  margin: 8px 0; /* top/bottom 3px, left/right 0 */
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* No results */
.search-noResults {
  margin-top: 25px;
  font-size: 18px;
  color: #555;
  font-style: italic;
  text-align: left;
}
}


@media (max-width: 780px) {
  #searchResults {
    width: 100%;
    padding: 10px 5px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;     
    justify-content: center; 
    gap: 10px; /* Space between the two columns */
  }

  .search-card { 
    /* Calculations for 2 columns: 50% minus the gap */
    width: calc(50% - 10px); 
    min-width: 150px;
    height: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d4d4d4;
    border-radius: 10px;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.08);
  }

  /* Disable movement on tap for mobile */
  .search-card:hover {
    transform: none;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.08);
  }

/* --- Container for Search Card Image (mobile) --- */
.search-img-container {
  position: relative;   /* Anchor for the rating badge */
  width: 100%;
  height: 110px;        /* Same as your mobile image height */
  overflow: hidden;
  border-radius: 4px;   /* match your mobile img radius */
}

.search-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: #fafafa;
}

/* --- Floating Badge (mobile) --- */
.search-rating-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  z-index: 10;
  font-size: 13px;
  font-weight: bold;
  color: white !important;
  padding: 2px 4px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}

    .rating-count {
        font-size: 11px;      /* Makes it smaller than the rating */
        margin-left: 3px;       /* Adds a tiny gap after the rating number */
        font-weight: normal;    /* Keeps it from being too heavy */
    }

/* Rating Colors (same as desktop) */
.rating-high { background-color: #27ae60 !important; }
.rating-mid  { background-color: #f39c12 !important; }
.rating-low  { background-color: #c0392b !important; }


  .search-card-name {
    font-size: 13px;
    color: #555;
    margin: 2px 0;
  }

  .search-card-price {
    color: #0b4e0b;
    font-size: 15px;
    font-weight: bold;
    margin: 2px 0;
  }

  .search-card-city {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
  }

  .search-card-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    /* Limit description to 2 lines for 2-column view */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .search-noResults {
    margin-top: 30px;
    font-size: 16px;
    text-align: center;
    width: 100%;
  }
} 