/**
 * Folies Secrètes — Lightbox image produit premium (Magnific Popup)
 * Scope : body#product + .mfp-image-holder (pas iframe vidéo PS27)
 * Cohérent avec fs-product-video-popup-ps27.css (bouton fermer premium)
 */

/* Overlay chaud semi-transparent — .mfp-bg est sibling de .mfp-wrap, pas enfant */
body#product .mfp-bg {
  opacity: 0.78;
  background: rgba(26, 23, 22, 0.88);
}

body#product.mfp-zoom-in.mfp-ready .mfp-bg {
  opacity: 0.78;
}

body#product .mfp-wrap {
  -webkit-backface-visibility: hidden;
}

body#product .mfp-container.mfp-image-holder {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

body#product .mfp-image-holder .mfp-content {
  position: relative;
  max-width: min(920px, calc(100vw - 2rem));
  line-height: 0;
  overflow: visible !important;
}

/* Cadre image : fond ivoire chaud */
body#product .mfp-image-holder .mfp-figure {
  position: relative;
  overflow: visible !important;
}

body#product .mfp-image-holder .mfp-figure::after {
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: linear-gradient(180deg, #faf7f2 0%, #f5f0ea 100%) !important;
  border-radius: 12px;
  box-shadow:
    0 28px 72px rgba(26, 23, 22, 0.38),
    0 0 0 1px rgba(184, 149, 107, 0.2) !important;
}

body#product .mfp-image-holder img.mfp-img {
  padding: 1.25rem 1.5rem !important;
  max-height: min(78vh, 44rem);
  width: auto !important;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

body#product .mfp-image-holder .mfp-bottom-bar {
  margin-top: -0.35rem;
  background: transparent;
}

body#product .mfp-image-holder .mfp-title {
  padding: 0.35rem 1.5rem 1rem;
  font-family: var(--fs-font-sans, "Manrope", system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(253, 252, 250, 0.88);
  text-align: center;
}

body#product .mfp-image-holder .mfp-counter {
  top: 0.85rem;
  right: 1rem;
  font-family: var(--fs-font-sans, "Manrope", system-ui, sans-serif);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(253, 252, 250, 0.72);
}

/* Bouton fermer — Panda décale à right:-30px hors cadre */
body#product .mfp-image-holder .mfp-close,
body#product .mfp-close-btn-in .mfp-image-holder .mfp-close,
body#product .mfp-wrap .mfp-image-holder .mfp-close {
  position: absolute !important;
  top: 0.65rem !important;
  right: 0.65rem !important;
  left: auto !important;
  bottom: auto !important;
  width: 3rem !important;
  height: 3rem !important;
  min-width: 3rem !important;
  min-height: 3rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(184, 149, 107, 0.55) !important;
  border-radius: 50% !important;
  background-color: #faf7f2 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%231a1716' stroke-width='3.1' stroke-linecap='round' d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: 1.625rem 1.625rem !important;
  font: 0/0 a !important;
  color: transparent !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
  opacity: 1 !important;
  box-shadow:
    0 10px 26px rgba(26, 23, 22, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.55) inset;
  cursor: pointer;
  transition:
    background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background-image 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1060;
}

body#product .mfp-image-holder .mfp-close::before,
body#product .mfp-image-holder .mfp-close::after {
  content: none !important;
  display: none !important;
}

body#product .mfp-image-holder .mfp-close:hover,
body#product .mfp-image-holder .mfp-close:focus-visible {
  background-color: #fffefb !important;
  border-color: var(--fs-gold, #b8956b) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%23b8956b' stroke-width='3.2' stroke-linecap='round' d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E") !important;
  box-shadow:
    0 14px 32px rgba(26, 23, 22, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.75) inset;
  transform: translateY(-1px);
  outline: none;
}

/* Flèches popup — background-color + background-image (pas le shorthand background) */
body#product .mfp-image-holder .mfp-arrow {
  width: 2.75rem !important;
  height: 2.75rem !important;
  margin-top: -1.375rem !important;
  padding: 0 !important;
  opacity: 1 !important;
  background-color: rgba(253, 252, 250, 0.94) !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: 1.15rem 1.15rem !important;
  border: 1px solid rgba(184, 149, 107, 0.42) !important;
  border-radius: 50% !important;
  box-shadow:
    0 8px 22px rgba(26, 23, 22, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
  transition:
    background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background-image 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1055;
}

body#product .mfp-image-holder .mfp-arrow::before,
body#product .mfp-image-holder .mfp-arrow::after {
  content: none !important;
  display: none !important;
  border: none !important;
  margin: 0 !important;
}

body#product .mfp-image-holder .mfp-arrow-left {
  left: 0.75rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%234a4543' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M14.5 6.5L9 12l5.5 5.5'/%3E%3C/svg%3E") !important;
}

body#product .mfp-image-holder .mfp-arrow-right {
  right: 0.75rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%234a4543' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M9.5 6.5L15 12l-5.5 5.5'/%3E%3C/svg%3E") !important;
}

body#product .mfp-image-holder .mfp-arrow:hover {
  background-color: rgba(255, 254, 251, 0.98) !important;
  border-color: var(--fs-gold, #b8956b) !important;
  box-shadow:
    0 12px 28px rgba(26, 23, 22, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

body#product .mfp-image-holder .mfp-arrow-left:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%23b8956b' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='M14.5 6.5L9 12l5.5 5.5'/%3E%3C/svg%3E") !important;
}

body#product .mfp-image-holder .mfp-arrow-right:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath stroke='%23b8956b' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round' d='M9.5 6.5L15 12l-5.5 5.5'/%3E%3C/svg%3E") !important;
}

body#product .mfp-image-holder .mfp-arrow:active {
  transform: scale(0.97);
}

@media (max-width: 767px) {
  body#product .mfp-image-holder .mfp-content {
    max-width: calc(100vw - 1.25rem);
  }

  body#product .mfp-image-holder img.mfp-img {
    padding: 0.85rem 1rem !important;
    max-height: min(70vh, 32rem);
  }

  body#product .mfp-image-holder .mfp-close {
    top: 0.5rem !important;
    right: 0.5rem !important;
    width: 3.15rem !important;
    height: 3.15rem !important;
    min-width: 3.15rem !important;
    min-height: 3.15rem !important;
    background-size: 1.4rem 1.4rem !important;
  }

  body#product .mfp-image-holder .mfp-arrow {
    width: 2.45rem !important;
    height: 2.45rem !important;
    margin-top: -1.225rem !important;
  }

  body#product .mfp-image-holder .mfp-arrow-left {
    left: 0.35rem !important;
  }

  body#product .mfp-image-holder .mfp-arrow-right {
    right: 0.35rem !important;
  }
}
