/* Product shelf — native horizontal scroll + snap (mobile swipe, desktop arrows) */

.home-top,
#home-tops .home-top,
.product-slider .home-countdown {
    overflow: visible;
}

#recommended,
#2x1 {
    background: transparent;
}

.ev-product-shelf {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 24px;
    box-sizing: border-box;
    z-index: 1;
}

.ev-shelf-track,
.ev-shelf-track.product-list,
.product-list.ev-shelf-track {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: nowrap !important;
    flex-wrap: nowrap !important;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 4px 0 8px;
    list-style: none;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    -ms-scroll-snap-type: mandatory;
    scroll-padding-inline: 4px;
    background: transparent;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ev-shelf-track::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.ev-shelf-track > li {
    -webkit-box-flex: 0 !important;
    -ms-flex: 0 0 72% !important;
    flex: 0 0 72% !important;
    max-width: 72% !important;
    width: 72% !important;
    margin: 0 12px 0 0;
    padding: 0 !important;
    list-style: none;
    box-sizing: border-box;
    scroll-snap-align: start;
    -ms-scroll-snap-coordinate: 0% 0%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

.ev-shelf-track .tiny-preview,
.ev-shelf-track .product {
    width: 100%;
    height: 100%;
    margin-bottom: 0;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    overflow: visible;
}

.ev-shelf-track > li:last-child {
    margin-right: 0;
}

.ev-shelf-track .tiny-preview > br {
    display: none;
}

.ev-shelf-track .tiny-preview > div:not(.image),
.ev-shelf-track .tiny-preview .lower-container,
.ev-shelf-track .tiny-preview .small-buy {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    width: 100%;
}

.ev-shelf-track .tiny-preview .ev-buy-wrap {
    margin-top: auto !important;
    width: 100%;
    text-align: center;
    padding-top: 16px;
}

.ev-shelf-nav {
    display: none !important;
    position: absolute !important;
    top: 50% !important;
    left: auto;
    right: auto;
    bottom: auto !important;
    z-index: 5;
    width: 40px;
    height: 40px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #6f1c48 !important;
    color: #fff !important;
    font-size: 28px;
    line-height: 40px !important;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    opacity: 0.92;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    -webkit-transition: opacity 0.15s ease, background 0.15s ease;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.ev-shelf-nav:hover,
.ev-shelf-nav:focus {
    opacity: 1;
    background: #5c1228 !important;
    color: #fff !important;
    outline: none;
    text-decoration: none;
}

.ev-shelf-nav.is-disabled,
.ev-shelf-nav:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.ev-shelf-prev {
    left: 4px !important;
    right: auto !important;
}

.ev-shelf-next {
    right: 4px !important;
    left: auto !important;
}

.ev-shelf-nav span {
    display: block;
    line-height: 40px;
    margin: 0;
}

@media screen and (max-width: 767px) {
    .ev-product-shelf {
        margin-left: -12px;
        margin-right: -12px;
    }

    .ev-shelf-track,
    .ev-shelf-track.product-list,
    .product-list.ev-shelf-track {
        padding-left: 12px;
        padding-right: 28px;
        scroll-padding-inline: 12px;
    }

    .ev-shelf-track > li {
        -ms-flex: 0 0 68% !important;
        flex: 0 0 68% !important;
        max-width: 68% !important;
        width: 68% !important;
    }

    .ev-shelf-track .tiny-preview .image {
        height: 140px;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 140px;
        flex: 0 0 140px;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }

    .ev-shelf-track .tiny-preview img {
        max-height: 130px;
        max-width: 100%;
        width: auto;
        height: auto;
        margin: auto;
    }

    #home-tops .bx-pager,
    .product-slider .bx-pager,
    #home-tops .bx-controls,
    .product-slider .bx-controls {
        display: none !important;
    }
}

@media screen and (min-width: 480px) and (max-width: 767px) {
    .ev-shelf-track > li {
        -ms-flex: 0 0 46% !important;
        flex: 0 0 46% !important;
        max-width: 46% !important;
        width: 46% !important;
    }
}

@media screen and (min-width: 768px) {
    .ev-product-shelf.ev-shelf-scrollable .ev-shelf-nav {
        display: block !important;
    }

    /* ~3 cards + peek → always clear that you can slide */
    .ev-shelf-track > li {
        -ms-flex: 0 0 30% !important;
        flex: 0 0 30% !important;
        max-width: 30% !important;
        width: 30% !important;
    }

    .ev-shelf-track,
    .ev-shelf-track.product-list,
    .product-list.ev-shelf-track {
        padding-left: 44px;
        padding-right: 44px;
        scroll-padding-inline: 44px;
    }

    .ev-shelf-prev {
        left: 0 !important;
    }

    .ev-shelf-next {
        right: 0 !important;
    }

    /* Ofertas Relámpago: always 4 products — center the row on desktop */
    #home-countdown .ev-shelf-track,
    #home-countdown .ev-shelf-track.product-list,
    #home-countdown .product-list.ev-shelf-track {
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
        scroll-padding-inline: 0;
        overflow-x: hidden !important;
    }

    #home-countdown .ev-shelf-track > li {
        -ms-flex: 0 0 calc(25% - 12px) !important;
        flex: 0 0 calc(25% - 12px) !important;
        max-width: calc(25% - 12px) !important;
        width: calc(25% - 12px) !important;
        margin: 0 6px;
    }

    #home-countdown .ev-shelf-nav {
        display: none !important;
    }
}

@media screen and (min-width: 992px) {
    /* ~4 cards + peek */
    .ev-shelf-track > li {
        -ms-flex: 0 0 22.5% !important;
        flex: 0 0 22.5% !important;
        max-width: 22.5% !important;
        width: 22.5% !important;
    }

    #home-countdown .ev-shelf-track > li {
        -ms-flex: 0 0 calc(25% - 16px) !important;
        flex: 0 0 calc(25% - 16px) !important;
        max-width: calc(25% - 16px) !important;
        width: calc(25% - 16px) !important;
        margin: 0 8px;
    }
}

@media screen and (min-width: 1200px) {
    /* ~4.5 cards — peek of the next one */
    .ev-shelf-track > li {
        -ms-flex: 0 0 20.5% !important;
        flex: 0 0 20.5% !important;
        max-width: 20.5% !important;
        width: 20.5% !important;
    }

    #home-countdown .ev-shelf-track > li {
        -ms-flex: 0 0 calc(25% - 20px) !important;
        flex: 0 0 calc(25% - 20px) !important;
        max-width: calc(25% - 20px) !important;
        width: calc(25% - 20px) !important;
        margin: 0 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ev-shelf-track {
        scroll-behavior: auto;
    }
}

/* Producer / gallery image shelves */
#producer-images .ev-shelf-track > li {
    text-align: center;
    background: #fafafa;
    border: 1px solid #eee;
    padding: 8px !important;
    box-sizing: border-box;
}

#producer-images .ev-shelf-track img {
    display: block;
    max-height: 200px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
}

#related-news .ev-shelf-track > li {
    box-sizing: border-box;
    -ms-flex: 0 0 85% !important;
    flex: 0 0 85% !important;
    max-width: 85% !important;
    width: 85% !important;
}

#related-news .ev-shelf-track .thumbnail {
    margin: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #eee;
    padding: 0;
    overflow: hidden;
}

#related-news .ev-shelf-track .thumbnail > a {
    display: block;
    line-height: 0;
}

#related-news .ev-shelf-track .thumbnail img {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: auto;
    margin: 0;
}

#related-news .ev-shelf-track .thumbnail .caption {
    padding: 12px 14px 16px;
}

#related-news .ev-shelf-track .thumbnail h3 {
    font-size: 14px;
    line-height: 1.35;
    margin: 0;
}

@media screen and (min-width: 768px) {
    #related-news .ev-shelf-track > li {
        -ms-flex: 0 0 46% !important;
        flex: 0 0 46% !important;
        max-width: 46% !important;
        width: 46% !important;
    }
}

@media screen and (min-width: 992px) {
    #related-news .ev-shelf-track > li {
        -ms-flex: 0 0 32% !important;
        flex: 0 0 32% !important;
        max-width: 32% !important;
        width: 32% !important;
    }
}

/* Override global button { position:relative } so shelf arrows stay absolute */
button.ev-shelf-nav,
.ev-shelf-nav {
    position: absolute !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    line-height: 40px !important;
    font-size: 28px !important;
    z-index: 5 !important;
}
