/* Interfaz 1.0.0 - Miniaturas de adjuntos */

/* Interfaz - Miniaturas estilo SupportPal 5.7.8 */

ul.sp-attachments > li.sp-image-attachment {
    position: relative;
    display: inline-block;
    width: 256px;
    max-width: 256px;
    height: 141px;
    overflow: visible;
    flex: 0 0 256px;
}

ul.sp-attachments > li.sp-image-attachment > a {
    display: block;
    width: 256px;
    height: 141px;
    padding: 8px 16px;
    box-sizing: border-box;
    overflow: hidden;
}

ul.sp-attachments > li.sp-image-attachment .sp-attachment-icon {
    display: block;
    width: calc(100% + 32px);
    height: 80px;
    margin-left: -16px;
    padding: 0;
    overflow: hidden;
    line-height: normal;
}

ul.sp-attachments > li.sp-image-attachment .sp-attachment-icon img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: initial !important;
}

ul.sp-attachments > li.sp-image-attachment .sp-attachment-name {
    display: block;
    width: 224px;
    height: 24px;
    margin-top: 4px;
    padding: 0;
    text-align: left;
    font-size: 12px;
    line-height: 24px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

ul.sp-attachments > li.sp-image-attachment .sp-attachment-size {
    display: block;
    width: 224px;
    padding: 0;
    text-align: left;
    font-size: 11px;
    line-height: 16px;
}

ul.sp-attachments > li.sp-image-attachment .sp-delete-attachment {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    border-radius: 0 4px 0 4px;
}
/* ============================================
   Interfaz - Ajustes de adjuntos
   ============================================ */

/* Imagen pegada al borde superior */
ul.sp-attachments > li.sp-image-attachment > a {
    padding-top: 0;
}

/* Ocultar tamaño de las imágenes */
ul.sp-attachments > li.sp-image-attachment .sp-attachment-size {
    display: none;
}


/* Tarjeta de imagen: aprovechar espacio del tamaño oculto */

/* Eliminar espacios internos del enlace */
ul.sp-attachments > li.sp-image-attachment > a {
    height: 141px;
    padding-top: 0;
    padding-bottom: 0;
}

/* Aumentar el área visible de la fotografía */
ul.sp-attachments > li.sp-image-attachment .sp-attachment-icon {
    height: 113px;
    flex: 0 0 113px;
}

/* Franja compacta para el nombre */
ul.sp-attachments > li.sp-image-attachment .sp-attachment-name {
    height: 28px;
    margin-top: 0;
    padding-top: 0;
    line-height: 28px;
}

/* Mantener oculto el tamaño */
ul.sp-attachments > li.sp-image-attachment .sp-attachment-size {
    display: none;
}
/* Botón eliminar compacto en miniaturas */
ul.sp-attachments > li.sp-image-attachment .sp-delete-attachment {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;

    width: 22px;
    height: 22px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    line-height: 1;

    border-radius: 0 4px 0 4px;
}
/* ==========================================
   Interfaz - Encabezado de archivos adjuntos
   ========================================== */

.sp-interfaz-attachments {
    position: relative;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.sp-interfaz-attachments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
}

.sp-interfaz-attachments-title {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

/* Mantener el botón original, pero pequeño y a la derecha */
.sp-interfaz-attachments ul.sp-attachments > li:has(.sp-download-all) {
    position: absolute;
    top: 10px;
    right: 0;
    max-width: none;
    overflow: visible;
}

.sp-interfaz-attachments .sp-download-all {
    padding: 2px 5px;
    border: 0;
    background: transparent;
    font-size: 14px;
}

/* Ocultar el texto y conservar únicamente el icono */
.sp-interfaz-attachments .sp-download-all span {
    display: none !important;
}

.sp-interfaz-attachments .sp-download-all:hover {
    background: transparent;
    opacity: 0.75;
}

/* Separación entre encabezado y miniaturas */
.sp-interfaz-attachments ul.sp-attachments {
    padding-top: 12px;
}
/* ==========================================
   Interfaz - Centrado vertical de miniaturas
   SupportPal 6.1.2
   ========================================== */

ul.sp-attachments > li.sp-image-attachment .sp-attachment-icon {
    position: relative;
    overflow: hidden;
}

ul.sp-attachments > li.sp-image-attachment .sp-attachment-icon > img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
/* =====================================================
   INTERFAZ CLIENTE
   Ocultar control de eliminación de adjuntos
   ===================================================== */

ul.sp-attachments .sp-delete-attachment {
    display: none !important;
}
/* =====================================================
   INTERFAZ CLIENTE - CUSTOM FIELDS
   Mejorar visibilidad de campos bloqueados
   Sin modificar su estado disabled
   ===================================================== */

form.sp-custom-fields .sp-form-customfields input:disabled,
form.sp-custom-fields .sp-form-customfields textarea:disabled,
form.sp-custom-fields .sp-form-customfields select:disabled {
    opacity: 1 !important;
    color: #212529 !important;
    -webkit-text-fill-color: #212529 !important;
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
}

/* Mantener legibles los textos de las opciones */
form.sp-custom-fields .sp-form-customfields input:disabled + span {
    opacity: 1 !important;
}


