
/* Responsive Grid System for Better Layout */
.responsive-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
}

/* Dealer Cards Grid */
.dealer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Payment Methods Grid */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

/* Awards Section Grid */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    place-items: center;
    margin: 2rem 0;
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    .dealer-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .payment-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .awards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .responsive-grid {
        gap: 0.75rem;
    }
}

/* Tablet Adjustments */
@media (min-width: 577px) and (max-width: 768px) {
    .dealer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
    
    .awards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* Desktop Large */
@media (min-width: 1200px) {
    .dealer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .awards-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2.5rem;
    }
}

/* Flexbox Fallbacks for older browsers */
@supports not (display: grid) {
    .dealer-grid,
    .payment-grid,
    .awards-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .dealer-grid > *,
    .payment-grid > *,
    .awards-grid > * {
        flex: 1 1 300px;
        margin: 0.5rem;
    }
}

/* Image Optimization */
.optimized-image {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.optimized-image:hover {
    opacity: 0.9;
}

/* Loading States */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Print Styles */
@media print {
    .dealer-grid,
    .payment-grid,
    .awards-grid {
        display: block;
    }
    
    .dealer-grid > *,
    .payment-grid > *,
    .awards-grid > * {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}
