/* Variables CSS */
:root
{
    /* Tamaños */
    --toast-max-width: 400px;
    /* Animaciones */
    --animation-toast: slideInNotification 0.3s ease-out;
}

/* Toast notification */
.toast-notification
{
    position: fixed;
    top: var(--spacing);
    right: var(--spacing);
    bottom: auto;
    left: auto;
    width: auto;
    height: auto;
    background: var(--color-white);
    padding: var(--spacing) var(--spacing);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--gap-xl);
    z-index: 9999;
    animation: var(--animation-toast);
    max-width: var(--toast-max-width);
}

/* Animación: slideInNotification */
@keyframes slideInNotification
{
    /* from */
    from
    {
        transform: translateX(100%);
        opacity: 0;
    }

    /* to */
    to
    {
        transform: translateX(0);
        opacity: 1;
    }

}

/* Show */
.toast-notification.show
{
    opacity: 1;
    transform: translateX(0);
}

/* Toast notification */
.toast-notification i
{
    flex-shrink: 0;
}

/* Toast notification */
.toast-notification span
{
    color: var(--color-text-dark);
    font-weight: 500;
}

/* Fa spin */
.toast-notification .fa-spin
{
    animation: var(--animation-spin);
}

/* Estilo del toast con botón de reintentar */
.toast-notification.toast-retry
{
    flex-wrap: wrap;
    max-width: 480px;
    gap: var(--gap-md);
}

/* Botón de reintentar dentro del toast de error */
.toast-retry-btn
{
    margin-left: auto;
    padding: 0.3rem 0.9rem;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Estado hover del botón de reintentar */
.toast-retry-btn:hover
{
    background-color: var(--color-primary-dark);
}

/* Tablet horizontal */
@media screen and (min-width: 48rem) and (max-width: 64rem) and (orientation: landscape)
{
    /* El toast permanece en la esquina superior derecha; reducimos el ancho máximo */
    .toast-notification
    {
        max-width: 360px;
    }

}

/* Tablet vertical */
@media screen and (min-width: 30rem) and (max-width: 48rem) and (orientation: portrait)
{
    /* En tablet vertical el toast ocupa todo el ancho superior */
    .toast-notification
    {
        left: var(--spacing);
        right: var(--spacing);
        max-width: none;
        width: auto;
    }

}

/* Móvil vertical */
@media screen and (max-width: 30rem) and (orientation: portrait)
{
    /* En móvil el toast se muestra en la parte inferior a ancho completo */
    .toast-notification
    {
        top: auto;
        bottom: calc(64px + var(--spacing-sm));
        left: var(--spacing-sm);
        right: var(--spacing-sm);
        max-width: none;
        width: auto;
        font-size: var(--font-size-sm);
    }

}
