/* JLE Listing Enhanced - Frontend */

.jle-listing-wrapper {
    position: relative;
    width: 100%;
}

/* Grid */
.jle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.jle-grid > .jle-item {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.jle-item {
    overflow: hidden;
}

/* ==========================================
   BLOCS INTERCALÉS - CONTRÔLE DE LARGEUR
   ========================================== */

/* Largeur des blocs custom */
.jle-grid > .jle-custom-block.jle-block-width-1 {
    grid-column: span 1;
}

.jle-grid > .jle-custom-block.jle-block-width-2 {
    grid-column: span 2;
}

.jle-grid > .jle-custom-block.jle-block-width-3 {
    grid-column: span 3;
}

.jle-grid > .jle-custom-block.jle-block-width-4 {
    grid-column: span 4;
}

.jle-grid > .jle-custom-block.jle-block-width-full {
    grid-column: 1 / -1; /* Toute la largeur */
}

/* Hauteur des blocs custom */
.jle-grid > .jle-custom-block.jle-block-height-match {
    /* Hauteur auto mais alignée */
    align-self: stretch;
}

.jle-grid > .jle-custom-block.jle-block-height-1 {
    grid-row: span 1;
}

.jle-grid > .jle-custom-block.jle-block-height-2 {
    grid-row: span 2;
}

/* Contenu du bloc custom */
.jle-custom-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.jle-custom-block > * {
    flex: 1;
    width: 100%;
}

/* ==========================================
   SLIDER
   ========================================== */

.jle-slider {
    position: relative;
    padding: 0 50px;
}

.jle-slider .swiper {
    overflow: hidden;
}

.jle-slider .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.jle-slider .swiper-slide {
    height: auto;
    flex-shrink: 0;
}

/* Bloc custom en slider - prend plus de place visuellement */
.jle-slider .jle-custom-block.jle-block-width-2 {
    /* En slider, on peut ajuster la largeur via CSS custom si besoin */
}

/* Navigation */
.jle-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    color: #333;
    padding: 0;
}

.jle-nav-btn:hover {
    background: #333;
    color: #fff;
}

.jle-nav-prev { left: 0; }
.jle-nav-next { right: 0; }

/* Pagination */
.jle-slider .swiper-pagination {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

.jle-slider .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ccc;
    opacity: 1;
    margin: 0 5px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-block;
}

.jle-slider .swiper-pagination-bullet-active {
    background: #333;
}

/* Images */
.jle-item img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .jle-slider { padding: 0 40px; }
    
    /* Sur tablette, limiter le span à max 2 */
    .jle-grid > .jle-custom-block.jle-block-width-3,
    .jle-grid > .jle-custom-block.jle-block-width-4 {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .jle-slider { padding: 0 30px; }
    .jle-nav-btn { width: 32px; height: 32px; }
    
    /* Sur mobile, tous les blocs prennent toute la largeur */
    .jle-grid > .jle-custom-block.jle-block-width-2,
    .jle-grid > .jle-custom-block.jle-block-width-3,
    .jle-grid > .jle-custom-block.jle-block-width-4 {
        grid-column: 1 / -1;
    }
}
