/* ProFinder Similar Ads - fully self-contained styles */

.pfsim-section {
  padding: 20px 0;
}

.pfsim-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pfsim-heading h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.pfsim-toggle {
  display: flex;
  gap: 8px;
}
.pfsim-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #e2e2e2;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8a8a;
  text-decoration: none;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: 0.2s ease;
}
.pfsim-toggle-btn:hover {
  color: #fff;
  background: #d50a08;
  border-color: #d50a08;
}
.pfsim-toggle-btn.pfsim-active {
  background: #d50a08;
  border-color: #d50a08;
  color: #fff;
}

/* Shared card basics */
.pfsim-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.pfsim-img-link {
  display: block;
  position: relative;
}
.pfsim-img {
  width: 100%;
  object-fit: cover;
  display: block;
}
.pfsim-avatar {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
}
.pfsim-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: block;
}
/* Company/Individual badge - small icon pinned to the avatar's corner */
.pfsim-type-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d50a08;
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.pfsim-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.pfsim-cats span,
.pfsim-cats a {
  display: inline-block;
  background: #f4f5f6;
  color: #6b7280;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
}

.pfsim-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.pfsim-title:hover {
  color: #d50a08;
}

.pfsim-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: #9c9c9c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pfsim-location i {
  flex-shrink: 0;
  font-size: 12px;
}
.pfsim-location span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- LIST view: image left, content middle, seller right --- */
.pfsim-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pfsim-card-list {
  display: flex;
  min-height: 180px;
}
.pfsim-card-list .pfsim-img-link {
  flex: 0 0 220px;
  width: 220px;
}
.pfsim-card-list .pfsim-img {
  height: 100%;
  min-height: 180px;
}
.pfsim-card-list .pfsim-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid #eee;
}
.pfsim-card-list .pfsim-seller {
  flex: 0 0 180px;
  width: 180px;
  min-width: 180px;
  padding: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.pfsim-seller-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: visible;
  display: block;
  margin-bottom: 8px;
  position: relative;
}
.pfsim-seller-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.pfsim-seller-name {
  font-weight: 600;
  font-size: 14px;
  color: #1a1a1a;
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.pfsim-seller-link {
  font-size: 12px;
  color: #4f7ce4;
  text-decoration: none;
}

/* RTL: mirror the divider and layout direction */
html[dir="rtl"] .pfsim-card-list,
html[lang^="ar"] .pfsim-card-list,
html[lang^="ur"] .pfsim-card-list {
  flex-direction: row-reverse;
}
html[dir="rtl"] .pfsim-card-list .pfsim-body,
html[lang^="ar"] .pfsim-card-list .pfsim-body,
html[lang^="ur"] .pfsim-card-list .pfsim-body {
  border-right: none;
  border-left: 1px solid #eee;
}

/* --- GRID view: uniform cards, responsive columns --- */
.pfsim-grid-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.pfsim-card-grid {
  flex: 0 0 calc(25% - 15px);
  max-width: calc(25% - 15px);
  min-height: 300px;
  display: flex;
  flex-direction: column;
}
.pfsim-card-grid .pfsim-img {
  height: 170px;
}
.pfsim-card-grid .pfsim-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1199px) {
  .pfsim-card-grid {
    flex: 0 0 calc(33.333% - 14px);
    max-width: calc(33.333% - 14px);
  }
}
@media (max-width: 991px) {
  .pfsim-card-grid {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
  .pfsim-card-list {
    flex-direction: column;
    min-height: auto;
  }
  .pfsim-card-list .pfsim-img-link {
    width: 100%;
    flex: none;
  }
  .pfsim-card-list .pfsim-img {
    height: 180px;
    min-height: 0;
  }
  .pfsim-card-list .pfsim-body {
    border-right: none;
    border-bottom: 1px solid #eee;
  }
  html[dir="rtl"] .pfsim-card-list,
  html[lang^="ar"] .pfsim-card-list,
  html[lang^="ur"] .pfsim-card-list {
    flex-direction: column;
  }
  html[dir="rtl"] .pfsim-card-list .pfsim-body,
  html[lang^="ar"] .pfsim-card-list .pfsim-body,
  html[lang^="ur"] .pfsim-card-list .pfsim-body {
    border-left: none;
    border-bottom: 1px solid #eee;
  }
  .pfsim-card-list .pfsim-seller {
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }
}
@media (max-width: 575px) {
  .pfsim-card-grid {
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
  }
  .pfsim-grid-wrap {
    gap: 12px;
  }
}
