/* =====================================================================
   Bono de envío progresivo — barra en el carrito
   ===================================================================== */

.anali-bono {
    background: #fff;
    border: 1px solid #efe2ea;
    border-radius: 18px;
    padding: 18px 18px 20px;
    box-shadow: 0 10px 30px rgba(81, 22, 44, 0.10);
    position: relative;
    overflow: hidden;
    margin: 0 0 24px;
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    color: #3a2530;
    transition: background 0.35s, border-color 0.35s;
}

.anali-bono.is-free {
    background: linear-gradient(135deg, #ffffff, #fbf3f7);
    border-color: #d9b8c8;
}

.anali-bono__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.anali-bono__gift {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #51162C, #7C3650);
    box-shadow: 0 4px 10px rgba(81, 22, 44, 0.25);
    font-size: 19px;
}

/* Animación del regalo al agregar un producto (se aplica vía JS). */
@keyframes analiBonoGiftBump {
    0%   { transform: scale(1)    rotate(0deg); }
    20%  { transform: scale(1.85) rotate(-16deg); }
    40%  { transform: scale(1.5)  rotate(13deg); }
    60%  { transform: scale(1.7)  rotate(-9deg); }
    80%  { transform: scale(1.4)  rotate(5deg); }
    100% { transform: scale(1)    rotate(0deg); }
}

.anali-bono-bump {
    animation: analiBonoGiftBump 0.7s ease;
    transform-origin: center 70%;
    position: relative;
    z-index: 2; /* que el regalo crezca por encima del resto, sin recortarse */
}

.anali-bono__title {
    font-size: 13px;
    color: #8a7680;
    font-weight: 500;
    line-height: 1.1;
}

.anali-bono__amount {
    font-size: 24px;
    font-weight: 800;
    color: #51162C;
    line-height: 1.05;
    letter-spacing: -0.3px;
}

.anali-bono__amount small {
    font-size: 13px;
    font-weight: 600;
    color: #A7657D;
}

.anali-bono__msg {
    font-size: 13.5px;
    line-height: 1.35;
    margin: 2px 0 14px;
    color: #5d4a53;
}

.anali-bono__msg b {
    color: #51162C;
}

.anali-bono__msg .anali-bono__old {
    color: #b39aa6;
    font-weight: 600;
    text-decoration: line-through;
}

/* Fila "Ahorro en envío" en el resumen del carrito/checkout */
.anali-envio-ahorro th,
.anali-envio-ahorro td {
    color: #3FA66A !important;
    font-weight: 600;
}

/* Fila del bono de descuento (real → pagas) en el resumen — compacta */
.anali-bono-progreso td {
    color: #7C3650 !important;
    font-size: 11px;
    line-height: 1.3;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}
.anali-bono-progreso s {
    color: #b39aa6;
}
.anali-bono-progreso b {
    color: #51162C;
}
.anali-bono-progreso__off {
    color: #3FA66A;
    font-weight: 600;
}

@media (max-width: 600px) {
    .anali-bono-progreso td {
        font-size: 9.5px;
        line-height: 1.25;
        white-space: nowrap;
    }
}

.anali-bono__free-txt {
    color: #3FA66A;
    font-weight: 700;
}

/* Barra de progreso */
.anali-bono__track {
    position: relative;
    height: 14px;
    border-radius: 20px;
    background: #efe1e9;
    overflow: hidden;
}

.anali-bono__fill {
    position: absolute;
    inset: 0;
    width: 0;
    border-radius: 20px;
    background: linear-gradient(90deg, #51162C, #A7657D, #ce9db0);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.anali-bono__fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: analiBonoSheen 2.4s infinite;
}

@keyframes analiBonoSheen {
    0%   { transform: translateX(-100%); }
    60%  { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

.anali-bono__scale {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    font-size: 11px;
    color: #a8949e;
}

.anali-bono__scale b {
    color: #A7657D;
}

@media (max-width: 480px) {
    .anali-bono {
        padding: 15px 15px 17px;
        border-radius: 15px;
    }
    .anali-bono__amount {
        font-size: 21px;
    }
}

/* =====================================================================
   Barra FLOTANTE (sitewide) — aparece abajo cuando hay productos
   ===================================================================== */
.anali-bono-float {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998; /* debajo del botón de WhatsApp (z muy alto) */
    padding: 0 16px 16px;       /* separa la píldora de los bordes/abajo */
    pointer-events: none;        /* solo la píldora es clickeable */
    transform: translateY(0);
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.anali-bono-float--hidden {
    transform: translateY(240%);
    pointer-events: none;
}

.anali-bono-float__inner {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    max-width: 540px;
    margin: 0 auto;              /* centrada, no ocupa todo el ancho */
    text-decoration: none;
    background: linear-gradient(120deg, #51162C, #7C3650 55%, #A7657D);
    color: #fff5fa;
    padding: 11px 20px;
    border-radius: 40px;         /* la curva bonita (forma de píldora) */
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 32px rgba(81, 22, 44, 0.34), 0 3px 8px rgba(81, 22, 44, 0.22);
    overflow: hidden;
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
}

/* brillo suave en la curva superior de la píldora */
.anali-bono-float__inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.anali-bono-float__inner.is-free {
    background: linear-gradient(120deg, #2f7d50, #3FA66A 60%, #5cc185);
}

/* Carrito vacío: invitación a comprar — llamativa con brillo dorado */
.anali-bono-float__inner.is-invite {
    background: linear-gradient(120deg, #51162C, #7C3650 50%, #A7657D);
    box-shadow: 0 14px 32px rgba(81, 22, 44, 0.34), 0 0 0 0 rgba(232, 185, 100, 0.55);
    animation: analiBonoInvitePulse 2.6s ease-in-out infinite;
}

.anali-bono-float__inner.is-invite .anali-bono-float__icon {
    animation: analiBonoInviteWobble 2.6s ease-in-out infinite;
}

.anali-bono-float__sub {
    display: block;
    font-size: 11.5px;
    line-height: 1.2;
    margin-top: 2px;
    color: #fbe0d0;
}

.anali-bono-float__sub b {
    color: #ffe6b0;
    font-weight: 700;
}

@keyframes analiBonoInvitePulse {
    0%, 100% { box-shadow: 0 -6px 18px rgba(81, 22, 44, 0.28), 0 0 0 0 rgba(232, 185, 100, 0.0); }
    50%      { box-shadow: 0 -6px 22px rgba(81, 22, 44, 0.34), 0 0 16px 2px rgba(232, 185, 100, 0.45); }
}

@keyframes analiBonoInviteWobble {
    0%, 88%, 100% { transform: rotate(0deg) scale(1); }
    91% { transform: rotate(-12deg) scale(1.12); }
    94% { transform: rotate(10deg)  scale(1.12); }
    97% { transform: rotate(-6deg)  scale(1.06); }
}

.anali-bono-float__icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.anali-bono-float__heart {
    width: 20px;
    height: 20px;
    display: block;
}

.anali-bono-float__text {
    flex: 1 1 auto;
    min-width: 0;            /* permite recortar el texto en vez de desbordar */
    display: flex;
    flex-direction: column;
    color: #fbe9f0;
}

.anali-bono-float__msg {
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;     /* siempre en una sola línea */
    overflow: hidden;
    text-overflow: ellipsis;
}

.anali-bono-float__text b {
    color: #fff;
    font-weight: 700;
}

.anali-bono-float__track {
    display: block;
    height: 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    margin-top: 5px;
    overflow: hidden;
    max-width: 460px;
}

.anali-bono-float__fill {
    display: block;
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #E8B964, #f6d99a);
    transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.is-free .anali-bono-float__fill {
    background: linear-gradient(90deg, #bdebcd, #ffffff);
}

.anali-bono-float__cta {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    opacity: 0.92;
    white-space: nowrap;
    cursor: pointer;
}

/* Botón de cerrar/ocultar la píldora */
.anali-bono-float__close {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.anali-bono-float__close:hover {
    background: rgba(255, 255, 255, 0.34);
    transform: scale(1.08);
}

/* =====================================================================
   Botón para volver a mostrar la barra (cuando el cliente la ocultó)
   ===================================================================== */
.anali-bono-reopen {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 99990; /* por encima de los muñecos flotantes (osito/monito) */
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px 9px 9px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(120deg, #51162C, #7C3650);
    color: #fff;
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 10px 24px rgba(81, 22, 44, 0.34);
    cursor: pointer;
    transform: translateY(160%);   /* oculto por defecto */
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
}

.anali-bono-reopen.is-shown {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.anali-bono-reopen__ico {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
}

.anali-bono-reopen__ico svg {
    width: 14px;
    height: 14px;
    display: block;
}

@media (max-width: 600px) {
    /* En móvil la barra va abajo (ancho casi completo) y subimos los muñecos por
       encima de ella, en vez de subir la barra. */
    .anali-bono-float {
        padding: 0 12px;
        bottom: 14px;
    }
    /* Subimos los muñecos flotantes de Elementor (osito/monito) por encima de la
       barra para que no se monten. */
    .e-contact-buttons {
        --e-contact-buttons-vertical-offset: 170px !important;
    }
    /* El botón de WhatsApp (plugin click-to-chat) sube igual; su posición va en
       estilo inline, por eso el !important. */
    #ht-ctc-chat {
        bottom: 70px !important;
    }
    .anali-bono-float__inner {
        padding: 9px 14px;
        gap: 10px;
    }
    .anali-bono-float__msg {
        font-size: 11.5px;
    }
    .anali-bono-float__cta {
        display: none; /* en móvil se gana espacio; toda la barra es clickeable */
    }
    .anali-bono-float__icon {
        width: 32px;
        height: 32px;
    }
    .anali-bono-float__heart {
        width: 18px;
        height: 18px;
    }
    /* El botón de reabrir sube y se centra, para no quedar sobre los muñecos
       de las esquinas. */
    .anali-bono-reopen {
        left: 0;
        right: 0;
        margin: 0 auto;
        width: -moz-fit-content;
        width: fit-content;
        bottom: 14px;
    }
}
