.nepalevs-latest-listings {
    padding: 20px 0;
}

/* Style for the tabs and View All EVs row */
.nepalevs-latest-listings .tabs-and-view-all {
    display: flex !important; /* Ensure flexbox is applied, overriding any external styles */
    justify-content: space-between !important; /* Align tabs on the left, View All EVs on the right */
    align-items: center !important; /* Vertically center the tabs and link */
    flex-wrap: nowrap !important; /* Prevent wrapping to a new row */
    margin-bottom: 20px;
}

/* Category Tabs */
.nepalevs-latest-listings .category-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: nowrap; /* Prevent tabs from wrapping */
}

/* Style for the View All EVs wrapper */
.nepalevs-latest-listings .view-all-wrapper {
    flex-shrink: 0; /* Prevent the link from shrinking */
}

.nepalevs-latest-listings .view-all {
    font-size: 15px;
    color: #28a745;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap; /* Prevent the link text from wrapping */
}

.nepalevs-latest-listings .view-all:hover {
    text-decoration: underline;
}

.nepalevs-latest-listings .swiper-container {
    width: 100%;
    padding-bottom: 30px;
}

.nepalevs-latest-listings .swiper-slide {
    width: 300px; /* Fixed width for consistency */
    height: 320px; /* Height for desktop */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.nepalevs-latest-listings .listing-card {
    text-align: left; /* Align text to the left */
    padding: 10px; /* Reduced overall padding to create space for inner padding */
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative; /* For positioning the link and badge */
}

.nepalevs-latest-listings .listing-card a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-decoration: none; /* Remove underline from link */
    color: inherit; /* Inherit text color */
}

.nepalevs-latest-listings .listing-card:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); /* Hover effect */
    transform: translateY(-2px); /* Slight lift on hover */
    transition: all 0.3s ease; /* Smooth transition */
}

.nepalevs-latest-listings .listing-image {
    width: 100%;
    height: 200px; /* Increased height for larger car image */
    padding: 10px; /* Add padding around the image */
    box-sizing: border-box; /* Ensure padding doesn’t increase the size */
}

.nepalevs-latest-listings .listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure images fit without distortion */
    border-radius: 8px; /* Slight border radius for the image */
}

.nepalevs-latest-listings .listing-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 8px 10px 4px; /* Add padding to the sides */
}

.nepalevs-latest-listings .listing-price {
    font-size: 16px; /* Slightly larger font size for price */
    font-weight: bold;
    color: #28a745; /* Green color for price */
    margin: 0 10px 8px; /* Add padding to the sides */
}

.nepalevs-latest-listings .listing-specs {
    display: flex;
    flex-direction: row; /* Display specs side by side in a single row */
    justify-content: space-between; /* Distribute space evenly */
    gap: 6px; /* Space between each spec */
    margin: 0 10px; /* Add padding to the sides */
    margin-top: auto; /* Push specs to the bottom */
}

.nepalevs-latest-listings .spec-item {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the content within each spec */
    flex: 1; /* Each spec takes equal space */
    font-size: 12px;
    color: #333;
    padding: 6px 8px; /* Adjusted padding for a tighter fit */
    border-radius: 5px; /* Rounded corners for each spec */
    text-align: center; /* Center the text */
}

.nepalevs-latest-listings .spec-item.range {
    background: #e6f0fa; /* Light blue for range */
}

.nepalevs-latest-listings .spec-item.battery {
    background: #e6f0fa; /* Light green for battery */
}

.nepalevs-latest-listings .spec-item.transmission {
    background: #e6f0fa; /* Light red for transmission */
}

.nepalevs-latest-listings .spec-item img {
    width: 20px; /* Larger icon size */
    height: 20px;
    margin-right: 8px; /* Adjusted spacing */
}

/* Add white round background to range icon only */
.nepalevs-latest-listings .spec-item.range-icon img {
    background: #fff; /* White background */
    border-radius: 50%; /* Round shape */
    padding: 4px; /* Padding to create space around the icon */
    box-sizing: content-box; /* Ensure padding doesn’t affect the icon size */
}

/* Category Tabs */
.nepalevs-latest-listings .category-tab {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    padding-bottom: 5px;
    position: relative;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevent tab text from wrapping */
}

.nepalevs-latest-listings .category-tab:hover {
    color: #28a745; /* Green color on hover */
}

.nepalevs-latest-listings .category-tab.active {
    color: #28a745; /* Green color for active tab */
}

.nepalevs-latest-listings .category-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: #28a745; /* Green underline for active tab */
}

/* Style for "No listings found" message to match the screenshot */
.nepalevs-latest-listings .swiper-slide p {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin: 0;
}

/* Latest Launch Badge */
.nepalevs-latest-listings .latest-launch-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #cc0000; /* Deeper red background for visibility */
    color: #fff; /* White text */
    font-size: 12px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 10; /* Ensure badge is above the link */
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    .nepalevs-latest-listings .tabs-and-view-all {
        /* Removed flex-direction: column to keep the tabs and View All EVs in the same row */
        align-items: center !important;
        gap: 10px; /* Reduce gap for mobile */
    }

    .nepalevs-latest-listings .swiper-slide {
        width: 180px; /* Keep the reduced width for mobile */
        height: 300px; /* Height for mobile */
    }

    .nepalevs-latest-listings .listing-image {
        height: 180px; /* Increased image height for mobile */
        padding: 8px; /* Slightly smaller padding for mobile */
    }

    .nepalevs-latest-listings .view-all {
        font-size: 12px; /* Smaller font size for mobile */
    }

    .nepalevs-latest-listings .listing-title {
        font-size: 14px;
        margin: 6px 8px 3px; /* Adjusted for mobile */
    }

    .nepalevs-latest-listings .listing-price {
        font-size: 14px; /* Slightly smaller on mobile */
        margin: 0 8px 6px; /* Adjusted for mobile */
    }

    .nepalevs-latest-listings .listing-specs {
        margin: 0 8px; /* Adjusted for mobile */
        gap: 4px; /* Smaller gap for mobile */
    }

    .nepalevs-latest-listings .spec-item {
        font-size: 10px;
        padding: 4px 6px; /* Smaller padding for mobile */
    }

    .nepalevs-latest-listings .spec-item img {
        width: 16px; /* Slightly larger icons for mobile */
        height: 16px;
        margin-right: 6px; /* Adjusted for mobile */
    }

    .nepalevs-latest-listings .spec-item.range-icon img {
        padding: 3px; /* Slightly smaller padding for mobile */
    }

    .nepalevs-latest-listings .category-tabs {
        gap: 10px; /* Reduce gap between tabs on mobile */
    }

    .nepalevs-latest-listings .category-tab {
        font-size: 14px; /* Smaller font size for mobile */
        padding-bottom: 4px;
    }

    .nepalevs-latest-listings .latest-launch-badge {
        font-size: 10px; /* Smaller badge text on mobile */
        padding: 4px 8px; /* Adjusted padding for mobile */
    }
}