/* ========================================
   Image Upload Component
   ======================================== */

.img-upload {
  margin: 12px 0;
}

.img-upload__preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.img-upload__thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
}

.img-upload__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-upload__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.img-upload__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border: 2px dashed #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.img-upload__drop:hover,
.img-upload__drop.dragover {
  border-color: #212121;
  background: #fafafa;
  color: #333;
}

.img-upload__hint {
  font-size: 11px;
  color: #bbb;
}

.img-upload__progress {
  margin-top: 8px;
}

.img-upload__bar {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.img-upload__bar-fill {
  height: 100%;
  background: #212121;
  transition: width 0.3s;
  width: 0;
}

#imgUploadStatus {
  font-size: 11px;
  color: #999;
}

/* ========================================
   Marketplace View
   ======================================== */

.marketplace-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.marketplace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.marketplace-header h1 {
  font-size: 28px;
  margin: 0;
}

.marketplace-sell-btn {
  background: #212121;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.marketplace-sell-btn:hover { background: #333; }

/* Marketplace Layout — same as store */
.mkp-layout {
  display: flex;
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 60px;
  transition: gap 0.35s ease;
}

@media (max-width: 768px) {
  .mkp-layout { gap: 0; }
  .mkp-layout .filters-mobile-toggle { display: flex; }
  .mkp-layout .products-toolbar__filter-toggle { display: none; }
}

/* Listing Grid */
.marketplace-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.marketplace-empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}
.marketplace-empty svg { margin-bottom: 12px; }
.marketplace-empty p { font-size: 14px; }

/* Listing Card */
.listing-card {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}
.listing-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.listing-card__image {
  width: 100%;
  aspect-ratio: 1;
  background: #f5f5f5;
  overflow: hidden;
  position: relative;
}

.listing-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.listing-card__condition {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.listing-card__condition--nueva { background: #E8F5E9; color: #2E7D32; }
.listing-card__condition--como_nueva { background: #E3F2FD; color: #1565C0; }
.listing-card__condition--usada { background: #FFF3E0; color: #E65100; }
.listing-card__condition--vintage { background: #F3E5F5; color: #6A1B9A; }

.listing-card__auction {
  position: absolute;
  top: 8px;
  right: 50px;
  background: #D32F2F;
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.listing-card__info {
  padding: 12px;
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 0.035) 0%,
    rgba(129, 199, 132, 0.05) 40%,
    rgba(200, 230, 201, 0.04) 70%,
    rgba(76, 175, 80, 0.025) 100%
  );
}

.listing-card__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-card__meta {
  font-size: 11px;
  color: #999;
  margin-bottom: 8px;
}

.listing-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.listing-card__price {
  font-size: 16px;
  font-weight: 700;
}

.listing-card__seller {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #777;
}

.listing-card__own {
  position: absolute;
  top: 8px;
  right: 50px;
  background: #212121;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.listing-card__own--bottom {
  top: auto;
  bottom: 8px;
  left: 8px;
  right: auto;
}

.listing-card__seller--link {
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.listing-card__seller--link:hover {
  color: #212121;
}

.listing-card__seller-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #212121;
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Listing Detail */
.listing-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.listing-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #999;
  font-size: 13px;
  text-decoration: none;
  margin-bottom: 16px;
  cursor: pointer;
}
.listing-detail__back:hover { color: #333; }

.listing-detail__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.listing-detail__gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.listing-detail__main-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
}

.listing-detail__main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-detail__thumbs {
  display: flex;
  gap: 6px;
}

.listing-detail__thumbs img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
}
.listing-detail__thumbs img.active { border-color: #212121; }

.listing-detail__info h1 {
  font-size: 22px;
  margin: 0 0 8px;
}

.listing-detail__price {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.listing-detail__specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}

.listing-detail__spec {
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
}
.listing-detail__spec-label { color: #999; }
.listing-detail__spec-value { font-weight: 500; }

.listing-detail__description {
  font-size: 13px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 20px;
}

.listing-detail__seller-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: #fafafa;
  border-radius: 10px;
  margin-bottom: 20px;
}

.listing-detail__buy-btn {
  width: 100%;
  padding: 14px;
  background: #212121;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.listing-detail__buy-btn:hover { background: #333; }

/* Create Listing Form */
.create-listing {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

.create-listing h1 {
  font-size: 22px;
  margin: 0 0 24px;
}

.create-listing .form-group {
  margin-bottom: 16px;
}

.create-listing label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 6px;
  font-weight: 600;
}

.create-listing input,
.create-listing select,
.create-listing textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.create-listing textarea {
  min-height: 80px;
  resize: vertical;
}

.condition-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.condition-option {
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.condition-option:hover { border-color: #212121; }
.condition-option.selected {
  background: #212121;
  color: #fff;
  border-color: #212121;
}

/* Marketplace Disclaimer */
.marketplace-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: #FFF8E1;
  border: 1px solid #FFE082;
  border-radius: 10px;
  font-size: 12px;
  color: #795548;
  line-height: 1.6;
  margin-bottom: 20px;
}
.marketplace-disclaimer svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #FFB300;
}

/* Seller Onboarding Steps */
.seller-onboard-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.seller-onboard-step {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  transition: border-color 0.2s;
}
.seller-onboard-step.done {
  border-color: #A5D6A7;
  background: #F1F8E9;
}
.seller-onboard-step__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #212121;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.seller-onboard-step.done .seller-onboard-step__num {
  background: #2E7D32;
}
.seller-onboard-step__title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

/* Favorite Heart on Cards — matches product-card__wishlist style */
.listing-card__fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  cursor: pointer;
  color: #bbb;
  transition: color 0.2s, background 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
}
.listing-card__fav:hover { color: #E91E63; background: rgba(255,255,255,0.95); transform: scale(1.1); }
.listing-card__fav.active { color: #E91E63; }
.listing-card__fav.active svg { fill: #E91E63; }

/* Verified Badge */
.seller-verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #2E7D32;
  background: #E8F5E9;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}

/* Responsive — match store grid breakpoints */
@media (max-width: 1024px) {
  .marketplace-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .marketplace-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .listing-detail__content { grid-template-columns: 1fr; }
  .marketplace-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}

@media (max-width: 480px) {
  .marketplace-grid { gap: 8px; }
}
