/* =====================================================================
   UX GLOBAL (parche 21): confirmaciones (swal) y avisos (toastr) modernos.
   Se carga en todas las páginas desde layouts/partials/css.blade.php
   ===================================================================== */

/* ---- No crear productos desde la pantalla de venta (POS y Agregar venta) ---- */
.pos_add_quick_product { display: none !important; }

/* ---- Ventanas de confirmación ("¿Estás seguro?") ---- */
.swal-overlay { background-color: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.swal-overlay--show-modal .swal-modal { animation: uxSwalIn .22s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes uxSwalIn { from { transform: scale(.92) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
body .swal-overlay .swal-modal { width: 420px; max-width: calc(100% - 32px); border-radius: 22px; padding: 26px 22px 18px; box-shadow: 0 30px 70px rgba(15, 23, 42, .35);
    font-family: inherit; }
body .swal-overlay .swal-icon { margin: 4px auto 14px; transform: scale(.85); }
body .swal-overlay .swal-icon--warning { border-color: #fbbf24; background: #fffbeb; }
body .swal-overlay .swal-icon--warning__body, body .swal-overlay .swal-icon--warning__dot { background-color: #f59e0b; }
body .swal-overlay .swal-icon--error { border-color: #f87171; background: #fef2f2; }
body .swal-overlay .swal-icon--success { border-color: #34d399; }
body .swal-overlay .swal-icon--success__line { background-color: #10b981; }
body .swal-overlay .swal-icon--success__ring { border-color: rgba(16, 185, 129, .25); }
body .swal-overlay .swal-icon--info { border-color: #60a5fa; background: #eff6ff; }
body .swal-overlay .swal-icon--info::after, body .swal-overlay .swal-icon--info::before { background-color: #3b82f6; }
body .swal-overlay .swal-title { font-size: 22px; font-weight: 800; color: #0f172a; padding: 0 6px; margin: 0 0 6px !important; line-height: 1.25; }
body .swal-overlay .swal-text { font-size: 14.5px; color: #475569; text-align: center; line-height: 1.5; padding: 0 10px; margin: 0 auto; max-width: 340px; display: block; }
body .swal-overlay .swal-title:not(:last-child) { margin-bottom: 6px !important; }
body .swal-overlay .swal-content { margin-top: 12px; padding: 0 6px; }
body .swal-overlay .swal-content__input, body .swal-overlay .swal-content__textarea { border-radius: 12px; border: 1.5px solid #e2e8f0; padding: 10px 12px; font-size: 15px; }
body .swal-overlay .swal-content__input:focus, body .swal-overlay .swal-content__textarea:focus { border-color: var(--theme-500, #6366f1); box-shadow: 0 0 0 4px rgba(99, 102, 241, .14); outline: none; }
body .swal-overlay .swal-footer { display: flex; gap: 10px; justify-content: center; margin-top: 18px; padding: 0; text-align: center; }
body .swal-overlay .swal-button-container { margin: 0; flex: 1 1 0; max-width: 190px; }
body .swal-overlay .swal-button { width: 100%; height: 46px; border-radius: 12px; font-size: 15px; font-weight: 700; padding: 0 12px; letter-spacing: 0; white-space: nowrap;
    background-color: var(--theme-700, #4f46e5); box-shadow: none !important; transition: filter .15s, transform .15s; }
body .swal-overlay .swal-button:hover { filter: brightness(1.06); transform: translateY(-1px); }
body .swal-overlay .swal-button:not([disabled]):hover { background-color: var(--theme-700, #4f46e5); }
body .swal-overlay .swal-button--cancel { background: #fff !important; color: #334155 !important; border: 1.5px solid #e2e8f0 !important; }
body .swal-overlay .swal-button--cancel:hover { background: #f8fafc !important; }
body .swal-overlay .swal-button--danger, body .swal-overlay .swal-button--danger:not([disabled]):hover { background-color: #dc2626 !important; }
body .swal-overlay .swal-button--confirm:not(.swal-button--danger) { background-color: var(--theme-700, #4f46e5); }
body .swal-overlay .swal-button:focus { box-shadow: 0 0 0 4px rgba(99, 102, 241, .22) !important; }
body .swal-overlay .swal-button--danger:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .22) !important; }
@media (max-width: 480px) {
    body .swal-overlay .swal-modal { border-radius: 20px 20px 0 0; position: fixed; left: 0; right: 0; bottom: 0; max-width: 100%; width: 100%; margin: 0; }
    body .swal-overlay .swal-button-container { max-width: none; }
}

/* ---- Avisos (toastr): tarjeta blanca con barra de color e icono ---- */
#toast-container { z-index: 99999; }
#toast-container.toast-top-right { top: 14px; right: 14px; }
#toast-container > .toast, #toast-container > div {
    width: 340px; max-width: calc(100vw - 28px); opacity: 1 !important; background-image: none !important; background-color: #fff !important; color: #0f172a !important;
    border-radius: 14px; padding: 14px 40px 14px 58px !important; box-shadow: 0 14px 34px rgba(15, 23, 42, .18) !important; border: 1px solid #e5e7eb;
    border-left: 5px solid #64748b; position: relative; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 10px;
    animation: uxToastIn .28s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes uxToastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
#toast-container > div:hover { box-shadow: 0 18px 40px rgba(15, 23, 42, .22) !important; }
#toast-container > div::before {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-family: "Font Awesome 5 Free", "FontAwesome"; font-weight: 900; font-size: 15px; color: #fff;
}
#toast-container > .toast-success { border-left-color: #10b981; }
#toast-container > .toast-success::before { content: "\f00c"; background: #10b981; }
#toast-container > .toast-error { border-left-color: #ef4444; }
#toast-container > .toast-error::before { content: "\f00d"; background: #ef4444; }
#toast-container > .toast-warning { border-left-color: #f59e0b; }
#toast-container > .toast-warning::before { content: "\f071"; background: #f59e0b; font-size: 13px; }
#toast-container > .toast-info { border-left-color: #3b82f6; }
#toast-container > .toast-info::before { content: "\f129"; background: #3b82f6; }
#toast-container .toast-title { font-weight: 800; margin-bottom: 2px; }
#toast-container .toast-message { color: #1e293b; }
#toast-container .toast-message a { color: inherit; text-decoration: underline; }
#toast-container .toast-close-button { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #94a3b8; opacity: 1; text-shadow: none;
    font-size: 20px; font-weight: 400; }
#toast-container .toast-close-button:hover { color: #0f172a; }
#toast-container .toast-progress { height: 3px; opacity: .9; bottom: 0; }
#toast-container .toast-success .toast-progress { background-color: #10b981; }
#toast-container .toast-error .toast-progress { background-color: #ef4444; }
#toast-container .toast-warning .toast-progress { background-color: #f59e0b; }
#toast-container .toast-info .toast-progress { background-color: #3b82f6; }
@media (max-width: 480px) {
    #toast-container.toast-top-right { left: 10px; right: 10px; top: 10px; }
    #toast-container > div { width: 100%; max-width: 100%; }
}

/* ===== Barras de guardar (parche 25) =====
   Antes quedaban fijas abajo y tapaban lo que estaba detrás. Ahora van al final de la página
   y, mientras no se ven, aparece un botón flotante pequeño en la esquina. */
body .bs-bar, body .mp-bar, body .fm-bar, body .cm-bar { position: relative !important; bottom: auto !important; backdrop-filter: none !important;
    box-shadow: none !important; background: #fff !important; border-radius: 16px !important; border: 1px solid #e5e7eb !important; }
.ux-fab { position: fixed; right: 22px; bottom: 22px; z-index: 1030; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 22px;
    border: 0; border-radius: 999px; color: #fff; font-size: 15px; font-weight: 800; cursor: pointer;
    background: linear-gradient(100deg, var(--theme-800, #3730a3), var(--theme-600, #4f46e5));
    box-shadow: 0 10px 28px rgba(15, 23, 42, .28); opacity: 0; transform: translateY(16px) scale(.96); pointer-events: none;
    transition: opacity .18s ease, transform .18s ease; }
.ux-fab.ux-fab-on { opacity: 1; transform: none; pointer-events: auto; }
.ux-fab:hover { filter: brightness(1.08); }
.ux-fab i { font-size: 15px; }
body.modal-open .ux-fab { display: none; }
/* celular: solo un círculo con el chulo, para tapar lo mínimo */
@media (max-width: 600px) { .ux-fab { right: 14px; bottom: 16px; width: 54px; height: 54px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
    .ux-fab i { font-size: 21px; } }
@media print { .ux-fab { display: none !important; } }
