/* ====================================
   Performance Optimizations CSS
   ==================================== */

/* CLS Fix: Reserve space for common elements */
img:not(.logo) {
    max-width: 100%;
    height: auto;
}

/* Logo styles are now handled by main-style.css only - no duplication needed */

/* Reserve space for hero section */
.hero-section {
    min-height: 600px;
    contain: layout;
}

.hero-slide {
    min-height: 600px;
}

/* Reserve space for vehicle cards */
.vehicle-card {
    min-height: 400px;
}

.vehicle-card .vehicle-image {
    min-height: 250px;
    background-color: var(--color-bg-section);
    transition: var(--theme-transition);
}

/* Reserve space for service cards */
.service-card {
    min-height: 300px;
}

/* Reserve space for news cards */
.news-card {
    min-height: 350px;
}

.news-card .news-image {
    min-height: 200px;
    background-color: var(--color-bg-section);
    transition: var(--theme-transition);
}

/* Font loading is handled by Google Fonts with font-display: swap parameter */

/* Optimize animations - reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Lazy load images below the fold */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s;
}

/* Content visibility for off-screen sections */
.footer-section,
.partners-section,
.news-section,
.services-section,
.vehicles-section {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Reduce paint areas */
.vehicle-card,
.service-card,
.news-card {
    contain: layout style paint;
}

/* Optimize scrolling performance */
html {
    scroll-behavior: auto !important;
}

.swiper-wrapper {
    will-change: transform;
}

/* GPU acceleration for animations */
.animate__animated {
    will-change: opacity, transform;
}

/* Optimize hover effects - remove will-change for better performance */
.btn:hover,
.nav-link:hover,
.vehicle-card:hover,
.service-card:hover {
    transform: translateZ(0);
}

/* Optimize images */
img {
    content-visibility: auto;
}

/* Reduce repaints */
.hero-section,
.main-header {
    contain: layout style;
}
