/* ===== SUV CAROUSEL & COMPARISON SYSTEM - MERGED STYLES WITH FIXED SCALING ===== */

/* ===== CAROUSEL STYLES ===== */
.suv-carousel {
  max-width: 1000px;
  margin: auto;
  cursor: pointer;
  font-family: sans-serif;
}

.suv-carousel-image {
  width: 100%;
  aspect-ratio: 2 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #FFF;
  position: relative;
  text-align:center;
}
.suv-carousel-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.carouseltxt {
    color: var(--suv-primary-color, #ec008c);
    text-align: center; 
    padding: 20px;
}

/* Loading spinner animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== COMPARISON SYSTEM STYLES ===== */

/* Main comparison container */
.suv-comparison-title {
  text-align: center;
  color: var(--suv-primary-color, #ec008c);
  margin: 0 0 15px 0;
  font-size: 1.4em;
  font-weight: bold;
}

.suv-comparison-container {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
}

/* Comments section */
.suv-comments-section {
  background: #fafafa;
  border-left: none;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  text-align: left;
}

.suv-comment-item {
  margin: 8px 0;
  font-weight: normal;
}

/* Grid layouts */
.suv-comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.suv-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

/* Individual comparison cards */
.suv-comparison-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ===== FIXED IMAGE CONTAINERS - PROPER SCALING ===== */

/* Base image container - all images aligned to bottom */
.suv-image-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: none;
  margin-bottom: 15px;
  background: #FFF;
}

/* Standard height for city and sport comparisons */
.suv-image-standard {
  height: 140px;
}

/* Taller container for heavy vehicles (tanks, etc.) */
.suv-image-tall {
  height: 140px;
}

/* Special container for bus comparison */
.suv-image-bus {
  height: 100px;
}

/* Background SUV image - always bottom aligned */
.suv-background-image {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 356px; /* Original SUV image height */
  width: auto; /* Maintain aspect ratio */
  transform: translateX(-50%);
  opacity: 0.3;
  z-index: 1;
  object-fit: contain;
  object-position: bottom center;
}

/* Overlay comparison image - same scale as SUV, bottom aligned */
.suv-overlay-image {
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 356px; /* Same scale as SUV images */
  width: auto; /* Maintain aspect ratio */
  transform: translateX(-50%);
  z-index: 2;
  object-fit: contain;
  object-position: bottom center;
}

/* Special scaling for bus comparison */
.suv-image-bus .suv-background-image {
  /* Scale SUV to match bus proportionally */
  height: calc(356px * 0.4); /* Scale down SUV relative to bus length */
  opacity: 0.6;
  transform: translateX(-50%) scale(0.8);
  z-index: 1;
}

.suv-image-bus .suv-overlay-image {
  /* Bus image at normal scale */
  height: 356px;
  z-index: 2;
}

/* Hover effects for better interaction */
.suv-image-container:hover .suv-background-image {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.suv-image-container:hover .suv-overlay-image {
  transform: translateX(-50%) scale(1.02);
  transition: transform 0.3s ease;
}

/* Parking visualization container */
.suv-parking-container {
  margin-bottom: 10px;
}

/* Card headers */
.suv-card-header {
  color: var(--suv-primary-color, #ec008c);
  margin: 0 0 15px 0;
  font-size: 0.9em;
  text-align: center;
  font-weight: bold;
}

/* Table style comparisons */
.suv-comparison-table {
  width: 100%;
  font-size: 0.75em;
  line-height: 1.3;
  border-collapse: collapse;
}

.suv-comparison-table td {
  padding: 3px 5px;
  vertical-align: top;
  text-align: left;
  border: 1px solid #ccc;
  color: #000 !important; /* Force black text color */
  background: #fff !important; /* Force white background */
}

/* Override for header cells to keep their styling */
.suv-comparison-table td.suv-table-header {
  background: #f8f9fa !important;
  color: var(--suv-primary-color, #ec008c) !important;
}

.suv-comparison-table td[colspan="2"] {
  border: 1px solid #ccc !important; /* Force borders on all colspan=2 cells */
}
.suv-comparison-table td[colspan="2"].suv-table-header {
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.suv-table-header {
  background: #f8f9fa !important;
  font-weight: bold;
  text-align: center;
  color: var(--suv-primary-color, #ec008c) !important;
}

.suv-table-label {
  font-weight: normal;
  background: #f8f9fa !important;
  text-align: right;
  padding-right: 8px;
  width: 25%;
  color: #000 !important;
}

.suv-table-suv {
  text-align: left;
  font-weight: normal;
}

.suv-table-comparison {
  text-align: left;
  font-weight: normal;
}

.suv-table-comment {
  font-weight: normal;
  text-align: center;
  font-size: 0.85em;
}

.suv-table-powerweight {
  font-size: 0.85em;
  color: #495057;
  text-align: left;
}

.suv-vehicle-name {
  font-weight: 600;
  color: #2c3e50;
}

/* Smaller comparison sections */
.suv-small-comparison {
  font-size: 0.75em;
  line-height: 1.3;
  text-align: center;
}

.suv-small-stat {
  margin-bottom: 3px;
}

.suv-small-highlight {
  font-weight: bold;
}

/* Buttons */
.suv-button-container {
  text-align: center;
  margin-top: 20px;
}

.suv-button {
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.suv-button-primary {
  background: var(--suv-primary-color, #ec008c);
  color: white;
}

.suv-button-primary:hover {
  background: var(--suv-primary-color-hover, #c8006f);
}

/* Footer notes */
.suv-footer-note {
  text-align: center;
  margin-top: 10px;
  font-size: 0.75em;
  color: #6c757d;
  font-style: italic;
}

/* Speed warning */
.suv-speed-warning {
  color: var(--suv-primary-color, #ec008c);
  font-weight: bold;
  margin: 5px 0;
  font-size: 0.9em;
}

/* Error states */
.suv-error {
  padding: 20px;
  color: #ec008c;
  background: #f8d7da;
  border-radius: 5px;
  border: 1px solid #f5c6cb;
}

/* Engine type indicators */
.suv-engine-type {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7em;
  font-weight: bold;
  text-transform: uppercase;
  margin-left: 5px;
}

/* Interactive elements */
a.toilet-link {
  cursor: pointer;
  color: var(--suv-primary-color, #ec008c);
  text-decoration: underline;
}

a.toilet-link:hover {
  color: var(--suv-primary-color-hover, #c8006f);
}

/* Tooltip and popup styles */
#toilet-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Responsive design - UPDATED WITH NEW IMAGE SCALING */
@media (max-width: 768px) {
  .suv-comparison-grid {
    grid-template-columns: 1fr;
  }
  
  .suv-bottom-grid {
    grid-template-columns: 1fr;
  }
  
  .suv-comparison-container {
    padding: 15px;
    margin: 10px 0;
  }
  
  .suv-comparison-table {
    font-size: 0.7em;
  }
  
  .suv-comparison-title {
    font-size: 1.2em;
  }
  
  /* Fixed responsive image scaling */
  .suv-image-standard {
    height: 100px;
  }
  
  .suv-image-tall {
    height: 120px;
  }
  
  .suv-image-bus {
    height: 80px;
  }
  
  .suv-background-image,
  .suv-overlay-image {
    height: 300px; /* Slightly smaller on mobile */
  }
  
  .suv-image-bus .suv-background-image {
    height: calc(300px * 0.4);
  }
  
  .suv-image-bus .suv-overlay-image {
    height: 300px;
  }
}

@media (max-width: 480px) {
  .suv-carousel {
    margin: 0 10px;
  }
  
  .suv-comparison-container {
    padding: 10px;
  }
  
  .suv-comparison-card {
    padding: 10px;
  }
  
  /* Fixed responsive image scaling for small screens */
  .suv-image-standard {
    height: 80px;
  }
  
  .suv-image-tall {
    height: 100px;
  }
  
  .suv-image-bus {
    height: 60px;
  }
  
  .suv-background-image,
  .suv-overlay-image {
    height: 250px;
  }
  
  .suv-image-bus .suv-background-image {
    height: calc(250px * 0.4);
  }
  
  .suv-image-bus .suv-overlay-image {
    height: 250px;
  }
}

/* Loading state */
.suv-image-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 0;
}

/* Hide loading animation when images are loaded */
.suv-image-container:has(img)::before {
  display: none;
}

/* RTL support */
[dir="rtl"] .suv-comparison-table td {
  text-align: right;
}

[dir="rtl"] .suv-table-suv {
  text-align: right;
}

[dir="rtl"] .suv-table-comparison {
  text-align: right;
}

[dir="rtl"] .suv-table-powerweight {
  text-align: right;
}

/* Accessibility improvements */
.suv-carousel:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.suv-button:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .suv-carousel {
    cursor: default;
  }
  
  .suv-button {
    display: none;
  }
  
  .suv-comparison-container {
    background: white;
    box-shadow: none;
  }
}