/* Dock flotante: chat y WhatsApp en esquinas independientes (sin ensanchar la página) */
html:has(#dp-floating-actions) {
    overflow-x: clip;
    max-width: 100%;
}

#dp-floating-actions {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    z-index: 9095;
    pointer-events: none;
    box-sizing: border-box;
    --dp-float-btn-size: 56px;
    --dp-float-btn-icon: 28px;
}

#dp-floating-actions > * {
    pointer-events: auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Esquinas compartidas */
#dp-floating-actions [data-dp-corner] {
    max-width: calc(100vw - 28px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}

#dp-floating-actions [data-dp-corner="bottom-left"] {
    position: fixed;
    left: max(14px, env(safe-area-inset-left, 0px));
    right: auto;
    top: auto;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px)));
}

#dp-floating-actions [data-dp-corner="bottom-right"] {
    position: fixed;
    right: max(14px, env(safe-area-inset-right, 0px));
    left: auto;
    top: auto;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px)));
}

#dp-floating-actions [data-dp-corner="top-left"] {
    position: fixed;
    left: max(14px, env(safe-area-inset-left, 0px));
    right: auto;
    top: max(76px, calc(64px + env(safe-area-inset-top, 0px)));
    bottom: auto;
}

#dp-floating-actions [data-dp-corner="top-right"] {
    position: fixed;
    right: max(14px, env(safe-area-inset-right, 0px));
    left: auto;
    top: max(76px, calc(64px + env(safe-area-inset-top, 0px)));
    bottom: auto;
}

#dp-floating-actions .whatsapp-float {
    position: fixed !important;
    margin: 0 !important;
    transform: none !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--dp-float-btn-size) !important;
    height: var(--dp-float-btn-size) !important;
    max-width: var(--dp-float-btn-size) !important;
    max-height: var(--dp-float-btn-size) !important;
    border-radius: 50% !important;
    background-color: #25d366 !important;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45) !important;
    box-sizing: border-box !important;
    z-index: 9097 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

/* Con chat activo: WhatsApp en esquina opuesta */
#dp-floating-actions.dp-floating-actions--prometheo-enabled a.whatsapp-float,
#dp-floating-actions.dp-floating-actions--dp-ai-enabled a.whatsapp-float,
#dp-floating-actions.dp-floating-actions--opposite-corners > a.whatsapp-float {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
}

html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--prometheo-enabled a.whatsapp-float,
html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--dp-ai-enabled a.whatsapp-float,
html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--opposite-corners > a.whatsapp-float {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
}

/* Esquinas explícitas: gana a temas (.whatsapp-float { right: 30px }) */
#dp-floating-actions a.whatsapp-float[data-dp-corner="bottom-left"],
#dp-floating-actions .dp-floating-actions__slot--chat[data-dp-corner="bottom-left"] {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
}

#dp-floating-actions a.whatsapp-float[data-dp-corner="bottom-right"],
#dp-floating-actions .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"] {
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
}

#dp-floating-actions a.whatsapp-float[data-dp-corner="top-left"],
#dp-floating-actions .dp-floating-actions__slot--chat[data-dp-corner="top-left"] {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    top: max(76px, calc(64px + env(safe-area-inset-top, 0px))) !important;
    bottom: auto !important;
}

#dp-floating-actions a.whatsapp-float[data-dp-corner="top-right"],
#dp-floating-actions .dp-floating-actions__slot--chat[data-dp-corner="top-right"] {
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    top: max(76px, calc(64px + env(safe-area-inset-top, 0px))) !important;
    bottom: auto !important;
}

#dp-floating-actions .whatsapp-float:hover {
    transform: scale(1.04) !important;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.52) !important;
}

#dp-floating-actions .whatsapp-float:active {
    transform: scale(0.96) !important;
}

#dp-floating-actions .whatsapp-float i {
    font-size: var(--dp-float-btn-icon) !important;
    line-height: 1 !important;
    margin: 0 !important;
}

/* Apilados en la misma esquina (tier): chat arriba del WA */
#dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-left"],
#dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"] {
    bottom: max(78px, calc(var(--dp-float-btn-size) + 12px + var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    z-index: 9098 !important;
}

/* Ficha producto / checkout móvil: barra sticky abajo — chat no tapa CTA derecho */
@media (max-width: 768px) {
    body.has-mobile-action-dock #dp-floating-actions [data-dp-corner="bottom-left"],
    body.has-mobile-action-dock #dp-floating-actions [data-dp-corner="bottom-right"],
    body.has-mobile-action-dock #dp-floating-actions .dp-floating-actions__slot--chat,
    body:has(#product-sticky-bar.visible) #dp-floating-actions [data-dp-corner="bottom-left"],
    body:has(#product-sticky-bar.visible) #dp-floating-actions [data-dp-corner="bottom-right"],
    body:has(#product-sticky-bar.visible) #dp-floating-actions .dp-floating-actions__slot--chat,
    body:has(#checkout-sticky-bar.visible) #dp-floating-actions [data-dp-corner="bottom-left"],
    body:has(#checkout-sticky-bar.visible) #dp-floating-actions [data-dp-corner="bottom-right"],
    body:has(#checkout-sticky-bar.visible) #dp-floating-actions .dp-floating-actions__slot--chat {
        bottom: max(16px, calc(var(--mobile-action-dock-h, 68px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    }

    /* Chat en bottom-right + sticky producto: subir a la izquierda, apilado sobre WA (libera Consultar/Agregar) */
    body.has-product-sticky-dock #dp-floating-actions.dp-floating-actions--dp-ai-enabled .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"],
    body.has-product-sticky-dock #dp-floating-actions.dp-floating-actions--prometheo-enabled .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"],
    body:has(#product-sticky-bar.visible) #dp-floating-actions.dp-floating-actions--dp-ai-enabled .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"],
    body:has(#product-sticky-bar.visible) #dp-floating-actions.dp-floating-actions--prometheo-enabled .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"] {
        left: max(14px, env(safe-area-inset-left, 0px)) !important;
        right: auto !important;
        top: auto !important;
        bottom: max(74px, calc(var(--dp-float-btn-size) + 10px + var(--mobile-action-dock-h, 68px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    }

    /* Checkout sticky: chat bottom-right pasa arriba-derecha */
    body.has-checkout-sticky-dock #dp-floating-actions .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"],
    body:has(#checkout-sticky-bar.visible) #dp-floating-actions .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"] {
        left: auto !important;
        right: max(14px, env(safe-area-inset-right, 0px)) !important;
        top: max(76px, calc(64px + env(safe-area-inset-top, 0px))) !important;
        bottom: auto !important;
    }

    body.has-mobile-action-dock #dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-left"],
    body.has-mobile-action-dock #dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"],
    body:has(#product-sticky-bar.visible) #dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-left"],
    body:has(#product-sticky-bar.visible) #dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"] {
        bottom: max(74px, calc(var(--dp-float-btn-size) + 10px + var(--mobile-action-dock-h, 68px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    }
}

/* Prometheo aún no acoplado: no desplazar el layout horizontal */
body > div:has(> iframe[src*="prometheo"]),
body > div:has(iframe[src*="prometheo"]) {
    max-width: 100vw !important;
}

#dp-floating-actions .dp-floating-actions__slot--chat {
    position: fixed !important;
    z-index: 9098 !important;
    width: var(--dp-float-btn-size) !important;
    height: var(--dp-float-btn-size) !important;
    max-width: var(--dp-float-btn-size) !important;
    max-height: var(--dp-float-btn-size) !important;
    min-width: var(--dp-float-btn-size) !important;
    min-height: var(--dp-float-btn-size) !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

#dp-floating-actions .dp-chat-slot-placeholder {
    display: block;
    width: var(--dp-float-btn-size);
    height: var(--dp-float-btn-size);
    border-radius: 50%;
    margin: 0;
    pointer-events: none;
    opacity: 0;
}

#dp-floating-actions .dp-store-chat-root ~ .dp-chat-slot-placeholder,
#dp-floating-actions .dp-chat-docked ~ .dp-chat-slot-placeholder {
    display: none !important;
}

/* Prometheo acoplado: el launcher no puede escapar con position:fixed propio */
body.dp-prometheo-ready:not(.dp-prometheo-panel-open) #dp-floating-actions .dp-floating-actions__slot--chat .dp-prometheo-docked {
    position: static !important;
    inset: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
    max-width: var(--dp-float-btn-size) !important;
    max-height: var(--dp-float-btn-size) !important;
}

body.dp-prometheo-ready:not(.dp-prometheo-panel-open) #dp-floating-actions .dp-prometheo-docked,
body.dp-prometheo-ready:not(.dp-prometheo-panel-open) #dp-floating-actions .dp-prometheo-docked * {
    max-width: 100% !important;
}

body.dp-prometheo-ready:not(.dp-prometheo-panel-open) #dp-floating-actions .dp-prometheo-docked button,
body.dp-prometheo-ready:not(.dp-prometheo-panel-open) #dp-floating-actions .dp-prometheo-docked [role="button"],
body.dp-prometheo-ready:not(.dp-prometheo-panel-open) #dp-floating-actions .dp-prometheo-docked iframe {
    position: static !important;
    inset: auto !important;
    transform: none !important;
}

html body #dp-floating-actions.dp-floating-actions--prometheo-enabled > a.whatsapp-float,
html body #dp-floating-actions.dp-floating-actions--opposite-corners > a.whatsapp-float {
    left: 14px !important;
    right: auto !important;
    inset-inline-start: 14px !important;
    inset-inline-end: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    z-index: 9097 !important;
}

#dp-floating-actions .dp-store-chat-launcher,
#dp-floating-actions .dp-chat-docked .dp-store-chat-launcher {
    width: var(--dp-float-btn-size) !important;
    height: var(--dp-float-btn-size) !important;
}

/* Panel de chat abierto (DP Assistant) — compacto, esquina inferior */
body.dp-store-chat-open #dp-floating-actions .dp-store-chat-panel.is-open {
    position: fixed !important;
    left: auto !important;
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    top: auto !important;
    bottom: max(12px, calc(var(--mobile-action-dock-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    width: min(360px, calc(100vw - 28px)) !important;
    max-width: 360px !important;
    height: min(620px, calc(100vh - 100px)) !important;
    max-height: min(620px, calc(100vh - var(--mobile-action-dock-h, 0px) - 96px)) !important;
    z-index: 9105 !important;
}

body.dp-store-chat-open #dp-floating-actions .dp-floating-actions__slot--chat[data-dp-corner="bottom-left"] .dp-store-chat-panel.is-open,
body.dp-store-chat-open #dp-floating-actions .dp-store-chat-panel.is-open[data-dp-corner="bottom-left"] {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
}

@media (max-width: 768px) {
    body.dp-store-chat-open.has-mobile-action-dock #dp-floating-actions .dp-store-chat-panel.is-open,
    body.dp-store-chat-open:has(#product-sticky-bar.visible) #dp-floating-actions .dp-store-chat-panel.is-open {
        bottom: max(12px, calc(var(--mobile-action-dock-h, 68px) + env(safe-area-inset-bottom, 0px))) !important;
        width: min(360px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: min(58vh, calc(100vh - var(--mobile-action-dock-h, 68px) - 80px)) !important;
    }
}

/* Panel de chat Prometheo abierto */
body.dp-prometheo-panel-open #dp-floating-actions .dp-floating-actions__slot--chat .dp-prometheo-docked {
    position: fixed !important;
    left: max(10px, env(safe-area-inset-left, 0px)) !important;
    right: max(10px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    max-width: calc(100% - 20px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
    width: auto !important;
    max-height: min(72vh, 560px) !important;
    z-index: 9105 !important;
    overflow: visible !important;
}

@media (max-width: 768px) {
    #dp-floating-actions {
        --dp-float-btn-size: 52px;
        --dp-float-btn-icon: 24px;
    }

    #dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-left"],
    #dp-floating-actions.dp-floating-actions--stack .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"] {
        bottom: max(74px, calc(var(--dp-float-btn-size) + 10px + var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    }

    body:has(#cart-modal.cart-modal-overlay.active) #dp-floating-actions [data-dp-corner="bottom-right"].whatsapp-float,
    body:has(#cart-modal.cart-modal-overlay.active) #dp-floating-actions [data-dp-corner="bottom-right"].dp-floating-actions__slot--chat {
        bottom: max(88px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    }

    body:has(#cart-modal.cart-modal-overlay.active) #dp-floating-actions [data-dp-corner="bottom-left"].whatsapp-float,
    body:has(#cart-modal.cart-modal-overlay.active) #dp-floating-actions [data-dp-corner="bottom-left"].dp-floating-actions__slot--chat {
        bottom: max(88px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    }
}

@media (min-width: 769px) {
    body:has(#cart-modal.cart-modal-overlay.active) #dp-floating-actions [data-dp-corner="bottom-right"].whatsapp-float {
        right: calc(min(400px, 100%) + 20px) !important;
    }
}

/* Fallback: WA fuera del dock (tiendas legacy) */
html body a.whatsapp-float:not([data-dp-corner]) {
    position: fixed;
    bottom: calc(24px + var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px));
    right: max(24px, env(safe-area-inset-right, 0px));
    left: auto;
    z-index: 9100;
}

/* Temas con .whatsapp-float { right: 30px } — refuerzo final por esquina */
html body[class*="theme-"] #dp-floating-actions a.whatsapp-float[data-dp-corner="bottom-left"] {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
}
html body[class*="theme-"] #dp-floating-actions a.whatsapp-float[data-dp-corner="bottom-right"] {
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
}
html body[class*="theme-"] #dp-floating-actions a.whatsapp-float[data-dp-corner="top-left"] {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    top: max(76px, calc(64px + env(safe-area-inset-top, 0px))) !important;
    bottom: auto !important;
}
html body[class*="theme-"] #dp-floating-actions a.whatsapp-float[data-dp-corner="top-right"] {
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    top: max(76px, calc(64px + env(safe-area-inset-top, 0px))) !important;
    bottom: auto !important;
}

/* Banner cookies: chat Prometheo nativo sube junto con WhatsApp */
body.has-cookie-banner > div:has(iframe[src*="prometheo"]),
body.has-cookie-banner > div:has(iframe[src*="prometheo.ai"]) {
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    top: auto !important;
}

/* Prometheo suelto en body (antes de acoplarse al dock): ocultar para no duplicar con WA */
body:has(script[src*="app.prometheo.ai/widget"]) > .dp-prometheo-stray,
body:has(script[src*="app.prometheo.ai/widget"]) > div:has(> iframe[src*="prometheo"]):not(#dp-floating-actions):not(.dp-prometheo-docked),
body:has(script[src*="app.prometheo.ai/widget"]) > div:has(iframe[src*="prometheo"]):not(#dp-floating-actions):not(.dp-prometheo-docked),
body:has(#dp-chat-slot) > .dp-prometheo-stray,
body:has(#dp-chat-slot) > div:has(> iframe[src*="prometheo"]):not(#dp-floating-actions):not(.dp-prometheo-docked),
body:has(#dp-chat-slot) > div:has(iframe[src*="prometheo"]):not(#dp-floating-actions):not(.dp-prometheo-docked) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

body.dp-prometheo-ready > .dp-prometheo-stray,
body.dp-prometheo-ready > div:has(> iframe[src*="prometheo"]):not(#dp-floating-actions):not(.dp-prometheo-docked),
body.dp-prometheo-ready > div:has(iframe[src*="prometheo"]):not(#dp-floating-actions):not(.dp-prometheo-docked) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Refuerzo final: temas con .whatsapp-float { right: 30px !important } */
html body #dp-floating-actions.dp-floating-actions--opposite-corners > a.whatsapp-float[data-dp-corner="bottom-left"],
html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--opposite-corners > a.whatsapp-float[data-dp-corner="bottom-left"] {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
}

/* Reset tema global (.whatsapp-float { right:30px }) antes de esquina */
html body #dp-floating-actions a.whatsapp-float--dock-left,
html body #dp-floating-actions a.whatsapp-float[data-dp-corner="bottom-left"] {
    right: auto !important;
    inset-inline-end: auto !important;
}

html body.dp-floating-wa-left #dp-floating-actions > a.whatsapp-float {
    left: 14px !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(16px + var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px)) !important;
}

/* Prometheo acoplado: temas (p. ej. natural.css z-index 99999999) no pueden recentrar WA */
html body.dp-prometheo-ready #dp-floating-actions.dp-floating-actions--opposite-corners > a.whatsapp-float,
html body #dp-floating-actions.dp-floating-actions--prometheo-enabled.dp-floating-actions--opposite-corners > a.whatsapp-float,
html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--prometheo-enabled > a.whatsapp-float[data-dp-corner="bottom-left"],
html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--prometheo-enabled > a.whatsapp-float[data-dp-corner="top-left"],
html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--dp-ai-enabled > a.whatsapp-float[data-dp-corner="bottom-left"],
html body[class*="theme-"] #dp-floating-actions.dp-floating-actions--dp-ai-enabled > a.whatsapp-float[data-dp-corner="top-left"] {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    inset-inline-start: max(14px, env(safe-area-inset-left, 0px)) !important;
    inset-inline-end: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 9097 !important;
}

html body #dp-floating-actions.dp-floating-actions--dp-ai-enabled .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"],
html body #dp-floating-actions.dp-floating-actions--opposite-corners .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"] {
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    inset-inline-end: max(14px, env(safe-area-inset-right, 0px)) !important;
    inset-inline-start: auto !important;
}

/* WA a la izquierda cuando hay script Prometheo aunque el dock PHP salió solo con wa-only (cache / orden de includes) */
html body:has(script[src*="app.prometheo.ai/widget"]) #dp-floating-actions > a.whatsapp-float {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 9097 !important;
}

body:has(#dp-floating-actions.dp-floating-actions--prometheo-enabled) a.whatsapp-float:not([data-dp-corner]),
body:has(#dp-floating-actions.dp-floating-actions--dp-ai-enabled) a.whatsapp-float:not([data-dp-corner]) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Prometheo: WhatsApp siempre en esquina opuesta al chat (gana a data-dp-corner=bottom-right del tier) */
html body.dp-prometheo-ready #dp-floating-actions.dp-floating-actions--prometheo-enabled > a.whatsapp-float,
html body.dp-floating-wa-left #dp-floating-actions.dp-floating-actions--prometheo-enabled > a.whatsapp-float,
html body[class*="theme-"].dp-prometheo-ready #dp-floating-actions.dp-floating-actions--prometheo-enabled > a.whatsapp-float {
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    inset-inline-start: max(14px, env(safe-area-inset-left, 0px)) !important;
    inset-inline-end: auto !important;
    top: auto !important;
    bottom: max(16px, calc(var(--mobile-action-dock-h, 0px) + var(--cookie-banner-h, 0px) + env(safe-area-inset-bottom, 0px))) !important;
    transform: none !important;
    margin: 0 !important;
    z-index: 9097 !important;
}

html body.dp-prometheo-ready #dp-floating-actions.dp-floating-actions--prometheo-enabled .dp-floating-actions__slot--chat[data-dp-corner="bottom-right"],
html body.dp-prometheo-ready #dp-floating-actions.dp-floating-actions--prometheo-enabled .dp-floating-actions__slot--chat[data-dp-corner="top-right"] {
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    z-index: 9098 !important;
}

/* El checkout móvil reserva la pantalla para el formulario y su CTA fijo. */
@media (max-width: 900px) {
    body:has(#checkout-form) #dp-floating-actions,
    body:has(#checkout-form) > a.whatsapp-float:not([data-dp-corner]) {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

/* En las fichas móviles, el precio y la acción fija tienen prioridad visual. */
@media (max-width: 768px) {
    body:has(.product-detail-wrapper) #dp-floating-actions,
    body:has(.product-detail-wrapper) a.whatsapp-float:not([data-dp-corner]) {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}
