/**
 * HOTFIX UI-003 — VEHICLE MEDIA CARD FOUNDATION
 *
 * Transforms Marketplace Card whitespace into the Vehicle Media Area.
 * Presentation Layer ONLY. No Business Logic changes.
 *
 * Vehicle Media is part of the Listing — never an independent component.
 * Marketplace Feed always uses the Listing Featured Image (thumbnail).
 *
 * Image Spec:
 *   Desktop: 80 × 80 px
 *   Tablet : 76 × 76 px
 *   Mobile : 72 × 72 px
 *   Radius : 12px
 *   Object : cover
 *   Overflow: hidden
 *   Background: #F5F5F5
 *   Ratio  : 1:1
 *   Lazy   : loading="lazy" (set in markup)
 *
 * Responsive Rules:
 *   Desktop: Image left, info right.
 *   Tablet : Same as desktop.
 *   Mobile : No wrap. No overlapping price. No covering buttons.
 *
 * Use with mp_render_vehicle_media() from marketplace-card.php.
 * One component. No UI duplication.
 *
 * @package XOS\Presentation\Styles
 * @version 1.0.0 — HOTFIX UI-003
 * @since   HOTFIX UI-003
 */

/* ===========================================================
   1. VEHICLE MEDIA ROW — image left, info right (DESKTOP BASE)
   =========================================================== */

.mp-media-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.mp-media-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* ===========================================================
   2. VEHICLE MEDIA — square image / placeholder (80×80)
   =========================================================== */

.mp-media {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 12px;
  overflow: hidden;
  background: #F5F5F5;
  aspect-ratio: 1 / 1;
  align-self: flex-start;
}

.mp-media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

/* Placeholder state — avatar / cargo / vehicle type glyph */
.mp-media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-media-placeholder-icon {
  font-size: 1.75rem;
  line-height: 1;
  opacity: 0.55;
  user-select: none;
  filter: grayscale(20%);
}

/* ===========================================================
   3. COMPACT BODY LAYOUT — keep existing hierarchy tight
   =========================================================== */

/* Header — badge row already, compact inside media body */
.mp-media-body .mp-header {
  margin-bottom: 2px;
}

.mp-media-body .mp-badge {
  font-size: 0.6875rem;
  padding: 1px 6px;
}

.mp-media-body .mp-time-ago {
  font-size: 0.625rem;
}

/* Route — hero remains, ellipsis prevents overflow */
.mp-media-body .mp-route {
  margin-bottom: 2px;
}

/* Info row — price always stays visible (never overlaid) */
.mp-media-body .mp-info-row {
  margin-bottom: 2px;
}

.mp-media-body .mp-info-price {
  flex-shrink: 0;
  white-space: nowrap;
}

.mp-media-body .mp-info-time,
.mp-media-body .mp-info-capacity,
.mp-media-body .mp-info-fomo {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bottom row — CTA + author never hidden */
.mp-media-body .mp-bottom-row {
  margin-top: auto;
  padding-top: 2px;
}

/* ===========================================================
   4. HERO CARD — featured media keeps alignment
   =========================================================== */

.mp-card--hero .mp-media {
  width: 80px;
  height: 80px;
}

.mp-card--hero .mp-media-body .mp-route {
  font-size: 1rem;
}

/* ===========================================================
   5. RESPONSIVE — TABLET (641px – 768px): 76×76
   =========================================================== */

@media (min-width: 641px) and (max-width: 768px) {
  .mp-media,
  .mp-card--hero .mp-media {
    width: 76px;
    height: 76px;
  }

  .mp-media-placeholder-icon {
    font-size: 1.625rem;
  }

  .mp-media-row {
    gap: 8px;
  }
}

/* ===========================================================
   6. RESPONSIVE — MOBILE (≤ 640px): 72×72
   No wrap. No overlapping price. No covering buttons.
   =========================================================== */

@media (max-width: 640px) {
  .mp-media,
  .mp-card--hero .mp-media {
    width: 72px;
    height: 72px;
  }

  .mp-media-placeholder-icon {
    font-size: 1.5rem;
  }

  .mp-media-row {
    gap: 8px;
  }

  /* Info row: never wraps on mobile — price stays on the line */
  .mp-media-body .mp-info-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .mp-media-body .mp-info-time,
  .mp-media-body .mp-info-capacity,
  .mp-media-body .mp-info-fomo {
    flex-shrink: 1;
    max-width: 55%;
  }

  .mp-media-body .mp-info-price {
    margin-left: auto;
    font-size: 0.8125rem;
  }

  /* Bottom row: buttons always visible, never covered */
  .mp-media-body .mp-bottom-row {
    flex-wrap: nowrap;
  }

  .mp-media-body .mp-actions {
    flex-shrink: 0;
  }

  .mp-media-body .mp-driver-name {
    max-width: 64px;
  }
}

/* ===========================================================
   7. REDUCED MOTION
   =========================================================== */

@media (prefers-reduced-motion: reduce) {
  .mp-media-img {
    transition: none;
  }
}

/* ===========================================================
   8. PERFORMANCE
   =========================================================== */

.mp-media-img {
  -webkit-tap-highlight-color: transparent;
  background: #F5F5F5;
}