/* Product List Page Styles */

.product-card {
  background: var(--white);
}

.product-card .card-img-top {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: var(--gray-100);
}

.product-card .card-body {
  padding: 16px;
}

.product-card .product-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  max-height: 2.8em;
  margin-bottom: 8px;
}

.product-card .product-price {
  font-size: 14px !important;
  font-weight: 700;
  color: #1a1a1a !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card .product-moq {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.product-card .supplier-name {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 8px;
}

.product-card .supplier-name i {
  color: var(--secondary);
}

/* Badges */
.badge-verified {
  background: var(--secondary);
  color: var(--white);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.badge-company-type {
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.badge-cert {
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 3px;
  margin-right: 4px;
}

.badge-hot {
  background: var(--danger);
  color: var(--white);
}

.badge-new {
  background: var(--secondary);
  color: var(--white);
}

/* Supplier Card */
.supplier-card {
  background: var(--white);
  padding: 20px;
}

.supplier-card .supplier-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--gray-100);
}

.supplier-card .supplier-info h5 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.supplier-card .supplier-meta {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.supplier-card .cert-badges {
  margin-top: 12px;
}

/* Filters Sidebar */
.filter-sidebar {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
}

.filter-group {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group h6 {
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--gray-900);
}

.filter-group .form-check {
  margin-bottom: 10px;
}

.filter-group .form-check-label {
  font-size: 0.9rem;
  color: var(--gray-700);
}

.filter-group .badge {
  font-size: 0.75rem;
  background: var(--gray-200);
  color: var(--gray-700);
}

/* Price Range */
.price-range-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.price-range-inputs input {
  width: 100px;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.9rem;
}

/* Product List View */
.product-list-item {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 20px;
  transition: all 0.3s;
}

.product-list-item:hover {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.product-list-item .product-image {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--gray-100);
}

.product-list-item .product-info {
  flex: 1;
}

.product-list-item .product-actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
}

/* View Toggle */
.view-toggle .btn {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
}

.view-toggle .btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Pagination */
.pagination {
  gap: 5px;
}

.pagination .page-link {
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  padding: 10px 16px;
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Responsive */
@media (max-width: 767px) {
  .product-list-item {
    flex-direction: column;
  }

  .product-list-item .product-image {
    width: 100%;
    height: 200px;
  }

  .product-list-item .product-actions {
    flex-direction: row;
    width: 100%;
    margin-top: 16px;
  }
}

/* Desktop marketplace result treatment */
@media (min-width: 768px) {
  #productGridView { margin-top: 2px; }
  #productRow.product-results { display: block !important; }
  .product-listing {
    display: flex;
    align-items: stretch;
    gap: 18px;
    width: 100%;
    min-height: 280px;
    margin: 0 0 14px;
    padding: 14px 16px 14px 14px;
    background: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(24, 48, 74, .035);
    transition: box-shadow .2s ease, transform .2s ease;
  }
  .product-listing:hover { box-shadow: 0 8px 22px rgba(24,48,74,.09); transform: translateY(-1px); }
  .product-listing > .card { display: contents; }
  .product-listing > .card > .position-relative { position:relative; flex:0 0 250px; width:250px; height:250px; overflow:hidden; border-radius:8px; background:#f4f6f7; }
  .product-listing > .card > .position-relative > a { display:block; width:100%; height:100%; }
  .product-listing > .card > .position-relative .card-img-top { width:100%; height:100%; aspect-ratio:auto; object-fit:cover; transition:transform .3s ease; }
  .product-listing:hover > .card > .position-relative .card-img-top { transform:scale(1.025); }
  .product-listing > .card > .position-relative .pv-wrap { width:100%; height:100%; }
  .product-listing > .card > .position-relative .btn-favorite { z-index:2; }
  .listing-media { position: relative; flex: 0 0 220px; height: 180px; overflow: hidden; border-radius: 6px; background: #f4f6f7; }
  .listing-media > a, .listing-media img, .listing-media video { display:block; width:100%; height:100%; object-fit:cover; }
  .listing-media img { transition: transform .3s ease; }
  .product-listing:hover .listing-media img { transform: scale(1.025); }
  .media-empty { height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; color:#9aa8b3; font-size:12px; }
  .media-empty i { font-size:28px; }
  .pv-wrap { position:relative; width:100%; height:100%; cursor:pointer; }
  .pv-play { position:absolute; inset:0; display:grid; place-items:center; color:#fff; background:rgba(17,38,57,.18); font-size:22px; }
  .pv-play i { width:42px; height:42px; display:grid; place-items:center; border-radius:50%; background:rgba(27,108,140,.92); padding-left:3px; }
  .btn-favorite { position:absolute; top:10px; right:10px; width:34px; height:34px; border:0; border-radius:50%; background:rgba(255,255,255,.94); color:#d64545; box-shadow:0 2px 8px rgba(0,0,0,.12); }
  .listing-main { flex:1; min-width:0; padding:0 !important; }
  .product-listing .card-body.listing-main { display:block; }
  .product-listing .product-title { display:block; max-height:2.7em; margin:2px 0 8px; color:#1c2b36; font-size:17px; line-height:1.35; font-weight:600; text-decoration:none; }
  .product-listing .product-price { color:#18242c !important; font-size:24px !important; line-height:1.15; font-weight:800; }
  .product-listing .product-moq { margin-top:4px; color:#3a454d; font-size:14px; font-weight:600; }
  .product-listing .supplier-name { margin-top:10px; color:#34505d; font-size:14px; font-weight:600; }
  .product-listing .supplier-name i { color:#2388a0; }
  .listing-company-info { display:flex; align-items:center; gap:9px; min-width:0; margin-top:10px; }
  .listing-company-link { min-width:0; max-width:70%; }
  .listing-company-info .supplier-name { margin-top:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .listing-business-type { display:inline-flex; align-items:center; gap:5px; flex:0 0 auto; padding:4px 9px; border-radius:999px; background:#eaf3ff; color:var(--primary); font-size:12px; font-weight:700; line-height:1.2; white-space:nowrap; }
  .listing-company-info .supplier-level-badge { flex:0 0 auto; font-size:12px !important; padding:4px 9px !important; }
  .listing-badges { min-height:22px; display:flex; gap:7px; align-items:center; margin-bottom:5px; }
  .badge-trade, .badge-cert { display:inline-flex; align-items:center; gap:5px; padding:3px 7px; border-radius:3px; font-size:10px; font-weight:700; }
  .badge-trade { color:#47852f; background:#edf7e9; }
  .badge-cert { color:#35627e; background:#edf3f7; }
  .listing-title { display:block; color:#1c2b36; font-size:14px; line-height:1.35; font-weight:600; text-decoration:none; margin:2px 0 5px; }
  .listing-title:hover { color:#1a718a; }
  .listing-price { color:#18242c; font-size:20px; line-height:1.15; font-weight:800; }
  .listing-price small { color:#76838d; font-size:10px; font-weight:500; }
  .listing-moq { margin-top:2px; color:#3a454d; font-size:12px; font-weight:600; }
  .listing-moq span { color:#87939c; font-weight:400; }
  .spec-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:32px; row-gap:5px; margin:12px 0 9px; max-width:760px; }
  .spec-item { display:flex; min-width:0; gap:6px; font-size:14px; line-height:1.4; color:#3e4a52; }
  .spec-item b { flex:0 0 auto; color:#1f2c34; font-weight:600; }
  .spec-item span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .spec-description { grid-column:1/-1; }
  .listing-supplier { display:flex; align-items:center; gap:6px; max-width:440px; color:#34505d; font-size:12px; font-weight:600; text-decoration:underline; text-underline-offset:2px; }
  .listing-supplier i:first-child { color:#2388a0; }
  .listing-supplier i:last-child { margin-left:auto; font-size:9px; color:#83929a; }
  .listing-actions { display:flex; flex-direction:row; align-items:center; gap:9px; margin-top:9px; }
  .btn-inquiry, .btn-chat { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-width:136px; min-height:40px; padding:0 22px; border-radius:21px; font-size:14px; font-weight:700; text-decoration:none; transition:background .2s ease, color .2s ease, border-color .2s ease; }
  .btn-inquiry { border:1px solid var(--primary); background:var(--primary); color:#fff; }
  .btn-inquiry:hover { background:var(--primary-dark); border-color:var(--primary-dark); color:#fff; }
  .btn-chat { border:1px solid #26353d; color:#26353d; background:#fff; }
  .btn-chat:hover { background:#eef4fc; color:var(--primary); border-color:var(--primary); }
}