/**
 * Naturabox — galerie de la fiche coffret (catalog/_partials/product-cover-thumbnails.tpl) et galerie plein écran
 * (nb-lightbox.js). Même principe que la fiche prestation : photos carrées affichées entières, grande photo +
 * 4 vignettes en 2 × 2 (mise en page de la fiche : product-page.css).
 */

#product .pp-hero .page-content,
#product .pp-hero .product-gallery,
#product .pp-hero .product-gallery__main {
  flex: none;
}

/* ---------- Mosaïque ---------- */
#product .nb-pgal {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
  overflow: hidden;
  border-radius: 16px;
}

#product .nb-pgal__item {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f3f3f0;
}

#product .nb-pgal__item--cover {
  grid-row: 1 / 3;
  grid-column: 1;
  height: 100%;
  aspect-ratio: auto;
}

#product .nb-pgal__item--hidden {
  display: none;
}

#product .nb-pgal__item img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  transition: transform .4s ease, filter .2s ease;
}

#product .nb-pgal__item:hover img {
  filter: brightness(.93);
}

#product .nb-pgal__item .product-flags {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 2;
}

/* moins de 4 vignettes */
#product .nb-pgal--0 {
  grid-template-columns: 1fr;
}

#product .nb-pgal--0 .nb-pgal__item--cover {
  grid-row: auto;
  aspect-ratio: 1;
}

#product .nb-pgal--1 {
  grid-template-columns: 1fr 1fr;
}

#product .nb-pgal--1 .nb-pgal__item--cover {
  grid-row: auto;
  aspect-ratio: 1;
}

#product .nb-pgal--2 {
  grid-template-columns: 2fr 1fr;
}

#product .nb-pgal--3 .nb-pgal__item:nth-child(4) {
  grid-column: 2 / 4;
  aspect-ratio: 2.04;
}

#product .nb-pgal__all {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .9rem;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--nb-ink);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
  cursor: pointer;
}

#product .nb-pgal__all .material-icons {
  font-size: 18px;
}

#product .nb-pgal__all:hover {
  background: #f5f6f3;
}

/* bandeau « nombre de séjours » : sous la galerie (il masquait le bas de la photo) */
#product .nb-pnb {
  position: static;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e7e9e4;
  background: #faf6ed;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#product .nb-pnb .pp-nature-banner__content :is(h2, h3, strong) {
  margin: 0 0 .2rem;
  font-size: 1rem !important;
}

#product .nb-pnb .pp-nature-banner__content p {
  font-size: .875rem !important;
  color: var(--nb-muted);
}

@media (max-width: 767.98px) {
  #product .nb-pgal {
    grid-template-columns: 1fr;
    margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -.5);
    border-radius: 0;
  }

  #product .nb-pgal__item--cover {
    grid-row: auto;
    aspect-ratio: 1;
  }

  #product .nb-pgal__item:not(.nb-pgal__item--cover) {
    display: none;
  }
}

/* ---------- Galerie plein écran ---------- */
html.nb-lb-open {
  overflow: hidden;
}

.nb-lb {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 4.5rem;
  background: rgba(10, 14, 11, .94);
}

.nb-lb[hidden] {
  display: none;
}

.nb-lb__fig {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  margin: 0;
}

.nb-lb__img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 9rem);
  border-radius: 8px;
  object-fit: contain;
}

.nb-lb__count {
  font-size: .875rem;
  color: rgba(255, 255, 255, .75);
}

.nb-lb__close,
.nb-lb__nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.nb-lb__close {
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.nb-lb__close .material-icons {
  font-size: 26px;
}

.nb-lb__nav {
  top: 50%;
  width: 48px;
  height: 48px;
  color: var(--nb-ink);
  background: rgba(255, 255, 255, .92);
  transform: translateY(-50%);
}

.nb-lb__nav .material-icons {
  font-size: 30px;
}

.nb-lb__nav--prev {
  left: 1rem;
}

.nb-lb__nav--next {
  right: 1rem;
}

.nb-lb--single .nb-lb__nav,
.nb-lb--single .nb-lb__count {
  display: none;
}

.nb-lb__close:focus-visible,
.nb-lb__nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 767.98px) {
  .nb-lb {
    padding: 3.5rem .5rem;
  }

  .nb-lb__nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }
}

/* conteneur : flux normal (legacy.css le mettait en colonne inversée pour placer les vignettes sous la photo) */
#product .product-gallery:has(> .nb-pgal) {
  display: block;
}
