/* ==========================
   FILTRES
========================== */

.mbj-filtres {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 2rem;
}


.mbj-horizontal-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 auto;
}


.mbj-filtre {
    background: none;
    border: 0.5px solid #666666;
    padding: 5px 10px;
    margin: 0px;
    cursor: pointer;
    color: #666666;
    border-radius: 0px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.mbj-filtre.active,
.mbj-filtre:hover {
    background: #E5773B;
    color: #fff;
    border: 0.5px solid #E5773B;
}

.mbj-toggle-btn {
    background: none;
    border: 0.5px solid #666666;
    padding: 5px 5px;
    margin: 0.3rem;
    cursor: pointer;
    color: #666666;
    border-radius: 0px;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'PT Sans narrow', sans-serif;
}


.mbj-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    transition: transform 0.3s ease;
}



/* Vue horizontale */
.mbj-horizontal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 2rem;
}

/* Vue verticale haut de bloc (Vue + Toutes cÃ´te Ã  cÃ´te) */
.mbj-vertical .mbj-row-top {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}


/* ==========================
   GRILLE / ITEMS / VIGNETTES
========================== */

.mbj-grid {
    position: relative;
}

.mbj-item {
    width: calc(25% - 1rem);
    margin: 0 0 1rem 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mbj-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.mbj-icon-cat {
    position: absolute;
    background: #E5773B;
    bottom: 10px;
    left: 10px;
    width: 25px;
    height: 25px;
    z-index: 2;
    pointer-events: none;
    padding: 2px;
}

.mbj-icon-cat img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.mbj-thumb {
    overflow: hidden;
    border-radius: 0px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    background: #fff;
}


.mbj-thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.mbj-thumb:hover img {
    transform: scale(1.04);
}


/* ==========================
   VUE SIDEBAR (verticale active)
========================== */

body.mbj-sidebar-active .mbj-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

body.mbj-sidebar-active .mbj-filtres {
    flex-direction: column;
    position: sticky;
    top: 100px;
    width: 220px;
    background: #f8f8f8;
    padding: 1rem;
    border-radius: 0px;
    align-items: flex-start;
}


body.mbj-sidebar-active .mbj-toggle-view {
    margin-left: 0;
    margin-bottom: 1rem;
    order: -1;
    text-align: left;
}

body.mbj-sidebar-active .mbj-grid {
    flex-grow: 1;
}

.mbj-grid {
  margin-left: -1rem; /* ou la valeur exacte utilisée dans .mbj-item */
}


/* ==========================
   RESPONSIVE
========================== */
@media (min-width: 1025px) {
  .mbj-filtres {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* autorise un retour à la ligne si besoin */
    row-gap: 10px;
  }

  .mbj-horizontal-inner {
    flex: 1;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 5px;
  }

  .mbj-filtre {
    flex: 1;
  }

  .mbj-toggle-view {
    margin-left: 0;
    flex-shrink: 0;
    max-width: 100%;
  }
}


@media (max-width: 1024px) {
  .mbj-item { width: calc(33.333% - 1rem); }
   
  .mbj-filtres,
  .mbj-horizontal-inner {
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }

  .mbj-toggle-view {
    margin-left: 0;
    margin-bottom: 0;
    order: 0;
    width: auto;
    text-align: left;
  }

  .mbj-toggle-btn {
    padding: 5px 10px;
    font-size: 14px;
    height: auto;
    white-space: nowrap;
  }
}


@media (max-width: 768px) {
    .mbj-item { width: calc(50% - 1rem); }

    body.mbj-sidebar-active .mbj-wrapper {
        flex-direction: column;
    }

    body.mbj-sidebar-active .mbj-filtres {
        position: static;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        background: none;
        padding: 0;
    }

    .mbj-toggle-view {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
  .mbj-item {
    width: calc(50% - 1rem);
  }

  .mbj-filtres,
  .mbj-horizontal-inner {
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }

  .mbj-toggle-view {
    display: none;
  }

  .mbj-toggle-btn {
    padding: 5px 10px;
    font-size: 14px;
    height: auto;
    white-space: nowrap;
  }
}


@media (max-width: 480px) {
    .mbj-item {
        width: 100%;
        margin-left: 0;
    }
}



@media (max-width: 480px) {
  .mbj-item {
    width: 100%;
    margin-left: 0;
  }

  .mbj-filtres,
  .mbj-horizontal-inner {
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }

  .mbj-toggle-view {
    margin-left: 0;
    margin-bottom: 0;
    order: 0;
    width: auto;
    text-align: center;
  }

  .mbj-toggle-btn {
    padding: 5px 10px;
    font-size: 14px;
    height: auto;
    white-space: nowrap;
  }
}



.mbj-item {
    overflow: visible; /* Permet Ã  l'image agrandie de dÃ©passer proprement */
    position: relative; /* NÃ©cessaire pour que z-index de .mbj-thumb fonctionne */
}

.mbj-thumb.focused {
    transform: scale(1.1);
    padding: 10px;
}

.mbj-thumb.dimmed {
    transform: scale(1);
}

.mbj-thumb {
    transition: transform 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
}



/* ==========================
   GRILLE RESPONSIVE
========================== */

.mbj-grid {
    position: relative;
    margin-left: -1rem;
}

.mbj-item {
    width: calc(25% - 1rem); /* 4 colonnes par défaut (desktop) */
    margin: 0 0 1rem 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: visible;
    position: relative;
}

.mbj-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .mbj-item {
        width: calc(33.333% - 1rem); /* 3 colonnes tablette */
    }
}

@media (max-width: 768px) {
    .mbj-item {
        width: calc(50% - 1rem); /* 2 colonnes mobile */
    }
}

@media (max-width: 480px) {
    .mbj-item {
        width: calc(50% - 1rem); /* conserve 2 colonnes en très petit */
        margin-left: 1rem;
    }
}




