/* ========================================
   Banner Popup - Estilos Frontend
   ======================================== */

/* Overlay */
#bannerpopup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
    animation: bannerpopup-fadeIn 0.3s ease;
}

/* Wrapper */
#bannerpopup-wrapper {
    position: fixed;
    z-index: 99999;
}

/* Posiciones */
#bannerpopup-wrapper.bannerpopup-pos-center {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#bannerpopup-wrapper.bannerpopup-pos-bottom-right {
    bottom: 20px;
    right: 20px;
}

#bannerpopup-wrapper.bannerpopup-pos-bottom-left {
    bottom: 20px;
    left: 20px;
}

#bannerpopup-wrapper.bannerpopup-pos-top-bar {
    top: 0;
    left: 0;
    width: 100%;
}

/* Container */
#bannerpopup-container {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 700px;
    max-height: 90vh;
    animation: bannerpopup-slideIn 0.4s ease;
}

.bannerpopup-pos-top-bar #bannerpopup-container {
    max-width: 100%;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.bannerpopup-pos-bottom-right #bannerpopup-container,
.bannerpopup-pos-bottom-left #bannerpopup-container {
    max-width: 400px;
}

/* Boton cerrar */
#bannerpopup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    padding: 0;
}

#bannerpopup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Slider */
#bannerpopup-slider {
    position: relative;
    overflow: hidden;
}

.bannerpopup-slide {
    display: none;
    width: 100%;
}

.bannerpopup-slide.active {
    display: block;
    animation: bannerpopup-fadeIn 0.4s ease;
}

.bannerpopup-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

/* Navegacion */
#bannerpopup-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    gap: 12px;
    background: #fff;
}

#bannerpopup-prev,
#bannerpopup-next {
    border: none;
    background: none;
    font-size: 18px;
    color: #555;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s ease;
}

#bannerpopup-prev:hover,
#bannerpopup-next:hover {
    color: #000;
}

/* Dots */
#bannerpopup-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bannerpopup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bannerpopup-dot.active {
    background: #333;
}

/* Animaciones */
@keyframes bannerpopup-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bannerpopup-slideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes bannerpopup-fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Clase para cierre animado */
#bannerpopup-wrapper.bannerpopup-closing #bannerpopup-container {
    animation: bannerpopup-fadeOut 0.3s ease forwards;
}

#bannerpopup-wrapper.bannerpopup-closing #bannerpopup-overlay {
    animation: bannerpopup-fadeOut 0.3s ease forwards;
}

/* Responsive */
@media (max-width: 768px) {
    #bannerpopup-wrapper.bannerpopup-pos-center {
        padding: 15px;
    }

    #bannerpopup-container {
        max-width: 100%;
    }

    .bannerpopup-pos-bottom-right #bannerpopup-container,
    .bannerpopup-pos-bottom-left #bannerpopup-container {
        max-width: 320px;
    }

    #bannerpopup-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        line-height: 28px;
    }

    .bannerpopup-pos-bottom-right,
    .bannerpopup-pos-bottom-left {
        bottom: 10px;
    }

    .bannerpopup-pos-bottom-right {
        right: 10px;
    }

    .bannerpopup-pos-bottom-left {
        left: 10px;
    }
}

@media (max-width: 480px) {
    .bannerpopup-pos-bottom-right #bannerpopup-container,
    .bannerpopup-pos-bottom-left #bannerpopup-container {
        max-width: 280px;
    }
}
