/* Cohabitation avec les chat widgets bas-droite (Tawk.to en prod, Zendesk possible).
   Le JS mesure la position reelle de l'iframe chat et met `bottom` en inline-style.
   La valeur ci-dessous est un fallback si le chat est detecte mais non mesurable. */
.repi-wa-widget {
    position: fixed;
    bottom: 100px;
    right: 11px;
    /* z-index aligne sur l'overlay panier (9998) : on reste sous les modals
       et overlays full-screen mais au-dessus du contenu standard. */
    z-index: 9990;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s,
                bottom 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Aucun chat detecte : bulle en bas (la classe est posee par defaut par le JS,
   puis retiree si une iframe chat est trouvee dans <body>). */
body.repi-wa-no-zendesk .repi-wa-widget {
    bottom: 10px;
}

.repi-wa-widget.repi-wa-hidden,
.repi-wa-widget.repi-wa-pending {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

/* Hors horaires de bureau (lun-ven 9h-17h25, heure Madrid) : on retire
   completement la bulle du flux pour eviter tout chevauchement avec Tawk
   ou d'autres widgets, et eviter tout rendu/calcul de position. */
.repi-wa-widget.repi-wa-closed {
    display: none !important;
}

.repi-wa-btn {
    display: flex;
    align-items: center;
    background: #25D366;
    border: none;
    border-radius: 50px;
    height: 52px;
    padding: 0 6px 0 14px;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
    transition: width 0.4s cubic-bezier(.4, 0, .2, 1), padding 0.4s cubic-bezier(.4, 0, .2, 1);
    width: 170px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', sans-serif;
}

.repi-wa-btn:hover,
.repi-wa-btn:focus {
    text-decoration: none;
    color: #fff;
}

.repi-wa-btn.collapsed {
    width: 52px;
    padding: 0;
}

.repi-wa-icon-wrap {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    transition: margin 0.4s cubic-bezier(.4, 0, .2, 1);
}

.repi-wa-btn.collapsed .repi-wa-icon-wrap {
    margin-right: 0;
    margin-left: 13px;
}

.repi-wa-icon {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.repi-wa-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.25s cubic-bezier(.4, 0, .2, 1);
    white-space: nowrap;
}

.repi-wa-btn.collapsed .repi-wa-text {
    opacity: 0;
    pointer-events: none;
}

.repi-wa-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.3;
}

.repi-wa-number {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

/* Masquage automatique quand panier/modal/sidebar/dropdown ouverts */
html.show-cart .repi-wa-widget,
html.modal-open .repi-wa-widget,
body.modal-open .repi-wa-widget,
html.menu-open .repi-wa-widget,
body.menu-open .repi-wa-widget,
html.filter-open .repi-wa-widget,
body.filter-open .repi-wa-widget {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

@media (max-width: 575px) {
    .repi-wa-widget {
        bottom: 80px;
        right: 12px;
    }
    body.repi-wa-no-zendesk .repi-wa-widget {
        bottom: 10px;
    }
    /* Page produit en mobile : la bulle gene le bouton "Ajouter au panier"
       sticky bas et le tunnel d'achat. On la masque completement. */
    .repi-wa-widget.repi-wa-on-product {
        display: none !important;
    }
}
