/* =====================================================
   NOTIFICACIÓN "AGREGADO AL CARRITO" PERSONALIZADA
   ===================================================== */

/* Ocultar notices nativas del tema (el toast personalizado las reemplaza).
   Este CSS solo se carga fuera de checkout, así que no afecta errores del checkout. */
.woocommerce-notices-wrapper--ajax .woocommerce-notice {
    display: none !important;
}

/* Toast personalizado Analí */
.anali-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    background: linear-gradient(135deg, #7C3650 0%, #a7657d 60%, #c9849a 100%);
    color: #fff;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow:
        0 8px 32px rgba(124, 54, 80, 0.4),
        0 0 20px rgba(167, 101, 125, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.15);
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 14px;
    animation: analiToastIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
}

.anali-toast::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: analiGlow 3s ease-in-out infinite;
    pointer-events: none;
}

.anali-toast.anali-toast--out {
    animation: analiToastOut 0.4s ease-in forwards;
}

/* Variante de error (sin existencias) */
.anali-toast--error {
    background: linear-gradient(135deg, #8B3A3A 0%, #c0392b 60%, #e74c3c 100%);
    box-shadow:
        0 8px 32px rgba(192, 57, 43, 0.4),
        0 0 20px rgba(231, 76, 60, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.15);
}

.anali-toast--error::before {
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 60%);
}

.anali-toast--error .anali-toast-icon {
    filter: drop-shadow(0 0 6px rgba(255, 200, 50, 0.5));
}

.anali-toast--error .anali-toast-product {
    white-space: normal;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.95;
}

.anali-toast--error .anali-toast-progress {
    background: linear-gradient(90deg, rgba(255,200,50,0.6), rgba(255,255,255,0.4));
}

/* Partículas flotantes */
.anali-toast-sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.anali-sparkle {
    position: absolute;
    color: rgba(255, 215, 0, 0.8);
    font-size: 10px;
    animation-timing-function: ease-in-out;
    animation-fill-mode: both;
}

.anali-sparkle--1 {
    top: 15%; left: 10%;
    animation: analiFloat1 2.5s 0.4s infinite;
}
.anali-sparkle--2 {
    top: 60%; left: 25%;
    font-size: 8px;
    animation: analiFloat2 3s 0.6s infinite;
}
.anali-sparkle--3 {
    top: 20%; right: 30%;
    font-size: 7px;
    animation: analiFloat3 2.8s 0.8s infinite;
}
.anali-sparkle--4 {
    bottom: 25%; right: 15%;
    font-size: 9px;
    animation: analiFloat1 3.2s 0.3s infinite;
}
.anali-sparkle--5 {
    top: 45%; left: 50%;
    font-size: 6px;
    animation: analiFloat2 2.6s 1s infinite;
}

/* Ícono principal */
.anali-toast-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: analiSparkle 0.7s ease-out 0.3s both;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
    position: relative;
    z-index: 1;
}

.anali-toast-body {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.anali-toast-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.anali-toast-product {
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Botón con shimmer */
.anali-toast-btn {
    display: inline-block;
    margin-top: 10px;
    background: linear-gradient(90deg, #fff 0%, #fff 100%);
    color: #7C3650;
    border: none;
    border-radius: 10px;
    padding: 7px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.anali-toast-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(167, 101, 125, 0.2), transparent);
    animation: analiShimmer 2.5s 1s infinite;
}

.anali-toast-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(124, 54, 80, 0.3);
    color: #7C3650;
}

.anali-toast-btn span {
    position: relative;
    z-index: 1;
}

/* Cerrar */
.anali-toast-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 2;
    transition: color 0.2s, transform 0.2s;
}

.anali-toast-close:hover {
    color: #fff;
    transform: scale(1.2);
}

/* Barra de progreso */
.anali-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,215,0,0.6), rgba(255,255,255,0.5));
    border-radius: 0 0 16px 16px;
    animation: analiProgress 4.5s linear forwards;
    z-index: 1;
}

/* ===== ANIMACIONES ===== */

@keyframes analiToastIn {
    0% { opacity: 0; transform: translateX(120px) scale(0.7) rotate(3deg); }
    60% { transform: translateX(-8px) scale(1.02) rotate(-1deg); }
    100% { opacity: 1; transform: translateX(0) scale(1) rotate(0deg); }
}

@keyframes analiToastOut {
    0% { opacity: 1; transform: translateX(0) scale(1); }
    100% { opacity: 0; transform: translateX(120px) scale(0.7); }
}

@keyframes analiSparkle {
    0% { transform: scale(0) rotate(-90deg); opacity: 0; }
    50% { transform: scale(1.4) rotate(15deg); }
    70% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes analiProgress {
    0% { width: 100%; }
    100% { width: 0%; }
}

@keyframes analiGlow {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    50% { transform: translate(5%, 5%); opacity: 1; }
}

@keyframes analiShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes analiFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    10% { opacity: 0.8; }
    50% { transform: translate(8px, -15px) scale(1.2); opacity: 0.6; }
    90% { opacity: 0; }
}

@keyframes analiFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    10% { opacity: 0.7; }
    50% { transform: translate(-10px, -12px) scale(0.8); opacity: 0.5; }
    90% { opacity: 0; }
}

@keyframes analiFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
    15% { opacity: 0.9; }
    50% { transform: translate(5px, -18px) scale(1.3); opacity: 0.4; }
    85% { opacity: 0; }
}

/* Mobile */
@media (max-width: 768px) {
    .anali-toast {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
