/* ========================================= */
/* ANIMACIONES */
/* ========================================= */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: 0.35s ease;
}

.fade-in.on {
    opacity: 1;
    transform: none;
}

.fade-out {
    opacity: 0;
    transform: translateY(20px);
    transition: 0.35s ease;
    pointer-events: none;
}

/* ========================================= */
/* CONTENEDOR ALERTA */
/* ========================================= */

.content-alerta {
    position: fixed;
    display: grid;
    place-items: center;

    padding: 8px 8px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);

    z-index: 1061;
    backdrop-filter: blur(2px);

    max-width: 90vw;
    width: var(--width, 350px);
}

/* ========================================= */
/* TIPOS */
/* ========================================= */

.toast {
    position: fixed;
    bottom: 16px;
    right: 16px;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
}

.modal.on {
    transform: translate(-50%, -50%) scale(1);
    transition: 0.3s ease;
}

/* ========================================= */
/* OVERLAY */
/* ========================================= */

.alert-layer {
    position: fixed;
    inset: 0;
    z-index: 1060;

    display: grid;
    height: 100%;
    padding: 10px;

    background: rgba(0, 0, 0, 0.4);

    grid-template-areas:
        "top-start top top-end"
        "center-start center center-end"
        "bottom-start bottom-center bottom-end";

    grid-template-rows:
        minmax(min-content, auto)
        minmax(min-content, auto)
        minmax(min-content, auto);

    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;

    opacity: 0;
    transition: opacity 0.2s ease;
}

.alert-layer.on {
    opacity: 1;
}

/* ========================================= */
/* BOTÓN CERRAR */
/* ========================================= */

.cerrar-alerta {
    position: absolute;
    top: 6px;
    right: 4px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ========================================= */
/* TEXTO */
/* ========================================= */

.mensaje {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    padding: 18px 10px 6px 0;
}

/* 🔥 CONTROL DEL EMOJI */
.emoji-alerta {
    font-size: 26px;
    vertical-align: middle;
    margin-right: 4px;

    display: inline-block;
    animation: emojiBounce 2.2s ease-in-out infinite;
}

@keyframes emojiBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.1);
    }
}

/* ========================================= */
/* BARRA PROGRESO */
/* ========================================= */

.barra-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;

    width: 100%;
    height: 4px;

    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;

    border-radius: 0 0 8px 8px;
}

.barra {
    height: 100%;
    width: 100%;

    transform-origin: right;
    animation: barraProgreso var(--duracion, 6s) linear forwards;
}

@keyframes barraProgreso {
    to {
        transform: scaleX(0);
    }
}

/* ========================================= */
/* LOADING */
/* ========================================= */

.content-cargando {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6.4px; /* 0.4rem → px */
}

.content-cargando .title {
    font-size: 20px;
    color: #333;
}

.content-cargando .text {
    font-size: 17px;
    color: #666;
}

@media (max-width: 900px) {
    .cerrar-alerta {
        font-size: 13px;
    }
    .mensaje {
        font-size: 13.5px;
    }

}

@media (max-width: 600px) {
    .cerrar-alerta {
        font-size: 12px;
    }
    .mensaje {
        font-size: 12.5px;
    }
}