/**
 * Rocky Motors Inventory - Main CSS Bundle
 * Consolidated and optimized CSS architecture
 * 
 * This file imports all modular CSS components in the correct order
 * to ensure proper cascade and specificity management.
 */

/* 1. Core Foundation */
@import url('./core/variables.css');
@import url('./core/reset.css');
@import url('./core/utilities.css');

/* 2. Layout Components */
@import url('./layout/header.css');
@import url('./layout/search-bar.css');
@import url('./layout/footer.css');

/* 3. UI Components */
@import url('./components/buttons.css');
@import url('./components/inventory-grid.css');
@import url('./components/filters.css');
@import url('./components/modals.css');

/* 4. Themes and Responsive */
@import url('./themes/mobile.css');
@import url('./themes/animations.css');

/**
 * Global Layout Containers
 * Main page structure and containers
 */

/* Ensure correct background colors - match original design */
html, body {
  background-color: #f9f9f9;
}

/* All major containers should have white backgrounds */
.container,
.container-fluid,
#mainInventoryContent,
#inventoryMainContent,
.car-inventory,
section:not(.navbar):not(.mobile-fixed-header):not(.rl_footer4_component) {
  background-color: #ffffff;
}

/* Header should have the exact original blue color - High specificity */
.navbar.navbar,
.mobile-fixed-header .navbar.navbar {
  background-color: #036;
  color: white;
}

/* Header text should be white - High specificity */
.navbar.navbar *,
.mobile-fixed-header .navbar.navbar * {
  color: white;
}

/* Header links and navigation */
.navbar a,
.navbar .nav-link,
.mobile-fixed-header a,
.mobile-fixed-header .nav-link {
  color: white !important;
}

/* Header brand text */
.navbar-brand,
.navbar-brand *,
.mobile-fixed-header .navbar-brand,
.mobile-fixed-header .navbar-brand * {
  color: white !important;
}

/* Ensure search and filter areas have correct backgrounds */
.search-filter-bar {
  background-color: #f9f9f9 !important;
  border-bottom: 1px solid #e0e0e0 !important;
}

.search-section {
  gap: 15px;
  padding: 20px;
}

.filters {
  padding: 0 20px 20px 20px;
  margin-bottom: 0;
  border-bottom: 1px solid #e0e0e0;
}

.search-input {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  height: 44px;
  color: #333333;
}

/* Filter items should have light gray background with dark text - High specificity */
.desktop-only .search-filter-bar .filters .filter-item.filter-item {
  background-color: #f5f5f5;
  color: #333333;
  border: 1px solid #e0e0e0;
  flex: 1;
  min-width: 120px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  padding: 12px 16px;
  text-align: center;
  gap: 8px;
  white-space: nowrap;
  border-radius: 0;
  overflow: hidden;
  transition: background-color 0.2s ease;
}

.desktop-only .search-filter-bar .filters.filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  justify-content: flex-start;
  padding: 0 20px 20px 20px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-bottom: 0;
  border-bottom: 1px solid #e0e0e0;
}

.desktop-only .search-filter-bar .filters .filter-item i {
  color: #333333;
  font-size: 16px;
  margin-right: 8px;
}

.desktop-only .search-filter-bar .filters .filter-item:hover {
  background-color: #eaeaea;
  color: #333333;
}

/* Filter buttons scale down but stay on one line until mobile */
@media screen and (max-width: 900px) {
  .desktop-only .search-filter-bar .filters .filter-item {
    font-size: 12px !important;
    padding: 10px 8px !important;
    min-width: 100px !important;
  }
  
  .desktop-only .search-filter-bar .filters .filter-item i {
    margin-right: 4px !important;
  }
}

/* Sort button styling to match search bar height */
.rm-sort-button,
.sort-button {
  background-color: #f5f5f5 !important;
  color: #333333 !important;
  border: 1px solid #e0e0e0 !important;
  padding: 12px 24px !important;
  border-radius: 0 !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 44px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.rm-sort-button:hover,
.sort-button:hover {
  background-color: #e0e0e0 !important;
  color: #333333 !important;
  border-color: #e0e0e0 !important;
}

.rm-sort-button i,
.sort-button i {
  color: #333333 !important;
  font-size: 14px !important;
  margin-right: 8px !important;
}

/* Clear filters button styling */
.clear-filters-button {
  background-color: #ff0000 !important;
  color: #ffffff !important;
  border: none !important;
}

.clear-filters-button:hover {
  background-color: #cc0000 !important;
}

.clear-filters-button i,
.clear-filters-button span {
  color: #ffffff !important;
}

/* Ensure all content areas are white */
.inventory-closing-content,
.no-vehicles-message,
div[role="main"],
main {
  background-color: #ffffff !important;
}

/* Footer should have its own dark background */
.rl_footer4_component {
  background-color: #2c3e50 !important;
  color: #ffffff !important;
}

/* Additional white background overrides - specific to inventory content only */
.inventory-closing-content,
.no-vehicles-message {
  background-color: #ffffff !important;
}

/* Ensure footer container shows */
#footerContainer {
  display: block !important;
  background-color: transparent !important;
}

/* Main inventory content container */
#mainInventoryContent {
  position: relative;
  background-color: #f9f9f9;
  min-height: 100vh;
  width: 100%;
}

/* Inventory main content (hidden until loaded) */
#inventoryMainContent {
  background-color: #f9f9f9;
  width: 100%;
  min-height: 100vh;
}

/* Container styles */
.container-fluid {
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  background-color: #f9f9f9;
}

.container {
  width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/* Desktop container variants */
.desktop-container {
  width: 98%;
  margin: 0 auto;
  padding: 0 var(--space-xl) var(--space-xl) var(--space-xl);
  box-sizing: border-box;
  display: block;
}

.desktop-vehicle-container {
  width: 70%;
  margin: 0 auto;
  padding: var(--space-md);
  box-sizing: border-box;
  display: block;
}

/* Mobile container variants */
.mobile-container,
.mobile-vehicle-container {
  display: none;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Footer container */
#footerContainer {
  opacity: 1 !important;
  display: block !important;
  background-color: transparent !important;
}

#footerContainer.loaded {
  opacity: 1 !important;
}

/**
 * Responsive Visibility Classes
 * Control element visibility across breakpoints
 */

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

/* Tablet and mobile breakpoints */
@media screen and (max-width: 1023px) {
  .mobile-container,
  .mobile-vehicle-container,
  .mobile-modal,
  .mobile-only {
    display: block !important;
  }
  
  .desktop-only,
  .desktop-container,
  .desktop-vehicle-container {
    display: none !important;
  }
}

/**
 * Performance Optimizations
 * Improve rendering performance
 */

/* GPU acceleration for animated elements */
.car-card {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

/* Filter dialog should not have transform to maintain proper positioning */
.filter-dialog {
  backface-visibility: hidden;
}

/* Modal centering override - ensure perfect centering for price/finance modals only */
#requestPriceModal,
#creditApplicationModal,
.modal:not(.filter-dialog) {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: opacity 0.3s ease !important;
}

#requestPriceModal.show,
#creditApplicationModal.show,
.modal:not(.filter-dialog).show {
  display: flex !important;
  transform: translate(-50%, -50%) !important;
}

#requestPriceModal:not(.show),
#creditApplicationModal:not(.show),
.modal:not(.filter-dialog):not(.show) {
  transform: translate(-50%, -50%) !important;
}

/* Ensure filter dialogs use fixed positioning set by JavaScript */
.filter-dialog {
  transform: none !important;
}

/* Smooth scrolling containers */
.filter-dialog,
.modal-content,
.mobile-filter-content {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Optimize font rendering */
body,
input,
button,
select,
textarea {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/**
 * Print Styles
 * Optimize for printing
 */

@media print {
  /* Hide interactive elements */
  .mobile-fixed-header,
  .search-filter-bar,
  .action-buttons,
  .filter-dialog,
  .modal,
  .loading-overlay {
    display: none;
  }
  
  /* Optimize layout for print */
  .car-inventory {
    display: block;
    margin-top: 0;
  }
  
  .car-card {
    width: 100%;
    margin-bottom: var(--space-lg);
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  /* Ensure readable text */
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }
}

/**
 * Accessibility Enhancements
 * Improve accessibility and usability
 */

/* Focus management */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-primary);
  color: var(--text-white);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: var(--z-max);
}

.skip-link:focus {
  top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .car-card {
    border-width: 2px;
  }
  
  .btn {
    border-width: 2px;
  }
  
  .filter-item {
    border-width: 2px;
  }
}

/**
 * Dark Mode Support (Future Enhancement)
 * Prepared for dark mode implementation
 */

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1f2937;
    --bg-secondary: #374151;
    --bg-accent: #4b5563;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-light: #4b5563;
    --border-medium: #6b7280;
    --border-dark: #9ca3af;
  }
}

/**
 * Browser-Specific Fixes
 * Handle browser inconsistencies
 */

/* Safari-specific fixes */
@supports (-webkit-appearance: none) {
  .search-input,
  .mobile-search-input {
    -webkit-appearance: none;
  }
}

/* Firefox-specific fixes */
@-moz-document url-prefix() {
  .car-card {
    transform: translateZ(0);
  }
}

/* Edge-specific fixes */
@supports (-ms-ime-align: auto) {
  .car-card {
    transform: translateZ(0);
  }
}

/**
 * Performance Monitoring
 * CSS for performance debugging (development only)
 */

/* CRITICAL OVERRIDE - Filter alignment to match vehicle cards exactly */
.desktop-only .search-filter-bar .filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 20px !important;
  justify-content: flex-start !important;
  padding: 0 20px 30px 20px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  border-top: none !important;
  margin: 0 0 20px 0 !important;
}

.desktop-only .search-filter-bar .filter-item {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 0;
  overflow: hidden;
  width: calc(25% - 15px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 0;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  padding: 12px 16px;
  text-align: center;
  gap: 8px;
  white-space: nowrap;
  border-top: none;
  border-right: none;
  flex: none;
}

.desktop-only .search-filter-bar .filter-item:last-child {
  border-right: 1px solid #ddd;
}

.desktop-only .search-filter-bar .filter-item i {
  font-size: 16px;
  color: #333;
  margin-right: 8px;
}

.desktop-only .search-filter-bar .filter-item:hover {
  background-color: #eaeaea;
  color: #333;
}

/* FINAL OVERRIDE - Ensure filter spacing works */
.desktop-only .search-filter-bar .filters,
.search-filter-bar .filters,
div.filters {
  padding: 0 20px 20px 20px !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid #e0e0e0 !important;
}

/* MOBILE FILTER MODAL - Specific white backgrounds, not universal */
@media (max-width: 1023px) {
  .mobile-filter-modal .mobile-filter-content {
    background-color: white !important;
  }
  
  .mobile-filter-modal .mobile-filter-section {
    background-color: white !important;
    color: #333 !important;
  }
  
  .mobile-filter-modal .mobile-filter-section-header {
    background-color: white !important;
    color: #333 !important;
  }

  .mobile-filter-modal .mobile-filter-content {
    background: white !important;
  }

  .mobile-filter-modal .mobile-filter-header {
    background: #f8f9fa !important;
  }

  .mobile-filter-modal .mobile-filter-section-content {
    background: #f8f9fa !important;
  }

  .mobile-filter-modal .mobile-filter-section-header i {
    color: #666 !important;
  }

  .mobile-filter-modal .mobile-filter-close {
    color: #666 !important;
  }

  .mobile-filter-modal .show-results {
    background: #007bff !important;
    color: white !important;
  }

  .mobile-filter-modal .clear-filters {
    background: #f8f9fa !important;
    color: #666 !important;
  }

  .mobile-filter-modal .mobile-make-item.selected,
  .mobile-filter-modal .mobile-model-item.selected,
  .mobile-filter-modal .body-type-item.selected {
    background: #007bff !important;
    color: white !important;
  }

  /* Force mobile filter modal to slide up from bottom with buttons at bottom */
  .mobile-filter-modal .mobile-filter-content {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: 0 !important;
    background: white !important;
    border-radius: 12px 12px 0 0 !important;
    transform: translateY(100%) !important;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1) !important;
    will-change: transform !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    width: 100% !important;
  }

  .mobile-filter-modal.show .mobile-filter-content {
    transform: translateY(0) !important;
  }

  .mobile-filter-modal .mobile-filter-header {
    background: #f9f9f9 !important;
    flex-shrink: 0 !important;
  }

  .mobile-filter-modal .mobile-filter-sections {
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .mobile-filter-modal .mobile-filter-footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    background: white !important;
    position: relative !important;
    bottom: 0 !important;
  }

  /* Mobile Make/Model/Trim button fixes */
  .mobile-filter-modal .mobile-make-item,
  .mobile-filter-modal .mobile-model-item,
  .mobile-filter-modal .mobile-trim-item {
    background: white !important;
    color: #333 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    margin-bottom: 8px !important;
    height: 44px !important;
    padding: 12px !important;
  }

  .mobile-filter-modal .mobile-make-item.selected,
  .mobile-filter-modal .mobile-model-item.selected,
  .mobile-filter-modal .mobile-trim-item.selected {
    background: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
  }

  .mobile-filter-modal .mobile-make-item.selected *,
  .mobile-filter-modal .mobile-model-item.selected *,
  .mobile-filter-modal .mobile-trim-item.selected * {
    color: white !important;
    background: transparent !important;
  }

  .mobile-filter-modal .mobile-item-text {
    color: #333 !important;
    background: transparent !important;
  }

  .mobile-filter-modal .mobile-make-item.selected .mobile-item-text,
  .mobile-filter-modal .mobile-model-item.selected .mobile-item-text,
  .mobile-filter-modal .mobile-trim-item.selected .mobile-item-text {
    color: white !important;
    background: transparent !important;
  }

  /* Navigation arrows - sized to fit text */
  .mobile-filter-modal .mobile-nav-arrow {
    position: absolute !important;
    right: 8px !important;
    display: flex !important;
    align-items: center !important;
    color: #666 !important;
    font-size: 9px !important;
    gap: 2px !important;
    white-space: nowrap !important;
    background: #f5f5f5 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    border: 1px solid #e0e0e0 !important;
    height: 18px !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    z-index: 1 !important;
    width: 80px !important;
    justify-content: center !important;
  }

  .mobile-filter-modal .mobile-nav-arrow span {
    font-size: 9px !important;
    color: #666 !important;
    line-height: 1 !important;
  }

  .mobile-filter-modal .mobile-nav-arrow i {
    font-size: 7px !important;
    line-height: 1 !important;
  }

  .mobile-filter-modal .mobile-make-item.selected .mobile-nav-arrow,
  .mobile-filter-modal .mobile-model-item.selected .mobile-nav-arrow {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
  }

  .mobile-filter-modal .mobile-make-item.selected .mobile-nav-arrow span,
  .mobile-filter-modal .mobile-model-item.selected .mobile-nav-arrow span {
    color: white !important;
  }

  /* Body Type SVG styling for mobile */
  .mobile-filter-modal .body-type-item {
    background: white !important;
    color: #333 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12) !important;
    margin-bottom: 8px !important;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    gap: 8px !important;
    height: 90px !important;
  }

  .mobile-filter-modal .body-type-item.selected {
    background: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
  }

  .mobile-filter-modal .body-type-item svg {
    width: 36px !important;
    height: 20px !important;
    transition: all 0.2s ease !important;
  }

  .mobile-filter-modal .body-type-item svg path {
    transition: fill 0.2s ease, stroke 0.2s ease !important;
  }

  /* Selected body type - blue background, white text, white SVG */
  .mobile-filter-modal .body-type-item.selected {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
  }

  .mobile-filter-modal .body-type-item.selected * {
    color: white !important;
    background: transparent !important;
  }

  .mobile-filter-modal .body-type-item.selected svg {
    color: white !important;
    background: transparent !important;
  }

  .mobile-filter-modal .body-type-item.selected svg path {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
  }

  /* Additional SVG overrides for different SVG structures */
  .mobile-filter-modal .body-type-item.selected svg * {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    color: white !important;
    background: transparent !important;
  }

  .mobile-filter-modal .body-type-item.selected .body-type-icon svg path {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
  }

  .mobile-filter-modal .body-type-item.selected .body-type-icon svg * {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
  }

  /* Override any currentColor references */
  .mobile-filter-modal .body-type-item.selected svg[stroke="currentColor"] path,
  .mobile-filter-modal .body-type-item.selected svg[fill="currentColor"] path {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
  }

  /* Handle SVGs that use currentColor */
  .mobile-filter-modal .body-type-item.selected svg {
    color: white !important;
    background: transparent !important;
  }

  /* Remove white squares - target all possible SVG background elements */
  .mobile-filter-modal svg,
  .mobile-filter-modal svg * {
    background: transparent !important;
    background-color: transparent !important;
  }

  /* Override SVG default styling completely */
  .mobile-filter-modal .body-type-item.selected svg {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
  }

  .mobile-filter-modal .body-type-item.selected svg rect {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  .mobile-filter-modal .body-type-item.selected svg circle {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  .mobile-filter-modal .body-type-item.selected svg polygon {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  .mobile-filter-modal .body-type-item.selected svg ellipse {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  /* Target any background/base shapes */
  .mobile-filter-modal .body-type-item.selected svg [fill="#ffffff"],
  .mobile-filter-modal .body-type-item.selected svg [fill="white"],
  .mobile-filter-modal .body-type-item.selected svg [fill="#fff"] {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  /* Additional overrides for stubborn SVGs */
  .mobile-filter-modal .body-type-item.selected svg g,
  .mobile-filter-modal .body-type-item.selected svg g * {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  /* Override any inline styles or attributes */
  .mobile-filter-modal .body-type-item.selected svg[style] *,
  .mobile-filter-modal .body-type-item.selected svg *[style] {
    fill: transparent !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: transparent !important;
    background-color: transparent !important;
  }

  /* Nuclear option - override everything in selected SVGs */
  .mobile-filter-modal .body-type-item.selected svg > *,
  .mobile-filter-modal .body-type-item.selected svg > * > *,
  .mobile-filter-modal .body-type-item.selected svg > * > * > * {
    fill: none !important;
    stroke: white !important;
    stroke-width: 2px !important;
    background: none !important;
    background-color: none !important;
  }

  /* Force SVG to only show stroke, no fill at all */
  .mobile-filter-modal .body-type-item.selected svg[fill],
  .mobile-filter-modal .body-type-item.selected svg *[fill] {
    fill: none !important;
    stroke: white !important;
    stroke-width: 2px !important;
  }

  /* Remove any SVG backgrounds or borders */
  .mobile-filter-modal .body-type-item.selected svg,
  .mobile-filter-modal .body-type-item.selected svg * {
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
  }

  /* HIDE white background rect elements - they have inline fill attributes that override CSS */
  .mobile-filter-modal .body-type-item.selected svg rect[fill="#E5E5E5"],
  .mobile-filter-modal .body-type-item.selected svg rect[fill="#FAFAFA"],
  .mobile-filter-modal .body-type-item.selected svg rect[fill="white"],
  .mobile-filter-modal .body-type-item.selected svg rect[fill="#fff"],
  .mobile-filter-modal .body-type-item.selected svg rect[fill="#ffffff"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Hide large transform rects (background canvases) */
  .mobile-filter-modal .body-type-item.selected svg rect[width="15227"],
  .mobile-filter-modal .body-type-item.selected svg rect[width="673.004"],
  .mobile-filter-modal .body-type-item.selected svg rect[height="5237"],
  .mobile-filter-modal .body-type-item.selected svg rect[height="168"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Hide small white border/background rects for SUV, Van, Coupe */
  .mobile-filter-modal .body-type-item.selected svg rect[width="46"],
  .mobile-filter-modal .body-type-item.selected svg rect[width="47"],
  .mobile-filter-modal .body-type-item.selected svg rect[width="116"],
  .mobile-filter-modal .body-type-item.selected svg rect[width="112.004"],
  .mobile-filter-modal .body-type-item.selected svg rect[width="133"],
  .mobile-filter-modal .body-type-item.selected svg rect[height="20"],
  .mobile-filter-modal .body-type-item.selected svg rect[height="51"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Hide rects with stroke (border boxes) */
  .mobile-filter-modal .body-type-item.selected svg rect[stroke="#DDDDDD"],
  .mobile-filter-modal .body-type-item.selected svg rect[stroke],
  .mobile-filter-modal .body-type-item.selected svg rect[rx="7.5"],
  .mobile-filter-modal .body-type-item.selected svg rect[rx="16"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Hide rects with negative positions (usually background/container rects) */
  .mobile-filter-modal .body-type-item.selected svg rect[x^="-"],
  .mobile-filter-modal .body-type-item.selected svg rect[y^="-"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Only show path elements (the actual car icons) */
  .mobile-filter-modal .body-type-item.selected svg path {
    display: block !important;
    fill: none !important;
    stroke: white !important;
    stroke-width: 1.5px !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .mobile-filter-modal .body-type-item.selected label {
    color: white !important;
  }

  .mobile-filter-modal .body-type-item.selected .mobile-item-text {
    color: white !important;
  }

  .mobile-filter-modal .body-type-item label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    color: #333 !important;
  }

  .mobile-filter-modal .body-type-item.selected label {
    color: white !important;
  }

  .mobile-filter-modal .body-type-item input[type="checkbox"] {
    display: none !important;
  }

  /* Mobile Year & Mileage Range - Force modern styling */
  .mobile-filter-modal .mobile-range-section {
    background: white !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  }

  .mobile-filter-modal .mobile-range-header h4 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
  }

  .mobile-filter-modal .mobile-range-inputs {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .mobile-filter-modal .mobile-range-inputs input {
    flex: 1 !important;
    min-width: 0 !important;
    padding: 10px 12px !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    background: #f8f9fa !important;
    text-align: center !important;
  }

  .mobile-filter-modal .mobile-range-inputs span {
    font-size: 14px !important;
    color: #666 !important;
    font-weight: 500 !important;
  }

  .mobile-filter-modal .mobile-range-slider-container {
    height: 44px !important;
    margin: 12px 0 0 0 !important;
  }

  .mobile-filter-modal .mobile-range-slider {
    height: 44px !important;
  }

  /* Mobile More Filters - Force modern styling */
  .mobile-filter-modal .mobile-filter-group {
    background: white !important;
    border-radius: 12px !important;
    padding: 16px !important;
    margin-bottom: 16px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  }

  .mobile-filter-modal .mobile-filter-group h4 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
  }

  .mobile-filter-modal .mobile-filter-group .filter-option {
    display: flex !important;
    align-items: center !important;
    padding: 12px !important;
    background: #f8f9fa !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
  }

  .mobile-filter-modal .mobile-filter-group .filter-option.selected {
    background: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
  }

  .mobile-filter-modal #mobileMoreFiltersContent {
    background: #f8f9fa !important;
    padding: 16px !important;
  }

  .mobile-filter-modal .color-options,
  .mobile-filter-modal .transmission-options,
  .mobile-filter-modal .drivetrain-options,
  .mobile-filter-modal .fuel-type-options,
  .mobile-filter-modal .cylinders-options,
  .mobile-filter-modal .mobile-filter-options-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Mobile Filter Buttons - JavaScript Generated */
  .mobile-filter-modal .mobile-filter-button {
    background: #f8f9fa !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }

  .mobile-filter-modal .mobile-filter-button.selected {
    background: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
  }

  .mobile-filter-modal .mobile-filter-button .color-swatch {
    width: 20px !important;
    height: 20px !important;
    border-radius: 4px !important;
    border: 2px solid #ddd !important;
  }

  .mobile-filter-modal .mobile-filter-button.selected .color-swatch {
    border-color: white !important;
  }

  /* Mobile Sort Modal - Force white theme to match filter modal */
  .mobile-sort-modal .mobile-sort-content {
    background: white !important;
  }

  .mobile-sort-modal .mobile-sort-header {
    background: #f8f9fa !important;
    border-bottom: 1px solid #e0e0e0 !important;
  }

  .mobile-sort-modal .mobile-sort-header h2 {
    color: #333 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
  }

  .mobile-sort-modal .mobile-sort-close {
    color: #666 !important;
  }

  .mobile-sort-modal .mobile-sort-options {
    background: white !important;
  }

  .mobile-sort-modal .mobile-sort-option {
    background: white !important;
    color: #333 !important;
  }

  .mobile-sort-modal .mobile-sort-option:active {
    background-color: #f5f5f5 !important;
  }

  .mobile-sort-modal .mobile-sort-option i {
    color: #007bff !important;
  }
}

/* Tablet-specific styles removed - tablets now use mobile view up to 1023px */

/* Desktop styles - 1024px and above */
@media (min-width: 1024px) {
  /* Show desktop elements */
  .desktop-only {
    display: block !important;
  }
  
  .mobile-only {
    display: none !important;
  }
  
  /* Desktop search bar */
  .search-filter-bar {
    display: block !important;
  }
  
  .search-filter-bar .filters {
    display: flex !important;
  }
  
  /* Desktop inventory grid */
  .car-inventory {
    margin-top: var(--header-height) !important;
    padding: 0 20px !important;
    gap: 20px !important;
  }
  
  /* Desktop car cards - 3-4 columns */
  .car-card {
    width: calc(33.333% - 14px) !important;
  }
  
  /* Desktop header */
  .mobile-fixed-header {
    display: none !important;
  }
  
  .navbar {
    display: none !important;
  }
}

/* Large desktop screens - 4 columns */
@media (min-width: 1367px) {
  .car-card {
    width: calc(25% - 15px) !important;
  }
}

/* Extra large desktop screens - 4 columns */
@media (min-width: 1600px) {
  .car-card {
    width: calc(25% - 15px) !important;
  }
}

/* Uncomment for development debugging */
/*
.debug-performance * {
  outline: 1px solid red;
}

.debug-performance .car-card {
  background: rgba(255, 0, 0, 0.1);
}
*/
