/*
 * Diseño de los avisos (SweetAlert2 7.26) y de las ventanas sencillas.
 * Mismo estilo que includes/basket.php y includes/verificacion-telefono.php.
 * Se carga en newincludes/librerias.php e includes/header.php; al cambiarlo,
 * subir el número de ?v= en los dos.
 *
 * OJO: esta versión de SweetAlert usa "type" para el ícono. "icon" es de
 * versiones posteriores y aquí no muestra nada.
 */

/* ---------- Avisos (no aplica a los toast) ---------- */
/* SweetAlert agrega su hoja de estilos con JavaScript: por eso los selectores
   son más específicos que los suyos. */
.swal2-container .swal2-popup.swal2-modal {
    width: 420px;
    max-width: 100%;
    padding: 28px 28px 24px;
    border: 0;
    border-top: 6px solid #6899CD;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(0, 51, 102, .28);
    font-family: MARKPRO, "Segoe UI", Roboto, Arial, sans-serif;
    color: #003366;
}
.swal2-container .swal2-popup.swal2-modal .swal2-icon { margin: 4px auto 18px; }
.swal2-container .swal2-popup.swal2-modal .swal2-title {
    margin: 0 0 8px;
    padding: 0;
    font-family: inherit;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    color: #003366;
}
.swal2-container .swal2-popup.swal2-modal .swal2-content {
    padding: 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.45;
    color: #55565A;
    overflow-wrap: break-word;
}
.swal2-container .swal2-popup.swal2-modal .swal2-actions {
    flex-wrap: wrap;
    margin: 22px 0 0;
}
/* Mientras carga, SweetAlert convierte el botón en un círculo que gira. */
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) { gap: 10px; }
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) .swal2-styled {
    flex: 1 1 140px;
    min-height: 46px;
    margin: 0;
    padding: 10px 16px;
    border-radius: 23px;
    box-shadow: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3;
}
/* !important: cada aviso pone el color del botón en su atributo style. */
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) .swal2-styled.swal2-confirm {
    border: 2px solid #004F96 !important;
    background: #004F96 !important;
    color: #fff;
}
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) .swal2-styled.swal2-confirm:hover {
    border-color: #003366 !important;
    background: #003366 !important;
}
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) .swal2-styled.swal2-cancel {
    border: 1px solid #6899CD !important;
    background: #fff !important;
    color: #004F96;
}
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) .swal2-styled.swal2-cancel:hover {
    background: #E8F0F9 !important;
}
/* SweetAlert enfoca el botón al abrir: el contorno solo se ve con el teclado. */
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) .swal2-styled:focus { box-shadow: none; }
.swal2-container .swal2-popup.swal2-modal .swal2-actions:not(.swal2-loading) .swal2-styled:focus-visible {
    outline: 3px solid #6899CD;
    outline-offset: 2px;
}
@media (max-width: 480px) {
    .swal2-container .swal2-popup.swal2-modal { padding: 22px 20px 20px; }
}
@media (max-height: 480px) {
    .swal2-container .swal2-popup.swal2-modal { padding-top: 14px; padding-bottom: 14px; }
    .swal2-container .swal2-popup.swal2-modal .swal2-icon { display: none !important; }
    .swal2-container .swal2-popup.swal2-modal .swal2-actions { margin-top: 14px; }
}

/* ---------- Ventanas sencillas de Bootstrap: agregar la clase kf-ventana ---------- */
.modal.kf-ventana .modal-content {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-top: 6px solid #6899CD;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 48px rgba(0, 51, 102, .28);
    font-family: MARKPRO, "Segoe UI", Roboto, Arial, sans-serif;
    color: #003366;
}
.modal.kf-ventana .modal-header {
    align-items: center;
    padding: 14px 14px 6px 24px;
    border-bottom: 0;
}
.modal.kf-ventana .modal-title {
    font-family: inherit;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    color: #003366;
}
.modal.kf-ventana .modal-header .close {
    flex: none;
    width: 44px;
    height: 44px;
    margin: 0 0 0 auto;
    padding: 0;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;
    color: #55565A;
    text-shadow: none;
    opacity: 1;
}
.modal.kf-ventana .modal-header .close:hover { background: #F5F4F4; }
.modal.kf-ventana .modal-body {
    padding: 10px 24px;
    font-size: 15px;
    line-height: 1.5;
    color: #55565A;
    overflow-wrap: break-word;
}
.modal.kf-ventana .modal-body a { color: #004F96; text-decoration: underline; }
.modal.kf-ventana .modal-body .form-control {
    height: 46px;
    padding: 8px 14px;
    border: 1px solid #B9CDE3;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    color: #003366;
}
.modal.kf-ventana .modal-body .form-control:focus {
    border-color: #004F96;
    box-shadow: 0 0 0 4px rgba(104, 153, 205, .3);
}
.modal.kf-ventana .modal-footer {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 24px 22px;
    border-top: 0;
}
.modal.kf-ventana .modal-footer > * { margin: 0; }
.modal.kf-ventana .btn {
    min-height: 46px;
    padding: 10px 22px;
    border-radius: 23px;
    box-shadow: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.3;
}
.modal.kf-ventana .btn.btn-primary { border: 2px solid #004F96; background: #004F96; color: #fff; }
.modal.kf-ventana .btn.btn-primary:hover { border-color: #003366; background: #003366; }
.modal.kf-ventana .btn.btn-secondary { border: 1px solid #6899CD; background: #fff; color: #004F96; }
.modal.kf-ventana .btn.btn-secondary:hover { background: #E8F0F9; }
.modal.kf-ventana .btn:focus-visible,
.modal.kf-ventana .modal-header .close:focus-visible {
    outline: 3px solid #6899CD;
    outline-offset: 2px;
}
@media (max-width: 575px) {
    .modal.kf-ventana .modal-header { padding-left: 20px; }
    .modal.kf-ventana .modal-body { padding-left: 20px; padding-right: 20px; }
    .modal.kf-ventana .modal-footer { padding-left: 20px; padding-right: 20px; }
    .modal.kf-ventana .modal-footer .btn { flex: 1 1 130px; }
}
