/* ==========================================================================
   LKYT MAIL CC — MARKETPLACE & PRODUCT STYLES
   ========================================================================== */

/* Catalog Layout */
.marketplace-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  padding: 40px 0 80px;
}

/* Sidebar Filters */
.filters-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.filter-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.filter-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--transition-fast);
}

.filter-item-btn:hover, .filter-item-btn.active {
  background: var(--bg-elevated);
  color: var(--accent);
}

.filter-count {
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  color: var(--text-muted);
}

/* Marketplace Header Bar */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.catalog-search-wrap {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.catalog-search-input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.catalog-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.catalog-sort-select {
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Product Card */
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  position: relative;
}

.product-card:hover {
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-card-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.product-card:hover .product-card-thumb {
  transform: scale(1.05);
}

.product-thumb-fallback {
  width: 60px;
  height: 60px;
  color: var(--accent);
  opacity: 0.5;
}

.product-badge-wrap {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.product-delivery-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(16, 16, 21, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

.product-card-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.product-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-stock-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.stock-in {
  color: var(--success);
}
.stock-in .stock-dot {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.stock-out {
  color: var(--danger);
}
.stock-out .stock-dot {
  background: var(--danger);
}

.product-card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-price-final {
  font-size: 1.35rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.product-price-original {
  font-size: 0.88rem;
  text-decoration: line-through;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   PRODUCT DETAILS PAGE
   ========================================================================== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  padding: 50px 0 90px;
}

.product-detail-media {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-detail-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
}

.product-detail-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
}

.product-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.product-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.feature-check-icon {
  color: var(--success);
  margin-top: 3px;
  flex-shrink: 0;
}

/* Instant Purchase Box */
.purchase-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
}

.purchase-wallet-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.coupon-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .marketplace-layout {
    grid-template-columns: 1fr;
  }
  .filters-sidebar {
    display: none; /* toggleable drawer */
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}
