/* Container holding all 3 columns */
.eb-carousel-container {
    display: flex;
    gap: 60px; 
    height: 650px; 
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    justify-content: center; 
    width: 100%;
    /* Creates a gradient fade at the top and bottom edges for a seamless look */
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

/* Individual Columns */
.eb-carousel-column {
    flex: 1; 
    max-width: 150px; 
    position: relative;
    overflow: hidden;
}

/* Track holding the logos */
.eb-carousel-track {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Direction: Bottom to Top */
.eb-dir-up .eb-carousel-track {
    animation: eb-scroll-up 20s linear infinite;
}

/* Direction: Top to Bottom */
.eb-dir-down .eb-carousel-track {
    animation: eb-scroll-down 20s linear infinite;
}

/* Pause animations when the user hovers over any column */
.eb-carousel-track:hover {
    animation-play-state: paused;
}

/* Individual Logo Cards */
.eb-logo-item {
    background-color: #ffffff;
    border-radius: 16px; 
    padding: 15px; 
    margin-bottom: 20px; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1; 
}

/* Ensure images fit nicely inside the box regardless of dimensions */
.eb-logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.eb-logo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12); 
    z-index: 2; 
}

/* Hover Tooltip/Caption */
.eb-logo-caption {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.eb-logo-item:hover .eb-logo-caption {
    opacity: 1;
    visibility: visible;
    bottom: 15px; 
}

/* Vertical Animations (Desktop) */
@keyframes eb-scroll-up {
    0% { transform: translateY(0); }
    100% { transform: translateY(-33.3333%); } 
}

@keyframes eb-scroll-down {
    0% { transform: translateY(-33.3333%); }
    100% { transform: translateY(0); }
}

/* =========================================
   Mobile Responsive Styles (< 768px)
========================================= */
@media (max-width: 768px) {
    /* 1. BRICKS LAYOUT OVERRIDES */
    /* Target the main container to move carousel above text */
    #brxe-drevvb {
        display: flex !important;
        flex-direction: column-reverse !important;
    }
    
    /* Target the text block to take full width */
    #brxe-ljnbfb {
        width: 100% !important;
        max-width: 100% !important;
        padding-right: 0 !important;
        text-align: center; /* Optional: centers text on mobile for better UI */
    }

    /* Target the shortcode block */
    #brxe-mnrlpm {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 30px !important; /* Space between the carousel and the text below it */
    }

    /* 2. CAROUSEL HORIZONTAL CONVERSION */
    .eb-carousel-container {
        flex-direction: column; /* Stack the tracks as 3 horizontal rows */
        height: 270px; /* Tightly wraps 3 rows of 80px + gaps */
        gap: 15px; /* Vertical space between the 3 rows */
        justify-content: flex-start;
        /* Change fade mask to left/right for horizontal scrolling */
        mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    }

    .eb-carousel-column {
        max-width: 100%;
        width: 100%;
        height: 80px; /* Fixed height for the rows */
        flex: 0 0 80px; 
    }

    .eb-carousel-track {
        flex-direction: row; /* Align logos side-by-side horizontally */
        width: max-content; /* Allow the track to extend infinitely off-screen */
        height: 100%;
    }

    .eb-logo-item {
        margin-bottom: 0; /* Remove vertical margin */
        margin-right: 15px; /* Add horizontal gap between items */
        width: 80px; /* Lock width */
        height: 80px; /* Lock height */
        flex: 0 0 80px; /* Prevent shrinking */
        padding: 10px;
        border-radius: 12px;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    }

    /* Smaller tooltip for mobile */
    .eb-logo-caption {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Swap animations from Up/Down to Left/Right */
    .eb-dir-up .eb-carousel-track {
        animation: eb-scroll-left 20s linear infinite;
    }
    
    .eb-dir-down .eb-carousel-track {
        animation: eb-scroll-right 20s linear infinite;
    }
}

/* Horizontal Animations (Mobile) */
@keyframes eb-scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.3333%); }
}

@keyframes eb-scroll-right {
    0% { transform: translateX(-33.3333%); }
    100% { transform: translateX(0); }
}