.listings-container {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: flex-start;
  max-width: 1350px;
  margin: 40px auto 0 auto;
  padding: 0 16px;
}

.listing-card {
  background: #f8fbff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(79, 140, 255, 0.08);
  border: 1.5px solid #dbeafe;
  flex: 1 1 calc((100% - 28px) / 2);
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  padding: 24px 22px 18px 22px;
  transition: box-shadow 0.18s, border 0.18s;
  position: relative;
  box-sizing: border-box;
  word-break: break-word;
  overflow: hidden;
}

.listing-card:hover {
  box-shadow: 0 8px 32px rgba(79, 140, 255, 0.16);
  border: 1.5px solid #4f8cff;
}

/* Фотографии в объявлениях */
.listing-photos {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  overflow-x: auto;
}

.listing-photo-item {
  position: relative;
  width: 120px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.listing-photo-item:hover {
  transform: scale(1.05);
}

.listing-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-counter {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Модальное окно для просмотра фото */
.photo-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
}

.photo-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.photo-modal-content img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

.photo-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.photo-modal-close:hover {
  color: #4f8cff;
}

.listing-category {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 0.97em;
  color: #4f8cff;
  background: #e9eef6;
  border-radius: 6px;
  padding: 2px 10px;
  font-weight: 600;
  margin: 0;
  display: inline-block;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(79,140,255,0.04);
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-title {
  font-size: 1.18em;
  font-weight: 700;
  color: #1a3a5d;
  margin-bottom: 8px;
  margin-top: 0;
  letter-spacing: 0.2px;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.listing-desc {
  font-size: 1.04em;
  color: #3b5b7a;
  margin-bottom: 16px;
  line-height: 1.5;
  min-height: 48px;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.listing-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: auto;
}

.listing-nick {
  font-size: 0.98em;
  color: #6b7a8f;
  font-style: italic;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.listing-contact-tip {
  display: inline-block;
  font-size: 0.95em;
  color: #8fa3b8;
  margin-left: 6px;
  font-style: normal;
  font-weight: 400;
}

/* Адаптивность */
@media (max-width: 900px) {
  .listings-container {
    max-width: 100%;
  }
  .listing-card {
    flex-basis: 100%;
  }
}

@media (max-width: 700px) {
  .listing-card {
    flex-basis: 100%;
  }
  .listings-container {
    gap: 14px;
    padding: 0 4px;
  }
  .listing-category {
    max-width: 80%;
    font-size: 0.95em;
    top: 12px;
    right: 12px;
  }
  .listing-title {
    margin-top: 14px;
  }
  .listing-contact-tip {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }
  .listing-photo-item {
    width: 80px;
    height: 60px;
  }
}