/* =============================================
   Popup Luxe — Frontend Styles v1.2
   Cadre naturel · Fond configurable · Responsive
============================================= */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --plx-accent:     #c9a96e;
  --plx-accent2:    #e8c98a;
  --plx-duration:   800ms;
  --plx-font:       'DM Sans', sans-serif;
  --plx-img-height: 420px;
  --plx-max-h:      90vh;
  --plx-frame-bg:   #000000;    /* couleur de fond du cadre */
}

/* ══ OVERLAY ══ */
.plx-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  padding: 24px 20px;
  opacity: 0;
  transition: opacity .4s ease;
  font-family: var(--plx-font);
  pointer-events: none;
}
.plx-overlay.plx-visible { opacity: 1; pointer-events: auto; }
.plx-overlay.plx-hidden  { opacity: 0; pointer-events: none; }

.plx-pos-left   { justify-content: flex-start; }
.plx-pos-center { justify-content: center; }
.plx-pos-right  { justify-content: flex-end; }

/* ══ OVERLAY BACKGROUNDS ══ */
.plx-style-dark  { background: rgba(0,0,0,.80); backdrop-filter: blur(4px); }
.plx-style-light { background: rgba(230,230,230,.75); backdrop-filter: blur(6px); }
.plx-style-glass { background: rgba(20,20,40,.38); backdrop-filter: blur(18px) saturate(160%); }
.plx-style-blur  { background: rgba(0,0,0,.55); backdrop-filter: blur(24px); }

/* ══ POPUP CARD ══ */
.plx-popup {
  position: relative;
  width: 100%;
  max-height: var(--plx-max-h);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: plxIn .45s cubic-bezier(.22,.68,0,1.15) both;
}
@keyframes plxIn {
  from { transform: translateY(20px) scale(.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.plx-style-dark  .plx-popup { background:#111113; border:1px solid rgba(255,255,255,.08); box-shadow:0 32px 72px rgba(0,0,0,.8); }
.plx-style-light .plx-popup { background:#fff; border:1px solid rgba(0,0,0,.08); box-shadow:0 24px 56px rgba(0,0,0,.15); }
.plx-style-glass .plx-popup { background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.20); box-shadow:0 24px 56px rgba(0,0,0,.3); backdrop-filter:blur(16px); }
.plx-style-blur  .plx-popup { background:rgba(8,8,12,.92); border:1px solid rgba(255,255,255,.08); box-shadow:0 32px 72px rgba(0,0,0,.7); }

/* ══════════════════════════════════════════
   SLIDER WRAP — le "cadre"
   En mode natural : pas de hauteur fixe,
   le cadre suit le ratio de l'image.
   En mode fixe : hauteur CSS var.
══════════════════════════════════════════ */
.plx-slider-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
  /* Fond du cadre (couleur injectée par JS) */
  background: var(--plx-frame-bg);
}

/* MODE NATURAL : cadre = ratio de la photo */
.plx-format-natural .plx-slider-wrap {
  height: auto;          /* le cadre s'adapte */
  max-height: 80vh;
}
/* L'image occupe sa taille naturelle, pas de déformation */
.plx-format-natural .plx-slide img {
  width: 100%;
  height: auto;           /* ratio préservé automatiquement */
  display: block;
  max-height: 80vh;
  object-fit: unset;      /* pas de recadrage */
}
/* En mode natural, les slides ne sont plus en absolute/inset */
.plx-format-natural .plx-slide {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  height: auto;
}
.plx-format-natural .plx-slide.active {
  position: relative !important;
  width: 100%;
  height: auto;
}

/* MODES RATIO FIXE */
.plx-format-instagram .plx-slider-wrap { aspect-ratio: 4/5; max-height: 80vh; }
.plx-format-square    .plx-slider-wrap { aspect-ratio: 1/1; max-height: 80vh; }
.plx-format-landscape .plx-slider-wrap { aspect-ratio: 16/9; max-height: 65vh; }
.plx-format-custom    .plx-slider-wrap { height: var(--plx-img-height); max-height: 80vh; }

/* ══ FOND DU CADRE — modes ══ */

/* Transparent */
.plx-frame-transparent .plx-slider-wrap {
  background: transparent !important;
}

/* Flou : duplique l'image en arrière-plan agrandi */
.plx-frame-blur .plx-slider-wrap {
  background: transparent !important;
}
/* Le pseudo-element porte le fond flouté */
.plx-frame-blur .plx-slide::before {
  content: '';
  position: absolute;
  inset: -20px;
  background: inherit;   /* JS injecte l'url de l'image */
  background-size: cover;
  background-position: center;
  filter: blur(18px) brightness(.7) saturate(1.3);
  z-index: 0;
  transform: scale(1.05);
}
.plx-frame-blur .plx-slide img {
  position: relative;
  z-index: 1;
}

/* ══ SLIDER ENGINE ══ */
.plx-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Slides en fixed ratio : empilés en absolute */
.plx-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.plx-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
  width: 100%;
  height: 100%;
}
.plx-slide img {
  width: 100%;
  height: 100%;
  object-fit: var(--plx-img-fit, cover);
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* ══ TRANSITIONS ══ */
.plx-trans-fade .plx-slide {
  transition: opacity var(--plx-duration) ease;
}

.plx-trans-slide .plx-slide {
  transform: translateX(100%);
  transition: transform var(--plx-duration) cubic-bezier(.77,0,.18,1), opacity var(--plx-duration) ease;
}
.plx-trans-slide .plx-slide.active    { transform: translateX(0); }
.plx-trans-slide .plx-slide.plx-exit  { transform: translateX(-100%); opacity: 0; }

.plx-trans-slide-right .plx-slide {
  transform: translateX(-100%);
  transition: transform var(--plx-duration) cubic-bezier(.77,0,.18,1), opacity var(--plx-duration) ease;
}
.plx-trans-slide-right .plx-slide.active    { transform: translateX(0); }
.plx-trans-slide-right .plx-slide.plx-exit  { transform: translateX(100%); opacity: 0; }

.plx-trans-zoom .plx-slide {
  transform: scale(1.07);
  transition: transform var(--plx-duration) ease, opacity var(--plx-duration) ease;
}
.plx-trans-zoom .plx-slide.active    { transform: scale(1); }
.plx-trans-zoom .plx-slide.plx-exit  { transform: scale(.93); opacity: 0; }

.plx-trans-flip .plx-slider-wrap { perspective: 900px; }
.plx-trans-flip .plx-slide {
  transform: rotateY(90deg);
  transition: transform var(--plx-duration) ease, opacity var(--plx-duration) ease;
}
.plx-trans-flip .plx-slide.active    { transform: rotateY(0deg); }
.plx-trans-flip .plx-slide.plx-exit  { transform: rotateY(-90deg); opacity: 0; }

/* ══ BOUTON FERMER ══ */
.plx-close {
  position: absolute; top: 12px; right: 12px; z-index: 20;
  background: rgba(0,0,0,.46); backdrop-filter: blur(6px);
  color: rgba(255,255,255,.9); border: none; border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .22s, opacity .35s;
}
.plx-close:hover { background: rgba(0,0,0,.72); transform: scale(1.1) rotate(90deg); }
.plx-style-light .plx-close { background: rgba(0,0,0,.10); color: #333; }

/* ══ FLÈCHES ══ */
.plx-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
  background: rgba(0,0,0,.30); backdrop-filter: blur(4px);
  color: rgba(255,255,255,.92); border: none; border-radius: 50%;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s, transform .2s;
}
.plx-arrow:hover { background: rgba(0,0,0,.62); transform: translateY(-50%) scale(1.08); }
.plx-arrow-prev { left: 12px; }
.plx-arrow-next { right: 12px; }
.plx-style-light .plx-arrow { background: rgba(0,0,0,.12); color: #222; }

/* ══ DOTS ══ */
.plx-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 10;
}
.plx-dot {
  width: 6px; height: 6px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.36); cursor: pointer; padding: 0;
  transition: background .25s, transform .25s;
}
.plx-dot.active { background: #fff; transform: scale(1.4); }
.plx-style-light .plx-dot        { background: rgba(0,0,0,.22); }
.plx-style-light .plx-dot.active { background: #111; }

/* ══ TIMER BAR ══ */
.plx-timer-track {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,.12); z-index: 10;
}
.plx-timer-bar { height: 100%; width: 0%; background: var(--plx-accent); transition: width linear; }
.plx-style-light .plx-timer-track { background: rgba(0,0,0,.10); }
.plx-style-light .plx-timer-bar   { background: #222; }

/* ══ CTA ══ */
.plx-cta { padding: 12px 20px; display: flex; justify-content: center; flex-shrink: 0; }
.plx-cta-top    { order: -1; }
.plx-cta-bottom { order: 1; }

.plx-cta-btn {
  display: inline-flex; align-items: center;
  background: var(--plx-accent); color: #0e0e0f;
  text-decoration: none;
  font-family: var(--plx-font); font-size: 12px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  padding: 10px 26px; border-radius: 999px;
  transition: background .2s, transform .15s; white-space: nowrap;
}
.plx-cta-btn:hover { background: var(--plx-accent2); transform: translateY(-1px); color: #0e0e0f; }
.plx-style-light .plx-cta-btn        { background: #111; color: #fff; }
.plx-style-light .plx-cta-btn:hover  { background: #333; color: #fff; }
.plx-style-glass .plx-cta-btn        { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.plx-style-glass .plx-cta-btn:hover  { background: rgba(255,255,255,.28); color: #fff; }

/* ══ RESPONSIVE ══ */
@media (max-width: 600px) {
  .plx-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .plx-pos-left,
  .plx-pos-center,
  .plx-pos-right { justify-content: stretch; }

  .plx-popup {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    animation: plxInMobile .38s cubic-bezier(.22,.68,0,1.15) both;
  }
  @keyframes plxInMobile {
    from { transform: translateY(50px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .plx-format-natural .plx-slide img { max-height: 60vh; }
  .plx-format-landscape .plx-slider-wrap { aspect-ratio: 16/9; }
  .plx-arrow { width: 30px; height: 30px; }
  .plx-close { top: 8px; right: 8px; width: 30px; height: 30px; }
  .plx-cta-btn { font-size: 11px; padding: 9px 20px; }
}
