/**
 * Mobile Vehicle Card Layout Fix
 * 
 * This CSS file fixes the layout issues with vehicle cards on mobile devices,
 * specifically ensuring that the price and "Select Vehicle" button are properly
 * displayed within the vehicle card and don't overflow outside the viewport.
 */

/* Fix for vehicle cards on mobile */
@media (max-width: 768px) {
  /* Ensure the vehicle row has proper containment */
  .md-vehicle-list-row {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 16px !important;
  }

  /* Fix image column sizing */
  .md-vehicle-image-col {
    width: 100% !important;
    flex: 0 0 auto !important;
    margin-right: 0 !important;
    margin-bottom: 12px !important;
    display: flex !important;
    justify-content: center !important;
  }

  .md-vehicle-image-col img {
    width: 140px !important;
    height: 90px !important;
    object-fit: cover !important;
  }

  /* Fix details column to take full width */
  .md-vehicle-details-col {
    width: 100% !important;
    flex: 1 1 auto !important;
    margin-bottom: 12px !important;
  }

  /* Fix action column (price and button) */
  .md-vehicle-action-col {
    width: 100% !important;
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    padding: 12px 0 0 0 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* Price wrapper */
  .md-vehicle-price-wrapper {
    width: 100% !important;
    margin-bottom: 12px !important;
    text-align: center !important;
  }

  /* Price label */
  .md-price-label {
    display: block !important;
    margin-bottom: 4px !important;
    font-size: 14px !important;
  }

  /* Price value */
  .md-vehicle-price {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--md-primary, #00a651) !important;
  }

  /* Action label */
  .md-action-label {
    display: none !important;
  }

  /* Select vehicle button */
  .md-select-vehicle-btn {
    width: 100% !important;
    padding: 10px 16px !important;
    font-size: 16px !important;
    margin-top: 8px !important;
    background-color: var(--md-primary, #00a651) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  }

  /* Includes text */
  .md-vehicle-includes {
    width: 100% !important;
    text-align: center !important;
    margin-top: 8px !important;
    font-size: 12px !important;
    color: #666 !important;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  /* Ensure the vehicle row has proper containment */
  .md-vehicle-list-row {
    padding: 12px !important;
  }

  /* Make the button more prominent */
  .md-select-vehicle-btn {
    padding: 12px 16px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
  }
}

/* Fix for touch devices */
@media (hover: none) and (pointer: coarse) {
  /* Increase touch target size */
  .md-select-vehicle-btn {
    min-height: 48px !important;
  }

  /* Remove hover effects that can cause issues on touch devices */
  .md-vehicle-list-row:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  }
}
