/* Web4Live — Icône panier flottante V2 1.0.0 (charte flottants : or #BFAC84, brun #2A221C, liseré #E8DFC8, pastille #6E5B35). */
#w4l-panier-icone[hidden],
html:not(.w4l-pi-on) #w4l-panier-icone { display: none !important; }

html.w4l-pi-on body #w4l-panier-icone {
  position: fixed; top: auto; z-index: 10005;
  display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; margin: 0; padding: 0;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid #E8DFC8; background: #BFAC84; color: #2A221C;
  box-shadow: 0 2px 8px rgba(42,34,28,.14);
  text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: left .28s ease, opacity .28s ease, transform .28s ease, visibility .28s ease, background-color .2s ease;
}
html.w4l-pi-on body #w4l-panier-icone svg { width: 22px; height: 22px; display: block; }
html.w4l-pi-on body #w4l-panier-icone:hover { background: #D9C9A3; }
html.w4l-pi-on body #w4l-panier-icone:focus-visible { outline: 3px solid #6E5B35; outline-offset: 2px; }
#w4l-panier-icone .w4l-pi__n {
  position: absolute; top: -5px; right: -5px;
  min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
  border-radius: 10px; background: #6E5B35; color: #FFFDF9;
  font: 700 11px/20px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center;
}
#w4l-panier-icone .w4l-pi__n:empty { display: none; }
#w4l-panier-icone .w4l-pi__sr {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Bureau : en bas à droite (le retour en haut Divi est plus haut, à droite). */
@media (min-width: 981px) {
  html.w4l-pi-on body #w4l-panier-icone { right: 18px; left: auto; bottom: 20px; }
  /* Si l'icône native xoo réapparaît un jour (fragments réparés), pas de doublon. */
  html.w4l-pi-on.w4l-pi-xoo body #w4l-panier-icone { display: none !important; }
}

/* Mobile sans rangée flottants (avant init) : à droite, au-dessus de la barre d'appli. */
@media (max-width: 980px) {
  html.w4l-pi-on:not(.w4l-float-ready) body #w4l-panier-icone {
    right: max(12px, env(safe-area-inset-right, 0px)); left: auto;
    bottom: calc(var(--cc-nav-h, 68px) + 12px + env(safe-area-inset-bottom, 0px));
    width: 40px; height: 40px;
  }
  /* Rangée flottants : téléphone | (cloche) | chevron | PANIER — toujours juste à droite du chevron. */
  html.w4l-pi-on.w4l-float-ready body #w4l-panier-icone {
    right: auto;
    bottom: var(--w4l-float-base, 80px);
    width: var(--w4l-float-btn, 40px); height: var(--w4l-float-btn, 40px);
    min-width: 40px; min-height: 40px;
    left: calc(max(6px, env(safe-area-inset-left, 0px)) + var(--w4l-float-toggle-x, 88px) + var(--w4l-float-gap, 44px));
  }
  html.w4l-pi-on.w4l-float-ready.w4l-float-replie body #w4l-panier-icone {
    left: calc(max(6px, env(safe-area-inset-left, 0px)) + (var(--w4l-float-gap, 44px) * 2));
  }
  html.w4l-pi-on.w4l-float-ready body #w4l-panier-icone svg { width: 20px; height: 20px; }
  /* Fiche produit mobile : la rangée flottants y est masquée (champ quantité) ; l'icône passe à droite,
     au-dessus du bouton « retour en haut ». */
  html.w4l-pi-on body.single-product #w4l-panier-icone,
  html.w4l-pi-on.w4l-float-ready body.single-product #w4l-panier-icone,
  html.w4l-pi-on.w4l-float-ready.w4l-float-replie body.single-product #w4l-panier-icone {
    left: auto;
    right: max(6px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--w4l-float-base, 80px) + var(--w4l-float-btn, 40px) + 8px);
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  }
  html.w4l-pi-on.w4l-float-ready body.single-product #w4l-float-rail { width: var(--w4l-float-rail-w, 100px) !important; }
  /* Fond de rangée élargi d'un bouton (calcul flottants inchangé, +44px). */
  html.w4l-pi-on.w4l-float-ready body #w4l-float-rail {
    width: calc(var(--w4l-float-rail-w, 140px) + var(--w4l-float-gap, 44px)) !important;
  }
  /* Option « masque » : même logique que l'ancien basket xoo quand la rangée est repliée. */
  html.w4l-pi-on.w4l-pi-replie-masque.w4l-float-ready.w4l-float-replie body #w4l-panier-icone {
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-12px);
  }
  html.w4l-pi-on.w4l-pi-replie-masque.w4l-float-ready.w4l-float-replie body #w4l-float-rail {
    width: var(--w4l-float-rail-w, 100px) !important;
  }
  /* Saisie dans un champ : hors du chemin, comme cloche/chevron (1.2.5). */
  html.w4l-pi-on.w4l-float-field-focus body #w4l-panier-icone {
    opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
  }
  html.w4l-pi-on.w4l-float-ready.w4l-float-field-focus body #w4l-float-rail { width: 56px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html.w4l-pi-on body #w4l-panier-icone { transition: none; }
}
