/* ============================================================
   UNIFIED PROPERTY CARD COMPONENT
   Used across: listing, landing, map sidebar, my-properties
   Design System v2
   ============================================================ */

/* ── Card shell ─────────────────────────────────────────────── */
.pc-card {
  position: relative;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.pc-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.07));
  transform: translateY(-2px);
}

.pc-card.active {
  border-color: var(--accent, #F59E0B);
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Full-card clickable overlay (Django templates only) */
.pc-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ── Image ──────────────────────────────────────────────────── */
.pc-image {
  position: relative;
  height: 180px;
  background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

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

.pc-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.pc-image-placeholder i {
  font-size: 2.5rem;
  color: #9CA3AF;
  opacity: 0.4;
}

/* ── Badges (on image) ──────────────────────────────────────── */
.pc-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 999px;
  white-space: nowrap;
  z-index: 2;
}

.pc-badge--venta {
  background: var(--primary, #1A3C6E);
}

.pc-badge--alquiler {
  background: var(--success, #16A34A);
}

.pc-badge--type {
  position: static;
  background: rgba(0, 0, 0, 0.5);
}

/* Badges row inside content (listing/my-props) */
.pc-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.pc-badges .pc-badge {
  position: static;
}

/* Video tour badge */
.pc-video-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 2;
}

/* ── Content ────────────────────────────────────────────────── */
.pc-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pc-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin-bottom: 6px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pc-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary, #111827);
}

.pc-price-change {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.pc-price-change--down {
  background: #dcfce7;
  color: #16A34A;
}

.pc-price-change--up {
  background: #fff7ed;
  color: #D97706;
}

.pc-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted, #9CA3AF);
  margin-bottom: 10px;
}

.pc-location i {
  color: var(--text-muted, #9CA3AF);
  font-size: 0.75rem;
}

.pc-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #E5E7EB);
}

.pc-feature {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-body, #4B5563);
}

.pc-feature i {
  color: #9CA3AF;
  font-size: 0.85rem;
}

.pc-amenities {
  margin-top: 8px;
}

.pc-amenity-tag {
  font-size: 0.72rem;
  color: var(--text-muted, #9CA3AF);
  font-weight: 500;
}

/* ── Footer ─────────────────────────────────────────────────── */
.pc-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border, #E5E7EB);
  margin-top: auto;
}

.pc-actions {
  display: flex;
  gap: 8px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm, 8px);
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  z-index: 2;
}

.pc-btn--primary {
  background: var(--accent, #F59E0B);
  color: white;
}

.pc-btn--primary:hover {
  background: var(--accent-hover, #D97706);
  color: white;
  transform: translateY(-1px);
}

.pc-btn--whatsapp {
  background: #25d366;
  color: white;
}

.pc-btn--whatsapp:hover {
  background: #1ebe5d;
  color: white;
  transform: translateY(-1px);
}

/* Edit / Delete buttons (my-properties page) */
.pc-btn--edit {
  background: #eef2f8;
  border: 1.5px solid #c7d4e8;
  color: var(--primary, #1A3C6E);
}

.pc-btn--edit:hover {
  background: #dde5f0;
}

.pc-btn--delete {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: var(--danger, #EF4444);
}

.pc-btn--delete:hover {
  background: #fee2e2;
}

/* ── Compact modifier (map sidebar) ─────────────────────────── */
.pc-card--compact .pc-image {
  height: 140px;
}

.pc-card--compact .pc-content {
  padding: 10px 12px;
}

.pc-card--compact .pc-title {
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.pc-card--compact .pc-price {
  font-size: 1rem;
}

.pc-card--compact .pc-location {
  font-size: 0.75rem;
  margin-bottom: 6px;
}

.pc-card--compact .pc-features {
  gap: 8px;
  padding-top: 6px;
}

.pc-card--compact .pc-feature {
  font-size: 0.75rem;
}

.pc-card--compact .pc-footer {
  padding: 8px 12px;
}

.pc-card--compact .pc-actions {
  overflow: hidden;
}

.pc-card--compact .pc-btn {
  padding: 7px 10px;
  font-size: 0.78rem;
  min-width: 0;
}

.pc-card--compact .pc-btn--primary {
  flex: 1 1 0;
}

.pc-card--compact .pc-btn--whatsapp {
  flex: 1.3 1 0;
}

.pc-card--compact .pc-amenities {
  display: none;
}

/* ── Responsive: horizontal card for mobile/tablet ──────────── */
@media (max-width: 1024px) {
  .pc-card--compact {
    flex-direction: row;
    align-items: stretch;
  }

  .pc-card--compact .pc-image {
    width: 110px;
    height: auto;
    border-radius: 0;
  }

  .pc-card--compact .pc-badge {
    font-size: 0.6rem;
    padding: 3px 7px;
    top: 6px;
    left: 6px;
  }

  .pc-card--compact .pc-video-badge {
    width: 24px;
    height: 24px;
    font-size: 13px;
    bottom: 4px;
    right: 4px;
  }

  .pc-card--compact .pc-content {
    padding: 8px 10px;
    min-width: 0;
  }

  .pc-card--compact .pc-features {
    display: none;
  }

  .pc-card--compact .pc-footer {
    display: none;
  }
}
