/* ── FL Sticky Add to Cart ── */
.fl-sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: #fff;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  border-top: 2px solid #e5e7eb;
  transform: translateY(0);
  will-change: transform;
  /* Nécessaire pour positionner la croix en absolu */
  overflow: visible;
}

/* Bouton fermer (caché par défaut, visible en mode centré) */
.fl-sticky-close {
  display: none;
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #394873;
  color: #fff;
  border: 2px solid #fff;
  font-size: 1.1rem;
  line-height: 1;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.fl-sticky-close:hover { background: #2f3c60; }

/* Mode centré : au milieu de l'écran */
.fl-sticky-bar.fl-sticky-centered {
  position: fixed !important;
  top: 50% !important;
  bottom: auto !important;
  left: 0 !important;
  right: 0 !important;
  width: 90vw !important;
  max-width: 700px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  transform: translateY(-50%) !important;
  border-radius: 1rem !important;
  box-shadow: 0 8px 48px rgba(0,0,0,0.28) !important;
  border: 2px solid #394873 !important;
  z-index: 9999 !important;
}

/* Overlay sombre derrière quand centré */
.fl-sticky-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9998;
}
.fl-sticky-overlay.fl-overlay-visible {
  display: block;
}

@keyframes fl-cart-bounce-anim {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.fl-cart-bounce {
  animation: fl-cart-bounce-anim 0.7s ease;
  display: inline-block;
}

#fl-sticky-bar .fl-sticky-inner {
  width: min(980px, calc(100vw - 1.5rem));
  margin: 0.45rem auto;
  padding: 0.55rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: nowrap;
  overflow: visible;
}

/* Colonnes */
#fl-sticky-bar .fl-sticky-col {
  display: flex;
  align-items: center;
  min-width: 0;
}
#fl-sticky-bar .fl-sticky-col-img {
  flex: 0 0 auto;
}
#fl-sticky-bar .fl-sticky-col-info {
  flex: 0 1 clamp(190px, 26vw, 320px);
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
}
#fl-sticky-bar .fl-sticky-col-variants {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(56vw, 560px);
  justify-content: flex-start;
  margin-right: 0;
}
#fl-sticky-bar .fl-sticky-col-qty {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-left: 0.1rem;
}
.fl-sticky-img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
  display: block;
}
.fl-sticky-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #111827;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  display: block;
  line-height: 1.3;
  max-height: 2.6em;
  max-width: none;
  width: 100%;
}
.fl-sticky-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #394873;
}
.fl-sticky-price.fl-sticky-out-of-stock {
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Zone variants dans sa colonne */
#fl-sticky-variants {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  
  justify-content: flex-start;
  align-content: center;
  max-width: 100%;
}

/* Select déclinaisons */
#fl-sticky-bar .fl-sticky-select {
  height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.85rem;
  color: #374151;
  background: #fff;
  cursor: pointer;
  width: clamp(110px, 12vw, 160px);
  max-width: 100%;
  outline: none;
}
#fl-sticky-bar .fl-sticky-select:focus { border-color: #394873; }

/* Zone smart qty */
.fl-sticky-smart-qty {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 100%;
}

/* Stepper inline (caché par défaut) */
#fl-sticky-bar .fl-sticky-stepper {
  display: flex;
  align-items: stretch;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  height: 42px;
  overflow: hidden;
  margin-right: 0;
}

@media (max-width: 1100px) {
  #fl-sticky-bar .fl-sticky-select {
    width: clamp(105px, 20vw, 145px);
  }

  #fl-sticky-bar .fl-sticky-inner {
    width: min(900px, calc(100vw - 1.25rem));
    gap: 0.55rem;
  }

  #fl-sticky-bar .fl-sticky-col-info {
    flex-basis: clamp(165px, 24vw, 260px);
  }
}
#fl-sticky-bar .fl-sticky-stepper .fl-sticky-qty-btn {
  width: 36px;
  height: 100%;
  background: #e5e7eb;
  border: none;
  font-size: 1.15rem;
  color: #374151;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.15s;
}
#fl-sticky-bar .fl-sticky-stepper .fl-sticky-qty-btn:hover:not(:disabled) { background: #d1d5db; }
#fl-sticky-bar .fl-sticky-stepper .fl-sticky-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#fl-sticky-bar .fl-sticky-count {
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  background: #e5e7eb;
}

/* Bouton panier */
#fl-sticky-bar .fl-sticky-atc-btn {
  width: 42px;
  height: 42px;
  background: #394873;
  color: #fff;
  border: none;
  border-radius: 26%;
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-right: 35px;
  margin-left: 35px;
}
#fl-sticky-bar .fl-sticky-atc-btn:hover:not(:disabled) { background: #2f3c60; }
#fl-sticky-bar .fl-sticky-atc-btn:disabled,
#fl-sticky-bar .fl-sticky-atc-btn.fl-sticky-atc-disabled {
  background: #9ca3af !important;
  cursor: not-allowed !important;
  opacity: 0.7;
}
#fl-sticky-bar .fl-sticky-atc-btn:disabled:hover,
#fl-sticky-bar .fl-sticky-atc-btn.fl-sticky-atc-disabled:hover {
  background: #9ca3af !important;
  cursor: not-allowed !important;
}

/* ── Toast ── */
.fl-sticky-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2937;
  color: #fff;
  padding: 0.55rem 1.2rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9100;
}
.fl-sticky-toast.fl-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Mobile ── */
@media (max-width: 768px) {
  #fl-sticky-bar .fl-sticky-inner {
    width: calc(100vw - 0.9rem);
    flex-wrap: wrap;
    padding: 0.75rem 0.5rem;
    gap: 0.5rem;
    min-height: auto;
    align-items: center;
    justify-content: center;
  }

  /* Colonne 1: Image */
  #fl-sticky-bar .fl-sticky-col-img .fl-sticky-img {
    width: 60px;
    height: 60px;
  }

  /* Colonne 2: Titre + Prix */
  #fl-sticky-bar .fl-sticky-col-info {
    flex: 1 1 180px;
    max-width: min(56vw, 320px);
    gap: 0.15rem;
  }
  .fl-sticky-title {
    font-size: 0.8rem;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    display: block;
    line-height: 1.3;
    max-height: 2.6em;
  }
  .fl-sticky-price {
    font-size: 0.9rem;
  }

  /* Colonne 3: Déclinaisons centrées sur une ligne dédiée */
  #fl-sticky-bar .fl-sticky-col-variants {
    flex: 1 1 100%;
    order: 3;
    margin-left: 0;
    max-width: 100%;
    justify-content: center;
  }
  #fl-sticky-variants {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.35rem;
  
    margin: 0 auto;
    width: min(100%, 341px);
  }
  #fl-sticky-bar .fl-sticky-select {
    width: 100%;
    min-width: 0;
    font-size: 0.75rem;
    padding: 0 0.5rem;
    height: 32px;
    max-width: 200px;
    margin: auto;
  }

  /* Colonne 4: Bouton/Stepper centré en dessous */
  #fl-sticky-bar .fl-sticky-col-qty {
    order: 4;
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: center;
  }
  #fl-sticky-bar .fl-sticky-smart-qty {
    justify-content: center;
    width: 100%;
  }
  #fl-sticky-bar .fl-sticky-atc-btn {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  #fl-sticky-bar .fl-sticky-stepper {
    height: 44px;
    margin-right: 0;
  }
  #fl-sticky-bar .fl-sticky-stepper .fl-sticky-qty-btn {
    width: 38px;
    height: 44px;
    font-size: 1.1rem;
  }
  #fl-sticky-bar .fl-sticky-count {
    min-width: 34px;
    font-size: 0.9rem;
  }
}

/* ── Très petit mobile ── */
@media (max-width: 380px) {
  #fl-sticky-bar .fl-sticky-inner {
    gap: 0.3rem;
    padding: 0.4rem 0.4rem;
  }
  #fl-sticky-bar .fl-sticky-col-img .fl-sticky-img {
    width: 40px;
    height: 40px;
  }
  .fl-sticky-title {
    font-size: 0.7rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    display: block;
    line-height: 1.3;
    max-height: 2.6em;
  }
  .fl-sticky-price {
    font-size: 0.8rem;
  }
  #fl-sticky-bar .fl-sticky-select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 0.65rem;
    padding: 0 0.25rem;
    height: 36px;
  }
  #fl-sticky-bar .fl-sticky-stepper {
    height: 36px;
  }
  #fl-sticky-bar .fl-sticky-stepper .fl-sticky-qty-btn {
    width: 30px;
    height: 36px;
    font-size: 0.9rem;
  }
  #fl-sticky-bar .fl-sticky-count {
    min-width: 26px;
    font-size: 0.8rem;
  }
  #fl-sticky-bar .fl-sticky-atc-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
}
