/* Autos Grid Layout */
.grid-container-autos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Standard grid items */
.grid-item-autos {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 Aspect Ratio */
}

/* Larger center item */
.grid-item-autos.large {
    grid-column: span 2;
    grid-row: span 2;
    padding-bottom: 150%; /* Maintain 4:3 Ratio */
}

/* Image Styling */
.grid-item-autos img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ad Styling */
.grid-item-autos.ad img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay */
.overlay-autos {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: left;
}

/* Title */
.title-autos {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

/* Source */
.source-autos {
    font-size: 14px;
    margin: 2px 0;
}

/* Pagination Styles - Matches Deals.php EXACTLY */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination {
    display: flex;
    list-style: none;
    gap: 5px;
    padding: 0;
}

.pagination a {
    text-decoration: none;
    padding: 8px 12px;
    background: #ffcc00; /* Yellow/Orange like Deals.php */
    color: black;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s ease, transform 0.2s ease;
    display: inline-block;
}

.pagination a:hover {
    background: #ffaa00; /* Darker orange for hover effect */
    transform: scale(1.05);
}

.pagination .active {
    background: white;
    color: black;
    font-weight: bold;
    pointer-events: none;
}

/* 🚀 PROPER MOBILE FIX - MAINTAINS GRID */
@media screen and (max-width: 768px) {
    .grid-container-autos {
        display: grid !important; /* 💥 Ensures grid layout remains */
        grid-template-columns: repeat(2, 1fr) !important; /* 2 columns on tablets */
        gap: 5px !important; /* Maintain spacing */
    }
}

@media screen and (max-width: 480px) {
    .grid-container-autos {
        display: grid !important; /* 💥 Forces proper grid behavior */
        grid-template-columns: 1fr !important; /* 💥 FORCES 1 COLUMN ON PHONES */
        gap: 5px !important; /* Adjust spacing */
    }
}
