/* ==========================================================
   JT MAISON — Variable Carousel Widget
   ========================================================== */

.jtm-variable-carousel {
    padding: 100px 40px;
    background: var(--jtm-white);
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.jtm-variable-carousel__inner {
    display: flex;
    gap: 16px;
    padding-bottom: 24px; /* Space for scrollbar if any */
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.jtm-variable-carousel__inner::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.jtm-variable-carousel__item {
    /* Height is controlled via Elementor, default 600px */
    flex: 0 0 auto;
    display: flex; /* Ensures child dictacts exact width without distortion */
    scroll-snap-align: start;
}

.jtm-variable-carousel__item img {
    height: 100% !important;
    width: auto !important;
    max-width: none !important; /* Critical: Prevent Elementor overriding to 100% width */
    object-fit: cover;
    display: block;
}

.jtm-variable-carousel__spacer {
    flex: 0 0 1px; /* Empty spacer to ensure snap works till the end */
}

/* Navigation */
.jtm-variable-carousel__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
}

.jtm-variable-carousel__nav-link {
    font-family: var(--jtm-font-ui);
    font-size: 18px;
    font-weight: 500;
    color: var(--jtm-dark);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.jtm-variable-carousel__nav-link:hover {
    opacity: 0.6;
}

.jtm-variable-carousel__nav-arrow {
    font-size: 24px;
    line-height: 1;
}

/* ==========================================================
   RESPONSIVE MOBILE
   ========================================================== */
@media (max-width: 768px) {
    .jtm-variable-carousel {
        padding: 60px 24px;
    }
    
    .jtm-variable-carousel__inner {
        gap: 12px;
    }
    
    .jtm-variable-carousel__item {
        /* In mobile, we cap the max-width so an image is never wider than the screen */
        max-width: 85vw;
    }
    
    .jtm-variable-carousel__item img {
        /* Allow it to fill the max-width if needed, cropping with cover */
        width: 100% !important;
    }
    
    /* On mobile, hide the text labels and keep only the arrows */
    .jtm-variable-carousel__nav {
        margin-top: 40px;
        justify-content: center;
        gap: 40px;
    }
    
    .jtm-variable-carousel__nav-text {
        display: none;
    }
}
