/* =========================================================
   SG Carousel - CSS (compatible 2 structures)
   A) .sgc-track > .et_pb_module.sg_partner_carousel_item > ... > .sgc-item > img
   B) .sgc-track > .sgc-item > img
   ========================================================= */

.sgc-wrapper{
  position: relative;
  width: 100%;
  padding: 20px 0;

  --sgc-gap: 16px;
  --sgc-arrows-color: #333;
}

/* TRACK */
.sgc-wrapper .sgc-track{
  display: flex !important;
  flex-wrap: nowrap !important;               /* 🔥 crucial */
  gap: var(--sgc-gap) !important;

  width: 100% !important;
  box-sizing: border-box !important;

  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;

  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;

  padding: 10px 6px;
  align-items: stretch !important;
}

/* Hide scrollbar */
.sgc-wrapper .sgc-track{
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sgc-wrapper .sgc-track::-webkit-scrollbar{ display: none; }

/* =========================================================
   SLIDE = enfant direct du track
   - A) .et_pb_module.sg_partner_carousel_item
   - B) .sgc-item
   ========================================================= */
.sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item,
.sgc-wrapper .sgc-track > .sgc-item{
  box-sizing: border-box !important;

  flex: 0 0 100% !important;
  width: 100% !important;
  min-width: 100% !important;
  flex-shrink: 0 !important;

  scroll-snap-align: start;
}

/* TABLETTE : 2 visibles */
@media (min-width: 768px){
  .sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item,
  .sgc-wrapper .sgc-track > .sgc-item{
    flex-basis: calc((100% - var(--sgc-gap)) / 2) !important;
    width: calc((100% - var(--sgc-gap)) / 2) !important;
    min-width: calc((100% - var(--sgc-gap)) / 2) !important;
  }
}

/* DESKTOP : 3 visibles */
@media (min-width: 981px){
  .sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item,
  .sgc-wrapper .sgc-track > .sgc-item{
    flex-basis: calc((100% - (var(--sgc-gap) * 2)) / 3) !important;
    width: calc((100% - (var(--sgc-gap) * 2)) / 3) !important;
    min-width: calc((100% - (var(--sgc-gap) * 2)) / 3) !important;
  }
}

/* Neutralise marges/paddings Divi sur les modules enfants (structure A) */
.sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item,
.sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item .et_pb_module_inner{
  margin: 0 !important;
  padding: 0 !important;
}

/* =========================================================
   BOX LOGO
   - Structure A : la box est .sgc-item (dans le module)
   - Structure B : la box est le slide direct .sgc-item
   ========================================================= */

/* Box sur .sgc-item (commune aux deux) */
.sgc-wrapper .sgc-item{
  width: 100%;
  height: 140px;  /* ajuste si besoin */
  display: flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);

  padding: 6px;
  box-sizing: border-box;
}

/* responsive hauteur box */
@media (max-width: 980px){
  .sgc-wrapper .sgc-item{ height: 125px; }
}
@media (max-width: 767px){
  .sgc-wrapper .sgc-item{ height: 115px; }
}

/* En structure A, on force la box à être bien pleine dans le wrapper */
.sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item .sgc-item{
  height: 140px;
}
@media (max-width: 980px){
  .sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item .sgc-item{ height: 125px; }
}
@media (max-width: 767px){
  .sgc-wrapper .sgc-track > .et_pb_module.sg_partner_carousel_item .sgc-item{ height: 115px; }
}

/* IMG */
.sgc-wrapper .sgc-media{
  display: block;
  width: auto !important;
  height: auto !important;

  max-width: 96% !important;
  max-height: 92% !important;

  object-fit: contain !important;

  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;

  transform: none !important;
}
.sgc-wrapper .sgc-media:hover{ transform: none !important; }

/* =========================================================
   Pagination bullets
   ========================================================= */
.sgc-wrapper .sgc-pagination{
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  user-select: none;
}

.sgc-wrapper .sgc-bullet{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(0,0,0,.25);
}

.sgc-wrapper .sgc-bullet.is-active{
  background: var(--sgc-arrows-color);
  transform: scale(1.2);
}

.sgc-wrapper .sgc-bullet:focus{
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 2px;
}

/* =========================================================
   Flèches
   ========================================================= */
.sgc-wrapper .sgc-prev,
.sgc-wrapper .sgc-next{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 44px;
  height: 44px;
  border: 0;
  cursor: pointer;

  border-radius: 10px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);

  color: var(--sgc-arrows-color);
  z-index: 50;

  display: flex;
  align-items: center;
  justify-content: center;
}

.sgc-wrapper .sgc-prev{ left: 0; }
.sgc-wrapper .sgc-next{ right: 0; }

.sgc-wrapper .sgc-prev::before,
.sgc-wrapper .sgc-next::before{
  font-family: 'ETmodules' !important;
  font-size: 24px;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sgc-wrapper .sgc-prev::before{ content: '4'; }
.sgc-wrapper .sgc-next::before{ content: '5'; }

/* optionnel : éviter que les flèches masquent un peu les logos */
@media (min-width: 981px){
  .sgc-wrapper .sgc-track{ padding-left: 54px; padding-right: 54px; }
}
@media (min-width: 768px) and (max-width: 980px){
  .sgc-wrapper .sgc-track{ padding-left: 50px; padding-right: 50px; }
}
@media (max-width: 767px){
  .sgc-wrapper .sgc-track{ padding-left: 46px; padding-right: 46px; }
}
