/* Estilos Sweealert personalizados */
.swal2-popup {
    border-radius: 20px;
    background: var(--fondoswal);
    box-shadow: 0 0 1px var(--colorprimaryinvertido) !important;
    font-size: 1.25rem !important;
}

.swal2-close {
    color: var(--colortexto) !important;
}

.swal2-shown:not(.swal2-toast-shown) .swal2-container {
    background: rgba(10, 11, 15, 0.55) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: none !important;
}

.swal2-toast-shown .swal2-popup {
    font-size: 1.2em !important;
}

.swal2-toast-shown .swal2-container {
    background: transparent !important;
}

.swal2-title,
.swal2-content,
.swal2-html-container {
    color: var(--colortexto) !important;
    /* Texto blanco para mayor contraste */
}

/* Subtítulos/contenido del SweetAlert más legibles */
.swal2-content,
.swal2-html-container {
    font-size: 1.25em !important;
}

/* Los elementos internos heredan el tamaño del contenedor
   (evita que el reset global * { font-size: 16px } los achique) */
.swal2-content *,
.swal2-html-container * {
    font-size: inherit;
}

div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line] {
    background: transparent !important;
}

div:where(.swal2-icon).swal2-success .swal2-success-fix {
    background: transparent !important;
}

.swal2-select {
    color: var(--colortexto) !important;
}

.swal2-select option {
    color: #000 !important;
}

/* SweetAlert para aparecer por encima del modal de Quagga */
.swal2-popup-quagga {
    z-index: 999999 !important;
}

.swal2-popup-quagga.swal2-popup {
    z-index: 999999 !important;
}

.swal2-container.swal2-shown .swal2-popup-quagga {
    z-index: 999999 !important;
}

.swal2-container {
    z-index: 999999 !important;
}

.swal2-backdrop-show {
    z-index: 999998 !important;
}

/* Estilos personalizados para Toast */
.swal2-popup.swal2-toast {
    background: var(--fondoswal);
    border-radius: 15px;
    /* backdrop-filter eliminado - usando opacidad */
    /* Fallback para navegadores que no soportan backdrop-filter */
    background: var(--fondoswal);
    box-shadow: none !important;
}

.swal2-popup.swal2-toast .swal2-title {
    color: var(--colortexto) !important;
    font-size: 1.1em;
    font-weight: 600;
}

.swal2-popup.swal2-toast .swal2-content,
.swal2-popup.swal2-toast .swal2-html-container {
    color: var(--colortexto) !important;
    font-size: 0.95em !important;
}

.swal2-popup.swal2-toast .swal2-icon {
    border-color: var(--colortexto) !important;
}

.swal2-popup.swal2-toast .swal2-icon.swal2-success {
    border-color: #4ade80 !important;
}

.swal2-popup.swal2-toast .swal2-icon.swal2-error {
    border-color: #f87171 !important;
}

.swal2-popup.swal2-toast .swal2-icon.swal2-warning {
    border-color: #fbbf24 !important;
}

.swal2-popup.swal2-toast .swal2-icon.swal2-info {
    border-color: #60a5fa !important;
}

.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content {
    color: var(--colortexto) !important;
}

.swal2-popup.swal2-toast .swal2-success-ring {
    background: rgba(74, 222, 128, 0.3) !important;
}

.swal2-popup.swal2-toast .swal2-success-circular-line-left,
.swal2-popup.swal2-toast .swal2-success-circular-line-right {
    background: transparent !important;
}

.swal2-popup.swal2-toast .swal2-success-fix {
    background: transparent !important;
}

.swal2-popup.swal2-toast .swal2-progress-steps .swal2-progress-step {
    background: var(--fondoswal);
    color: var(--colortexto);
}

.swal2-popup.swal2-toast .swal2-progress-steps .swal2-progress-step-line {
    background: var(--colortexto);
}

.swal2-popup.swal2-toast .swal2-styled.swal2-confirm {
    background: rgba(255, 255, 255, 0.15);
    color: var(--colortexto);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

.swal2-popup.swal2-toast .swal2-styled.swal2-confirm:hover {
    background: rgba(255, 255, 255, 0.25);
}

.swal2-popup.swal2-toast .swal2-styled.swal2-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: var(--colortexto);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.swal2-popup.swal2-toast .swal2-styled.swal2-cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

.swal2-popup.swal2-toast .swal2-input,
.swal2-popup.swal2-toast .swal2-textarea,
.swal2-popup.swal2-toast .swal2-select {
    background: rgba(255, 255, 255, 0.1);
    color: var(--colortexto);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.swal2-popup.swal2-toast .swal2-input::placeholder,
.swal2-popup.swal2-toast .swal2-textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.swal2-popup.swal2-toast .swal2-validation-message {
    background: rgba(248, 113, 113, 0.9);
    color: white;
}

.swal2-popup.swal2-toast .swal2-footer {
    color: var(--colortexto);
    font-size: 0.85em;
}

/* Barra de tiempo/timer */
.swal2-timer-progress-bar {
    background: var(--colorprimaryinvertido) !important;
}