/* assets/css/infinite-slider.css */
.bricks-infinite-slider-container {
    width: 100%;
    /* Flex column and gap are set inline via PHP */
}

.bricks-infinite-slider-wrapper {
    width: 100%;
    overflow-x: auto;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.bricks-infinite-slider-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.bricks-infinite-slider-wrapper.is-dragging {
    cursor: grabbing;
}

.bricks-infinite-slider-track {
    display: flex;
    flex-wrap: nowrap;
    min-height: 100px; /* Ensure it has height in the builder when empty */
    /* The gap is set inline via PHP based on settings */
}

/* Ensure children (the review cards) don't shrink and maintain their width */
.bricks-infinite-slider-track > * {
    flex-shrink: 0;
    /* Hide scrollbars inside the cards if they become scrollable on mobile */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bricks-infinite-slider-track > *::-webkit-scrollbar {
    display: none;
}

/* Specifically target Bricks blocks/divs inside the track */
.bricks-infinite-slider-track > .brxe-block,
.bricks-infinite-slider-track > .brxe-div {
    flex-shrink: 0;
    max-width: none;
}

/* --- VARYING WIDTHS LOGIC --- */
/* This automatically applies different widths to the items in the loop */
.bricks-infinite-slider-track.has-varying-widths > * {
    width: 500px; /* Default fallback - increased from 400px */
    white-space: normal; /* Ensure text wraps inside the fixed width */
}

/* Increased all widths by roughly 100px to 150px to make them wider */
.bricks-infinite-slider-track.has-varying-widths > *:nth-child(5n + 1) { width: 550px; }
.bricks-infinite-slider-track.has-varying-widths > *:nth-child(5n + 2) { width: 450px; }
.bricks-infinite-slider-track.has-varying-widths > *:nth-child(5n + 3) { width: 650px; }
.bricks-infinite-slider-track.has-varying-widths > *:nth-child(5n + 4) { width: 400px; }
.bricks-infinite-slider-track.has-varying-widths > *:nth-child(5n + 5) { width: 500px; }

/* --- RESPONSIVE LOGIC (WIDTH & HEIGHT) --- */
@media (max-width: 767px) {
    .bricks-infinite-slider-track.has-varying-widths > * {
        width: 70vw !important; /* Reduced from 85vw to make them less wide */
    }
    
    /* Reduce height by limiting max-height and padding */
    .bricks-infinite-slider-track > * {
        max-height: 260px; /* Reduced from 320px */
        overflow-y: auto; /* Allow scrolling inside the card if text is too long */
        padding: 20px !important; /* Override Bricks padding to save space */
    }
}

@media (max-width: 464px) {
    .bricks-infinite-slider-track.has-varying-widths > * {
        width: 80vw !important; /* Slightly wider on very small screens so text fits, but still less than 85vw */
    }

    /* Further reduce height and padding on very small screens */
    .bricks-infinite-slider-track > * {
        max-height: 220px; /* Reduced from 260px */
        padding: 16px !important;
    }
}
