/* ================================
   BLEU ATELIER — Galerie produit premium
   Rendu proche Monsieur Paris
================================ */

/* Wrapper général */
.ba-product-gallery {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: sticky;
  top: 0;
}

/* Grande image */
.ba-gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;

  background: #f4f4f2 !important;
  border: none !important;
  border-radius: 6px !important;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lien image */
.ba-gallery-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* Support du picture */
.ba-gallery-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

/* Image principale */
.ba-gallery-image img,
.ba-gallery-main img:not(.zoomImg) {
  width: 100% !important;
  height: 100% !important;
  display: block !important;

  object-fit: cover !important;
  object-position: center center !important;

  border-radius: 6px !important;
  transition: opacity .22s ease, transform .45s ease !important;
}

/* Hover discret */
.ba-gallery-main:hover .ba-gallery-image img {
  transform: scale(1.015);
}

/* ================================
   Flèches grande image
================================ */

.ba-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 10;
  transform: translateY(-50%);

  width: 40px !important;
  height: 40px !important;

  border-radius: 999px !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;

  background: rgba(255, 255, 255, .78) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  cursor: pointer;
  padding: 0 !important;

  opacity: .9;
  transition: background .2s ease, opacity .2s ease;
}

.ba-gallery-prev {
  left: 18px !important;
}

.ba-gallery-next {
  right: 18px !important;
}

/* Chevron */
.ba-gallery-arrow span {
  display: block;
  width: 10px;
  height: 10px;
}

.ba-gallery-prev span {
  border-left: 2px solid #26324c;
  border-bottom: 2px solid #26324c;
  transform: rotate(45deg);
  margin-left: 3px;
}

.ba-gallery-next span {
  border-right: 2px solid #26324c;
  border-bottom: 2px solid #26324c;
  transform: rotate(-45deg);
  margin-right: 3px;
}

.ba-gallery-arrow:hover {
  background: rgba(255, 255, 255, .96) !important;
  opacity: 1;
}

.ba-gallery-arrow:focus,
.ba-gallery-arrow:focus-visible,
.ba-gallery-arrow:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* ================================
   Miniatures
================================ */

.ba-gallery-thumbs-wrap {
  position: relative;
  width: 100%;
  margin-top: 8px;
}

/* On masque les flèches des miniatures */
.ba-gallery-thumbs-arrow {
  display: none !important;
}

/* Rail miniatures */
.ba-gallery-thumbs {
  width: 100%;
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: calc((100% - 16px) / 3) !important;

  gap: 8px !important;
  overflow-x: auto !important;
  scroll-behavior: smooth;

  padding: 0 !important;
  margin: 0 !important;

  scrollbar-width: none;
}

.ba-gallery-thumbs::-webkit-scrollbar {
  display: none;
}

/* Bouton miniature */
.ba-gallery-thumb {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;

  padding: 0 !important;
  margin: 0 !important;

  border: none !important;
  outline: none !important;
  box-shadow: none !important;

  background: transparent !important;
  border-radius: 4px !important;
  overflow: hidden !important;

  cursor: pointer;

  opacity: .46 !important;
  transition: opacity .22s ease !important;
}

/* Support picture miniature */
.ba-gallery-thumb picture {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}

/* Image miniature */
.ba-gallery-thumb img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;

  object-fit: cover !important;
  object-position: center center !important;

  border-radius: 4px !important;
}

/* Hover miniature */
.ba-gallery-thumb:hover {
  opacity: .78 !important;
}

/* Miniature active */
.ba-gallery-thumb.is-active {
  opacity: 1 !important;
}

/* Suppression contours navigateur */
.ba-gallery-thumb:focus,
.ba-gallery-thumb:focus-visible,
.ba-gallery-thumb:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* ================================
   Mobile
================================ */

@media (max-width: 767px) {
  .ba-product-gallery {
    position: relative;
    top: auto;
  }

  .ba-gallery-main {
    border-radius: 5px !important;
  }

  .ba-gallery-image img,
  .ba-gallery-main img:not(.zoomImg) {
    border-radius: 5px !important;
  }

  .ba-gallery-arrow {
    width: 36px !important;
    height: 36px !important;
  }

  .ba-gallery-prev {
    left: 12px !important;
  }

  .ba-gallery-next {
    right: 12px !important;
  }

  .ba-gallery-thumbs {
    grid-auto-columns: calc((100% - 16px) / 3) !important;
    gap: 8px !important;
  }
}


/* ================================
   BLEU ATELIER — Galerie responsive
================================ */

/* Desktop large : rendu premium, 4 miniatures */
@media (min-width: 1200px) {
  .ba-product-gallery {
    position: sticky;
    top: 24px;
  }

  .ba-gallery-thumbs {
    grid-auto-columns: calc((100% - 24px) / 4) !important;
    gap: 8px !important;
  }

  .ba-gallery-arrow {
    width: 42px !important;
    height: 42px !important;
  }

  .ba-gallery-prev {
    left: 18px !important;
  }

  .ba-gallery-next {
    right: 18px !important;
  }
}

/* Laptop / tablette horizontale */
@media (min-width: 768px) and (max-width: 1199px) {
  .ba-product-gallery {
    position: sticky;
    top: 16px;
  }

  .ba-gallery-main {
    aspect-ratio: 1 / 1 !important;
    border-radius: 6px !important;
  }

  .ba-gallery-thumbs {
    grid-auto-columns: calc((100% - 16px) / 3) !important;
    gap: 8px !important;
  }

  .ba-gallery-arrow {
    width: 40px !important;
    height: 40px !important;
  }

  .ba-gallery-prev {
    left: 14px !important;
  }

  .ba-gallery-next {
    right: 14px !important;
  }
}

/* Tablette verticale + mobile */
@media (max-width: 767px) {
  .ba-product-gallery {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
  }

  .ba-gallery-main {
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 5px !important;
  }

  .ba-gallery-image,
  .ba-gallery-image img,
  .ba-gallery-main img:not(.zoomImg) {
    border-radius: 5px !important;
  }

  .ba-gallery-thumbs-wrap {
    margin-top: 7px !important;
  }

  .ba-gallery-thumbs {
    grid-auto-columns: calc((100% - 14px) / 3) !important;
    gap: 7px !important;
  }

  .ba-gallery-thumb {
    border-radius: 4px !important;
  }

  .ba-gallery-thumb img {
    border-radius: 4px !important;
  }

  .ba-gallery-arrow {
    width: 36px !important;
    height: 36px !important;
    background: rgba(255, 255, 255, .76) !important;
  }

  .ba-gallery-arrow span {
    width: 9px !important;
    height: 9px !important;
  }

  .ba-gallery-prev {
    left: 10px !important;
  }

  .ba-gallery-next {
    right: 10px !important;
  }
}

/* Très petits mobiles */
@media (max-width: 430px) {
  .ba-gallery-thumbs {
    grid-auto-columns: calc((100% - 12px) / 3) !important;
    gap: 6px !important;
  }

  .ba-gallery-arrow {
    width: 34px !important;
    height: 34px !important;
  }

  .ba-gallery-prev {
    left: 8px !important;
  }

  .ba-gallery-next {
    right: 8px !important;
  }
}

/* ================================
   Galerie produit — effet slider
================================ */

.ba-gallery-main {
  position: relative !important;
  overflow: hidden !important;
}

.ba-gallery-link {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

.ba-gallery-main.is-sliding .ba-gallery-image img,
.ba-gallery-main.is-sliding .ba-gallery-main img:not(.ba-gallery-slide) {
  opacity: 0 !important;
}

.ba-gallery-slide {
  position: absolute !important;
  inset: 0 !important;
  z-index: 3 !important;

  width: 100% !important;
  height: 100% !important;

  display: block !important;
  object-fit: cover !important;
  object-position: center center !important;

  border-radius: 6px !important;
  pointer-events: none !important;

  transition: transform 0.38s cubic-bezier(.45, 0, .2, 1) !important;
  will-change: transform;
}

.ba-gallery-arrow {
  z-index: 20 !important;
}

/* ================================
   Galerie produit — swipe mobile / desktop
================================ */

.ba-gallery-main {
  touch-action: pan-y !important;
  cursor: grab;
}

.ba-gallery-main.is-dragging {
  cursor: grabbing;
}

.ba-gallery-main img,
.ba-gallery-thumb img {
  user-select: none !important;
  -webkit-user-drag: none !important;
}