/* ================================
   Mantener alineación con nth-child(4)
   ================================ */

/* Asegura que la sección 4 sea un row responsive */
main > section:nth-child(4) {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0.5rem;
    margin-top: 15px;
}

/* Cada columna que contiene un banner */
main > section:nth-child(4) > div {
    flex: 0 1 45%;           /* Mantiene dos columnas con máximo 45% de ancho */
    max-width: 480px;        /* Limita el ancho máximo */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Mantener tu regla original (refuerzo) */
main > section:nth-child(4) img {
    max-width: 100%;
    width: 80%;              /* Reduce ligeramente el tamaño */
    height: auto;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
    object-fit: contain;
}

/* ================================
   Banner Oferta (capas con fondo)
   ================================ */
#banner-oferta {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
}

/* El fondo debe ser el elemento que da altura al contenedor */
#banner-oferta .promo-bg {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
}

/* Otras capas se superponen pero relativas al anchor */
#banner-oferta img.promo-chica,
#banner-oferta img.promo-bolsa,
#banner-oferta img.promo-reloj,
#banner-oferta img.promo-texto {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    transform-origin: center;
    z-index: 2;
    display: block;
    pointer-events: none;
}

/* Hover effects */
#banner-oferta:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 12px rgba(255,125,233,0.35);
}
#banner-oferta:hover .promo-chica { transform: translateY(-5px); filter: brightness(1.08); }
#banner-oferta:hover .promo-bolsa,
#banner-oferta:hover .promo-texto { 
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px #ffffff6f) drop-shadow(0 0 5px #fff);  
}
#banner-oferta:hover .promo-reloj { transform: scale(1.08); }

/* ================================
   Hot Sale (anuncio secundario)
   ================================ */
#banner-hotsale {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
#banner-hotsale img {
    display: block;
    width: 100%;
    height: auto;
}

/* ================================
   Estilos generales para desktop y tablets grandes
   ================================ */
main > section:nth-child(4) > div {
    display: flex;
    flex-wrap: wrap;
    gap: 2%;
}

main > section:nth-child(4) img {
    width: 100%;
    height: auto;
}

/* ================================
   Estilos para pantallas medianas (tabletas y móviles grandes)
   ================================ */
@media (max-width: 900px) {
    main > section:nth-child(4) > div {
        flex: 0 1 45%;
        max-width: 45%;
        margin: 0 auto;
    }

    main > section:nth-child(4) img {
        width: 80%;
    }

    main > section:nth-child(4) > div > .promo-btn {
        position: relative;
        top: 50px;
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ================================
   Estilos para pantallas pequeñas (móviles)
   ================================ */
@media (max-width: 600px) {
    main > section:nth-child(4) > div {
        flex: 0 1 45%;       /* Mantiene dos columnas en móviles */
        max-width: 45%;      
        margin: 0 auto;
    }

    main > section:nth-child(4) img {
        width: 100%;
    }

    main > section:nth-child(4) > div > .promo-btn {
        position: relative;
        top: 30px;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Ajuste de la posición y tamaño del botón */
main > section:nth-child(4) > div > .promo-btn {
    position: relative;
    top: 40px;
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
}

/* ================================
   Botón dentro del anuncio - Estilo Mejorado
   ================================ */
#banner-oferta .promo-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #ff007f, #ff66cc, #ff007f);
    color: #fff;
    font-weight: bold;
    padding: 0.7rem 1.6rem;
    border-radius: 25px;
    text-transform: uppercase;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 0 12px rgba(255, 0, 140, 0.6), 0 0 24px rgba(255, 150, 233, 0.4);
    animation: glowPulse 1.5s infinite alternate, bounceEffect 1.5s infinite alternate;
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 15px rgba(255, 0, 140, 0.6), 0 0 25px rgba(255, 150, 233, 0.4);
        transform: translateX(-50%) scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 0, 140, 0.8), 0 0 50px rgba(255, 150, 233, 0.6);
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        box-shadow: 0 0 15px rgba(255, 0, 140, 0.6), 0 0 25px rgba(255, 150, 233, 0.4);
        transform: translateX(-50%) scale(1);
    }
}

@keyframes bounceEffect {
    0% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
    100% {
        transform: translateX(-50%) scale(1);
    }
}

#banner-oferta .promo-btn:hover {
    background: linear-gradient(90deg, #ff33a8, #ff99e6, #ff33a8);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 0 25px rgba(255, 0, 140, 0.8), 0 0 40px rgba(255, 150, 233, 0.7);
}

/* ================================
   Responsive: Estilizado en móviles
   ================================ */
@media (max-width: 600px) {
    #banner-oferta .promo-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1.2rem;
        margin-top:-20px;
        position: relative;
    }
    #banner-oferta .banner-hotsale {
        display: none;
    }
}

/* ================================
   Efecto de Brillo Constante para la Bolsa
   ================================ */
#banner-oferta .promo-bolsa {
    animation: glowBolsa 1.5s infinite alternate;
}

@keyframes glowBolsa {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px #ff33a8) drop-shadow(0 0 30px #ff99e6);
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 20px #ff33a8) drop-shadow(0 0 40px #ff99e6);
    }
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px #ff33a8) drop-shadow(0 0 30px #ff99e6);
    }
}