.custom-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.31);
    padding: 10px 0;
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
}

/* Esconde barra de rolagem no desktop */
@media (min-width: 1024px) {
    .carousel-container {
        scrollbar-width: none;              /* Firefox */
    }
    .carousel-container::-webkit-scrollbar {
        display: none;                     /* Chrome/Safari */
    }
}

/* Ativa cursor de "arrastar" apenas no mobile */
@media (max-width: 1023px) {
    .carousel-container {
        cursor: grab;
    }

    .carousel-container:active {
        cursor: grabbing;
    }
}

.carousel {
    flex: 0 0 calc(100% / var(--items-per-view));
    min-width: calc(100% / var(--items-per-view));
    height: 250px;
    box-sizing: border-box;
    padding: 10px 0;
}

.carousel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
}

/* Botões de navegação */
button.prev,
button.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
}

button.prev { left: 10px; }
button.next { right: 10px; }

button.prev:hover,
button.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Quantidade de itens visíveis por resolução */
:root {
    --items-per-view: 2;
}

@media (min-width: 1280px) {
    :root { --items-per-view: 6; }
}
@media (min-width: 1366px) {
    :root { --items-per-view: 6; }
}
@media (min-width: 1440px) {
    :root { --items-per-view: 6; }
}
@media (min-width: 1600px) {
    :root { --items-per-view: 8; }
}
@media (min-width: 1680px) {
    :root { --items-per-view: 8; }
}
@media (min-width: 1920px) {
    :root { --items-per-view: 8; }
}
