/* Damaju — Floating Cart Widget */

#damaju-floating-cart {
    position: fixed;
    bottom: 24px;
    right: 18px;
    z-index: 999999;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #0071dc;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.30), 0 1px 4px rgba(0, 0, 0, 0.20);
    opacity: 0;
    transform: scale(0.6);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#damaju-floating-cart.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    animation: damaju-cart-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#damaju-floating-cart:hover {
    background: #e63946;
    transform: scale(1.08);
}

#damaju-floating-cart:focus-visible {
    outline: 3px solid #e63946;
    outline-offset: 3px;
}

#damaju-floating-cart svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.damaju-fc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #e63946;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 20px;
    text-align: center;
    padding: 0 5px;
    box-sizing: border-box;
    border: 2px solid #fff;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.damaju-fc-badge:not(:empty) {
    opacity: 1;
    transform: scale(1);
}

.damaju-fc-badge.bump {
    animation: damaju-badge-bump 0.3s ease;
}

@keyframes damaju-cart-pop {
    0%   { transform: scale(0.6); opacity: 0; }
    60%  { transform: scale(1.12); }
    100% { transform: scale(1);   opacity: 1; }
}

@keyframes damaju-badge-bump {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.4); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    #damaju-floating-cart {
        width: 44px;
        height: 44px;
        bottom: 25px;
        right: 15px;
    }

    /* Desplazamiento hacia arriba cuando se baja al 20% en páginas de producto */
    body.single-product #damaju-floating-cart.shifted-up {
        bottom: 77px;
    }

    /* En Mi Cuenta hay una barra de navegación inferior fija (.dmj-mobile-nav)
       que tapa el carrito: lo elevamos por encima de ella. */
    body.woocommerce-account #damaju-floating-cart {
        bottom: 90px;
    }
}
