/**
 * Animaciones para Productos con Descuento/Ofertas
 * Resalta visualmente los productos en oferta
 */

/* ========================================
   ANIMACIÓN DE BRILLO/PULSE PARA OFERTAS
   ======================================== */

/* Animación de pulso suave */
@keyframes pulse-offer {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}


/* Animación de brillo */
@keyframes shine {
    0% {
        background-position: -100%;
    }
    100% {
        background-position: 200%;
    }
}

/* Animación de glow (resplandor) */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.5),
                    0 0 10px rgba(220, 53, 69, 0.3),
                    0 0 15px rgba(220, 53, 69, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(220, 53, 69, 0.8),
                    0 0 20px rgba(220, 53, 69, 0.6),
                    0 0 30px rgba(220, 53, 69, 0.4);
    }
}

/* Animación de scale suave */
@keyframes scale-subtle {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* ========================================
   APLICACIÓN A PRODUCTOS CON DESCUENTO
   ======================================== */

/* Aplicar a productos con oferta flash */
.product-card-1:has(.count-down) {
    position: relative;
    animation: pulse-offer 2s infinite;
    transition: translateY 0.3s ease;
}

.product-card-1:has(.count-down):hover {
    animation: none;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Aplicar a productos con badge de descuento */
.product-card-1:has(.badge-ribbon) {
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo cada 5 segundos */
.product-card-1:has(.badge-ribbon)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
    animation-delay: 1s;
    z-index: 1;
    pointer-events: none;
}



/* Glow sutil en el borde */
.product-card-1:has(.badge-ribbon) {
    animation: glow 3s ease-in-out infinite;
}

/* ========================================
   BADGE DE DESCUENTO MEJORADO
   ======================================== */
.badge-ribbon {
    position: absolute;
    top: 10px;
    left: -5px;
    z-index: 10;
}

.badge-ribbon .badge {
    position: relative;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 15px;
    animation: scale-subtle 2s ease-in-out infinite;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Efecto de cinta */
.badge-ribbon .badge::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    border-top: 8px solid #b02a37;
    border-left: 8px solid transparent;
}

/* ========================================
   COUNTDOWN MEJORADO
   ======================================== */

/* Countdown principal del slider (count-down-01) */
.count-down-01 {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 10px 0;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    animation: pulse-offer 2s infinite;
    display: flex !important;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Countdown de productos individuales (count-down-02) */
.count-down-02 {
    /*background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);*/
    color: white;
    font-weight: 600;
    animation: pulse-offer 2s infinite;
    display: flex !important;
    gap: 5px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}



/* Cada bloque de tiempo (días, horas, minutos, segundos) */
.count-down .days,
.count-down .hours,
.count-down .minutes,
.count-down .seconds,
.count-down .years {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background-color: #c2141f;
    border-radius: 6px;
    padding: 8px 12px;
    min-width: 60px;
}

.count-down-02 .days,
.count-down-02 .hours,
.count-down-02 .minutes,
.count-down-02 .seconds {
    padding: 5px 8px;
    min-width: 50px;
}

/* Números del countdown - BLANCO para que se vea sobre fondo rojo */
.count-down .count {
    font-size: 24px;
    font-weight: 700;
    display: block;
    line-height: 1;
    color: #FFFFFF !important; /* Blanco sobre fondo rojo */
}

.count-down-02 .count {
    font-size: 18px;
}

/* Texto del countdown (Días, Horas, etc) - BLANCO también */
.count-down .title {
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-top: 4px;
    font-weight: 600;
    color: #FFFFFF !important; /* Blanco sobre fondo rojo */
    opacity: 0.9;
}

.count-down-02 .title {
    font-size: 9px;
    margin-top: 2px;
}

/* Separadores entre bloques */
.count-down .days::after,

.count-down .hours::after,

.count-down .minutes::after {

    content: ':';

    position: absolute;

    right: -10px;

    top: 50%;

    transform: translateY(-50%);

    font-size: 20px;

    font-weight: 700;

    color: rgba(255, 255, 255, 0.6);

}



.count-down-02 .days::after,

.count-down-02 .hours::after,

.count-down-02 .minutes::after {

    font-size: 16px;

    right: -6px;

}



/* Eliminar separador del último elemento */

.count-down .seconds::after,

.count-down .years:last-child::after {

    display: none;

}



/* Posición relativa para los separadores */

.count-down .days,

.count-down .hours,

.count-down .minutes,

.count-down .seconds,

.count-down .years {

    position: relative;

}



/* ========================================

   OVERLAY DE "OFERTA FLASH"

   ======================================== */



.product-card-1:has(.count-down) .product-card-image::after {

    content: '⚡ OFERTA FLASH';

    position: absolute;

    top: 0;

    right: 0;

    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);

    color: #000;

    padding: 5px 15px;

    font-size: 11px;

    font-weight: 700;

    border-bottom-left-radius: 8px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

    z-index: 5;

    animation: scale-subtle 1.5s ease-in-out infinite;

}



/* ========================================

   PRECIO CON DESCUENTO DESTACADO

   ======================================== */

.product-card-1:has(.badge-ribbon) .product-price span {
    color: #dc3545;
    font-weight: 700;
    font-size: 2em;
}



.product-card-1:has(.badge-ribbon) .product-price del {
    font-size: 1.4em;
    opacity: 0.8;
    margin-right: 7px;
}


/* ========================================
   RESPONSIVO
   ======================================== */

@media (max-width: 768px) {
    .badge-ribbon .badge {
        font-size: 12px;
        padding: 6px 12px;
    }
    .count-down {
        padding: 8px;
        font-size: 12px;
    }
    .count-down .countdown-amount {
        font-size: 16px;
    }
    .product-card-1:has(.count-down) .product-card-image::after {
        font-size: 10px;

        padding: 4px 10px;

    }

}



/* ========================================

   DESACTIVAR ANIMACIONES SI EL USUARIO LO PREFIERE

   ======================================== */



/* ========================================

   MENSAJE "TIEMPO AGOTADO"

   ======================================== */



.full-white {

    position: absolute;

    top: 0;

    left: 0;

    right: 0;

    bottom: 0;

    background: rgba(255, 255, 255, 0.95);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    z-index: 100;

    padding: 20px;

    text-align: center;

}



.full-white p {

    font-size: 18px;

    font-weight: 700;

    color: #dc3545;

    margin-bottom: 10px;

}



.full-white span {

    font-size: 14px;

    color: #666;

}



/* ========================================

   EFECTO HOVER MEJORADO PARA OFERTAS

   ======================================== */



.product-card-1:has(.badge-ribbon):hover {

    transform: translateY(-8px);

    box-shadow: 0 15px 40px rgba(220, 53, 69, 0.3) !important;

    transition: transform 0.3s ease;

}



.product-card-1:has(.badge-ribbon):hover .badge-ribbon .badge {

    transform: scale(1.1);

    transition: transform 0.3s ease;

}



/* ========================================

   INDICADOR VISUAL DE "QUEDAN POCAS UNIDADES"

   ======================================== */



.product-card-1.stock-bajo {

    border: 2px solid #ff9800;

}



.product-card-1.stock-bajo::before {

    content: '¡ÚLTIMAS UNIDADES!';

    position: absolute;

    bottom: 10px;

    left: 50%;

    transform: translateX(-50%);

    background: #ff9800;

    color: white;

    padding: 4px 12px;

    font-size: 11px;

    font-weight: 700;

    border-radius: 20px;

    z-index: 10;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

}

