/*
* Estilos para la Barra de Aviso Dinámica (Frontend)
* Version 7.5
*/

/* ------------------------------------------- */
/* Estilos Base de la Barra y Contenedores */
/* ------------------------------------------- */
.bad-top-bar {
    width: 100%;
    position: fixed;
    z-index: 99999;
    padding: var(--bad-padding-v) 15px; /* Uso de la variable CSS */
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--bad-font-size);
    font-family: var(--bad-font-family);
    line-height: 1.2;
    transform: translateY(-100%); /* Estado inicial fuera de la vista (top) */
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out, visibility 0s 0.5s;
    text-align: center;
}

/* Modificación para posicionamiento inferior */
.bad-top-bar.bad-bar-bottom {
    transform: translateY(100%); /* Estado inicial fuera de la vista (bottom) */
}


/* Estado Visible */
.bad-top-bar.bad-visible {
    transform: translateY(0%);
    opacity: 1;
    visibility: visible;
    transition: transform var(--bad-tiempo-salir) ease-out, opacity var(--bad-tiempo-salir) ease-out, visibility 0s 0s;
}

/* Contenido Principal */
.bad-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* Ancho máximo para el contenido */
    gap: 15px; 
    flex-wrap: wrap; /* Para asegurar responsive en móvil */
}

/* Estilo del Mensaje */
.bad-mensaje {
    flex-grow: 1;
    text-align: center;
    display: inline-block; 
    transform: translateZ(0); /* Forzar aceleración hardware */
}

/* ------------------------------------------- */
/* Efectos de Mensaje (Animaciones) */
/* ------------------------------------------- */

/* Efecto Ninguno */
.bad-mensaje.bad-efecto-none {
    /* No hay animación, se mantiene estático */
}

/* Efecto Zoom Suave (RECOMENDADO) */
.bad-mensaje.bad-efecto-zoom-in-out {
    animation: bad-zoom-animation var(--bad-velocidad-efecto) infinite alternate;
    white-space: nowrap; 
}

@keyframes bad-zoom-animation {
    0% {
        opacity: 0.85;
        transform: scale(0.99); /* Ligeramente más pequeño */
    }
    100% {
        opacity: 1;
        transform: scale(1.01); /* Ligeramente más grande */
    }
}

/* Efecto Blinking (Intermitencia) */
.bad-mensaje.bad-efecto-blinking {
    animation: bad-blinking-animation var(--bad-velocidad-efecto) steps(1, end) infinite;
}

@keyframes bad-blinking-animation {
    0% { opacity: 1; }
    50% { opacity: 0.2; }
    100% { opacity: 1; }
}


/* ------------------------------------------- */
/* Estilos de Botones */
/* ------------------------------------------- */
.bad-action-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    z-index: 10; /* Asegura que los botones estén sobre el texto animado */
}

.bad-button {
    text-decoration: none;
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: calc(var(--bad-font-size) * 0.9);
    line-height: 1;
    transition: background-color 0.3s, opacity 0.3s;
    border: none;
    white-space: nowrap;
}

.bad-button:hover {
    opacity: 0.85;
}

/* Estilo Botón Registro */
.bad-button-reg {
    background-color: var(--bad-btn-reg-bg);
    color: var(--bad-btn-reg-color);
}

/* Estilo Botón Cupón */
.bad-button-coupon {
    background-color: var(--bad-btn-cup-bg);
    color: var(--bad-btn-cup-color);
}

/* Botón Cerrar */
.bad-cerrar-btn {
    background: transparent;
    border: none;
    color: inherit;
    font-size: calc(var(--bad-font-size) * 1.5);
    line-height: 1;
    padding: 0 5px;
    cursor: pointer;
    position: absolute;
    right: 15px;
    opacity: 0.8;
    transition: opacity 0.2s;
    z-index: 15; /* Siempre visible y clicable */
}

.bad-cerrar-btn:hover {
    opacity: 1;
}

/* ------------------------------------------- */
/* Estilos Específicos (Responsive/Modo) */
/* ------------------------------------------- */

/* Modo flotante: No empuja el body */
.bad-top-bar.bad-modo-flotante {
    position: fixed;
}

/* Modo Fijo: El body padding lo maneja PHP/JS dinámicamente */

/* Dispositivos - Movil / Tablet */
@media (max-width: 768px) {
    .bad-top-bar {
        text-align: left;
        padding-left: 10px;
        padding-right: 35px; /* Más espacio para la X */
    }
    
    .bad-content-wrapper {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .bad-action-buttons {
        gap: 8px;
        margin-left: 0;
        width: 100%;
    }
    
    .bad-mensaje {
        text-align: left;
    }
    
    .bad-button {
        flex-grow: 1;
        text-align: center;
    }
    
    .bad-cerrar-btn {
        right: 5px;
    }
    
    /* Responsive Display Logic */
    .bad-top-bar.bad-disp-escritorio {
        display: none !important;
    }
}

/* Dispositivos - Escritorio */
@media (min-width: 769px) {
    .bad-top-bar.bad-disp-movil {
        display: none !important;
    }
}


/* ------------------------------------------- */
/* Contador Regresivo */
/* ------------------------------------------- */
.bad-contador-display {
    font-weight: bold;
    margin-left: 10px;
}