/* Base styles for both shortcode and Elementor widget */
.emv-most-viewed, .emv-mv-wrap {
    font-family: Arial, Helvetica, sans-serif;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.emv-most-viewed .emv-block-title, .emv-mv-wrap .emv-mv-block-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

/* Container for items */
.emv-most-viewed, .emv-mv-wrap .emv-mv-grid {
    width: 100%;
    box-sizing: border-box;
}

/* Grid layout */
.emv-most-viewed.emv-style-list, .emv-mv-wrap.emv-mv-style-grid .emv-mv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* List layout */
.emv-most-viewed.emv-style-list, .emv-mv-wrap.emv-mv-style-list .emv-mv-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Carousel layout */
.emv-most-viewed.emv-style-carousel, .emv-mv-wrap.emv-mv-style-carousel .emv-mv-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

/* Item styles */
.emv-item, .emv-mv-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #eee;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.emv-most-viewed.emv-style-carousel .emv-item, .emv-mv-wrap.emv-mv-style-carousel .emv-mv-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
}

.emv-item:hover, .emv-mv-item:hover {
    background-color: #f5f5f5;
}

.emv-mv-left {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emv-mv-number {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    background-color: #ff4d4d;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
}

.emv-content, .emv-mv-body {
    flex: 1;
}

.emv-heading, .emv-mv-heading {
    display: flex;
    gap: 10px;
    align-items: center;
}

.emv-thumb img, .emv-mv-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
}

.emv-title, .emv-mv-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #222;
}

.emv-mv-excerpt {
    margin-top: 6px;
    color: #555;
    font-size: 0.95rem;
}

.emv-meta, .emv-mv-meta {
    margin-top: 6px;
    font-size: 0.85rem;
    color: #777;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .emv-most-viewed.emv-style-list, .emv-mv-wrap.emv-mv-style-grid .emv-mv-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .emv-most-viewed.emv-style-carousel .emv-item, .emv-mv-wrap.emv-mv-style-carousel .emv-mv-item {
        flex: 0 0 250px;
    }
}

@media (max-width: 600px) {
    .emv-most-viewed.emv-style-list, .emv-mv-wrap.emv-mv-style-grid .emv-mv-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .emv-item, .emv-mv-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .emv-mv-left {
        flex: 0 0 36px;
        margin-bottom: 8px;
    }
    .emv-thumb img, .emv-mv-thumb img {
        width: 56px;
        height: 56px;
    }
    .emv-most-viewed.emv-style-carousel .emv-item, .emv-mv-wrap.emv-mv-style-carousel .emv-mv-item {
        flex: 0 0 200px;
    }
}

/* Slick Slider styles */
.emv-mv-wrap.emv-mv-style-carousel .emv-mv-grid.slick-initialized {
    display: flex;
    flex-wrap: nowrap;
}

.emv-mv-wrap.emv-mv-style-carousel .emv-mv-item.slick-slide {
    margin: 0 5px;
}

.emv-mv-wrap.emv-mv-style-carousel .slick-prev,
.emv-mv-wrap.emv-mv-style-carousel .slick-next {
    z-index: 10;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
}

.emv-mv-wrap.emv-mv-style-carousel .slick-prev:before,
.emv-mv-wrap.emv-mv-style-carousel .slick-next:before {
    font-size: 20px;
    color: #fff;
}