/* Marketplace-style product listing (AliExpress / deal-site inspired) */
.marketplace-page {
  background: #f0f2f5;
  min-height: 60vh;
}

.marketplace-toolbar {
  background: #fff;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.marketplace-search {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  position: relative;
}

.marketplace-search input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.5rem;
  border: 1px solid #ddd;
  border-radius: 999px;
  font-size: 0.95rem;
}

.marketplace-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

.marketplace-meta {
  color: #666;
  font-size: 0.9rem;
}

.marketplace-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 991px) {
  .marketplace-layout {
    grid-template-columns: 1fr;
  }

  /* No sticky sidebar on mobile — avoids product cards bleeding through while scrolling */
  .marketplace-filters {
    position: static;
    top: auto;
    z-index: auto;
    display: block;
    margin-bottom: 1rem;
  }

  .marketplace-filters h6 {
    width: auto;
    margin-top: 1rem;
  }

  .marketplace-filters h6:first-child {
    margin-top: 0;
  }

  .filter-chip {
    display: inline-block;
    width: auto;
    margin-right: 0.5rem;
  }

  .marketplace-grid-wrap {
    position: relative;
    z-index: 0;
  }
}

.marketplace-filters {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (min-width: 992px) {
  .marketplace-filters {
    position: sticky;
    top: 1rem;
    z-index: 2;
  }
}

.marketplace-filters h6 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #333;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.filter-chip {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.4rem 0;
  color: #444;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--bs-primary, #3b8ef5);
  font-weight: 600;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

@media (min-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.product-card-link {
  text-decoration: none;
  color: inherit;
}

.product-card-link:hover {
  color: inherit;
}

.product-card-title a {
  color: #222;
}

.product-card-title a:hover {
  color: var(--bs-primary, #3b8ef5);
}

.product-card-image {
  display: block;
  aspect-ratio: 1;
  background: #fafafa;
  overflow: hidden;
  position: relative;
}

.product-card-image img,
.product-card-image .product-card-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.product-card-image .product-card-icon {
  object-fit: unset;
  min-height: 100%;
}

.product-card:hover .product-card-image img {
  transform: scale(1.03);
}

.product-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ff4747;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.product-card-body {
  padding: 10px 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-title {
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;
  color: #222;
}

.product-card-desc {
  font-size: 0.78rem;
  color: #888;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.product-card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ff4747;
  margin-bottom: 4px;
}

.product-card-price small {
  font-size: 0.75rem;
  font-weight: 400;
  color: #999;
  display: block;
}

.product-card-deposit {
  font-size: 0.78rem;
  font-weight: 600;
  color: #b45309;
  margin: 6px 0 0;
  line-height: 1.35;
}

.product-deposit-note {
  font-size: 0.9rem;
  line-height: 1.45;
  border-color: #f59e0b;
  background: #fffbeb;
  color: #78350f;
}

.product-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.product-card-actions .btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}

/* Site theme uses light --text on dark pages; cards are white — keep buttons readable */
.product-card-actions .btn-primary {
  color: #fff;
}

/* Product detail page */
.product-detail-page {
  background: #f0f2f5;
}

.product-detail-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.product-gallery-main {
  aspect-ratio: 1;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card-icon,
.product-gallery-icon {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1e2433 0%, #0f1218 100%);
}

.product-card-icon i,
.product-gallery-icon i {
  font-size: 4.5rem;
  color: var(--primary, #3b8ef5);
  opacity: 0.95;
}

.product-gallery-main--icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-gallery-main--icon .product-gallery-icon {
  min-height: 100%;
  aspect-ratio: 1;
}

.product-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.product-gallery-thumbs button {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.product-gallery-thumbs button.active,
.product-gallery-thumbs button:hover {
  border-color: var(--bs-primary, #3b8ef5);
}

.product-gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-variant-picker {
  margin-bottom: 1.25rem;
}

.product-variant-picker label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  display: block;
}

.product-variant-picker select {
  max-width: 320px;
}

.product-variant-summary {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0 0;
}

.product-gallery-thumbs button.thumb-shared::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b8ef5;
  opacity: 0.85;
}

.product-gallery-thumbs button {
  position: relative;
}

.product-detail-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ff4747;
}

.product-detail-highlights {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.product-detail-highlights li {
  padding: 0.35rem 0;
  color: #444;
  font-size: 0.95rem;
}

.product-detail-highlights li::before {
  content: '✓';
  color: #2ecc71;
  font-weight: bold;
  margin-right: 0.5rem;
}

.product-breadcrumb {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 1rem;
}

.product-breadcrumb a {
  color: var(--bs-primary, #3b8ef5);
  text-decoration: none;
}

.marketplace-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #888;
  background: #fff;
  border-radius: 8px;
}
