/* ═══════════════════════════════
   CARD CONTAINERS
═══════════════════════════════ */
.CardsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin: 20px auto;
  max-width: 90%;
  padding: 10px;
}

.CardsContainerDashboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
}

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

@media (max-width: 450px) {
  .CardsContainerDashboard {
    padding: 8px;
  }
}

@media (max-width: 390px) {
  .CardsContainer {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 8px;
  }
}

/* ═══════════════════════════════
   CARD
═══════════════════════════════ */
.card {
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #d0d4dc;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(13, 21, 38, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(13, 21, 38, 0.13);
  border-color: #a0a8b8;
}

.card:active {
  transform: translateY(1px);
}

/* Featured card — amber border */
.card.featured {
  border-color: #f5a623;
  box-shadow: 0 0 0 2px #f5a623, 0 4px 20px rgba(245, 166, 35, 0.2);
}

.card.featured:hover {
  box-shadow: 0 0 0 2px #f5a623, 0 8px 32px rgba(245, 166, 35, 0.28);
}

/* ═══════════════════════════════
   CARD LINK WRAPPER
═══════════════════════════════ */
.CardLink {
  display: block;
  text-decoration: none;
  color: inherit;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════
   IMAGE CONTAINER
═══════════════════════════════ */
.image-container {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.image-container::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(8, 13, 23, 0.65) 100%);
  pointer-events: none;
  z-index: 1;
}

.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.card:hover .card-img-top {
  transform: scale(1.04);
}

/* ═══════════════════════════════
   BADGES — top left
═══════════════════════════════ */
.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  z-index: 2;
}

.badge {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.badge-featured {
  background: #f5a623;
  color: #080d17;
}

.badge-new {
  background: #0d1526;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-sold {
  background: rgba(232, 64, 64, 0.9);
  color: #fff;
}

/* Owner-only: a listing hidden by moderation (dashboard cards, the owner's
   detail page). Neutral slate on purpose — it is not a sale state and must
   not read as one. Fixed fill + white text, so it is identical in dark
   mode (theme.css never recolours .badge-*). */
.badge-review {
  background: #475569;
  color: #fff;
}

.badge-reduced {
  background: #22c55e;
  color: #080d17;
}

/* Legacy featured badge class — kept for other pages */
.featured-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #f5a623;
  color: #080d17;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 3;
  pointer-events: none;
}

/* ═══════════════════════════════
   PRICE BADGE — bottom left of image
═══════════════════════════════ */
.card-price-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(8, 13, 23, 0.88);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 5px 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  line-height: 1;
  z-index: 2;
}

/* ═══════════════════════════════
   FAVORITE BUTTON — top right
═══════════════════════════════ */
.favorite-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  height: 34px;
  width: 34px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
  transition: transform 0.2s ease, background 0.2s ease;
}

.favorite-btn:hover {
  background: #fff;
  transform: scale(1.1);
}

.favorite-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.favorite-btn:hover .favorite-icon {
  transform: scale(1.15);
}

/* ═══════════════════════════════
   LISTING STATUS OVERLAY
═══════════════════════════════ */
.listing-status-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.95rem;
  padding: 8px;
  z-index: 2;
}

/* ═══════════════════════════════
   CARD BODY
═══════════════════════════════ */
.card-body {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  margin: 0;
}

.card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #0d1526;
  line-height: 1.1;
  margin: 0;
  min-height: 2.2em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-sub {
  font-size: 11px;
  color: #6b7590;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.card-specs {
  display: flex;
  gap: 10px;
  margin: 0;
  flex-wrap: wrap;
}

.card-spec {
  font-size: 11px;
  color: #6b7590;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ═══════════════════════════════
   SELLER ROW
═══════════════════════════════ */
.card-seller-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  margin-top: 2px;
  border-top: 1px solid #e8eaee;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.seller-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1e2f52;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.seller-name {
  font-size: 11px;
  font-weight: 500;
  color: #6b7590;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-location {
  font-size: 11px;
  color: #a0a8b8;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ═══════════════════════════════
   LEGACY CLASSES — kept for dealership/sold listing pages
═══════════════════════════════ */
.card-price {
  font-size: 1.1rem;
  font-weight: bold;
  color: #28a745;
  text-align: center;
  margin-bottom: 10px;
}

.card-text {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  margin-bottom: 8px;
}

.card-text1 {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
  margin-bottom: 8px;
}

.card-phonenumber {
  font-size: 0.9rem;
  color: #1e40af;
  text-align: center;
  margin-bottom: 8px;
  text-decoration: none;
  display: block;
}

.dealer-link {
  color: #6b7590;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.dealer-link:hover {
  color: #f5a623;
  text-decoration: underline;
}

/* ═══════════════════════════════
   VIEW ALL BUTTON
═══════════════════════════════ */
.ViewAllButtonContainer {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.ViewAllBTN {
  background-color: #1e40af;
  color: white;
  padding: 10px 22px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: 1px solid rgba(0, 86, 179, 0.35);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.ViewAllBTN:hover {
  background-color: #1e40af;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════
   UTILITY
═══════════════════════════════ */
.hidden {
  display: none;
}

/* ═══════════════════════════════
   RESPONSIVE
═══════════════════════════════ */
@media (max-width: 950px) {
  .card {
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  .CardsContainer {
    grid-template-columns: 1fr;
    max-width: 100%;
    padding: 12px;
    gap: 14px;
  }
}
