/* Shared Deal Card component (used on deals#index and items#index curated shelf) */

.deal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); /* 12px */
  overflow: hidden;
  display: flex;
  flex-direction: row;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  min-height: 165px;

  &:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
  }
}

.deal-card-media {
  position: relative;
  width: 230px;
  min-width: 230px;
  background-color: var(--bg-media);
  overflow: hidden;
  user-select: none;
}

.deal-card-media-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.deal-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}

.deal-card-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  color: var(--text-on-accent);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  z-index: 4;
  pointer-events: none;
}

.deal-card-fav-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;

  .favorite-toggle-btn i {
    font-size: 0.8rem;
  }
}

.deal-card-placeholder {
  width: 100%;
  height: 100%;
  min-height: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-subtle);
  background-color: var(--bg-media);
  user-select: none;
}

.deal-card-placeholder-icon {
  font-size: 2.2rem;
  color: var(--border-strong);
}

.deal-card-placeholder-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.deal-card-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 5px;
}

.deal-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.2;
}

.deal-price-current {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;

  .price-unit {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
  }
}

.deal-inline-sep {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.deal-sqm-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.deal-card-discount {
  background-color: var(--success-soft);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.deal-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 1px 0 0;

  a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;

    &:hover {
      color: var(--accent);
    }
  }
}

.deal-location-row {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-specs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.deal-spec-pill {
  background-color: var(--bg-page);
  border: 1px solid var(--border-strong);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
  color: var(--text-secondary);
}

.deal-badges-wrap {
  margin-top: auto;
  padding-top: 2px;

  .tags {
    margin-bottom: 0;
    gap: 4px;
  }

  .tag {
    margin-bottom: 0;
  }
}

@media (max-width: 600px) {
  .deal-card {
    flex-direction: column;
  }

  .deal-card-media {
    width: 100%;
    min-width: 100%;
    height: 180px;
  }

  .deal-card-placeholder {
    min-height: 180px;
  }
}
