/* ============================================================
   SAPXIA QPM - ESTILOS MODULARES (VERSIÓN 2.8)
   Optimizado para Divi y Arquitectura de Doble Shortcode
   ============================================================ */

/* 1. ESTILOS DE COMPONENTE: FORMULARIO [sapxia_qpm] */
.sqpm-container {
    width: 100%;
    max-width: 500px; /* Un poco más ancho para mejor legibilidad */
    margin: 0 auto !important; 
    padding: 20px; 
    background: #ffffff; 
    border-radius: 24px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.07);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box; 
    text-align: left; 
}

.sqpm-container h2 { 
    font-size: 26px; 
    font-weight: 700; 
    color: #1d1d1f; 
    margin: 0 0 20px 0; 
    text-align: center !important; 
}

/* 2. ESTILOS DE COMPONENTE: LISTA RECIENTES [sapxia_qpm_recent] */
.sqpm-recent-column {
    width: 100%;
    background: #ffffff; 
    padding: 20px; 
    border-radius: 24px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.07);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.sqpm-recent-title { 
    font-size: 26px; 
    font-weight: 700; 
    margin: 0 0 20px 0; 
    text-align: center; 
    color: #1d1d1f;
}

/* 3. CAMPOS DE ENTRADA (Inputs) */
.sqpm-group { 
    margin-bottom: 10px; 
    width: 100% !important; 
}

.sqpm-group label { 
    display: block; 
    font-size: 11px; 
    font-weight: 700; 
    color: #86868b; 
    margin-bottom: 4px; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.sqpm-input, .sqpm-select, .sqpm-textarea {
    display: block !important; 
    width: 100% !important; 
    padding: 10px 10px !important; 
    border: 1px solid #d2d2d7 !important;
    border-radius: 12px !important; 
    font-size: 16px !important; 
    background: #f5f5f7 !important; 
    height: 40px; 
    outline: none; 
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.sqpm-input:focus, .sqpm-select:focus, .sqpm-textarea:focus {
    border-color: #0071e3 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(0,113,227,0.1);
}

.sqpm-textarea { 
    height: auto !important; 
    min-height: 100px !important; 
}

/* 4. BOTONES Y ACCIONES (80/20 Layout) */
.sqpm-actions { 
    display: flex; 
    gap: 10px; 
    margin-top: 20px; 
}

.sqpm-btn-main { 
    flex: 1; 
    color: white !important; 
    border: none; 
    border-radius: 14px; 
    font-size: 16px; 
    font-weight: 600; 
    cursor: pointer; 
    padding: 16px; 
    transition: transform 0.2s, opacity 0.2s; 
}

.sqpm-btn-main:active { transform: scale(0.98); }

.sqpm-btn-delete { 
    flex: 0 0 60px; 
    background: #f53c3c !important; 
    color: white !important; 
    border: none; 
    border-radius: 14px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
    transition: 0.2s; 
}

.sqpm-btn-main:disabled, .sqpm-btn-delete:disabled { 
    background-color: #d2d2d7 !important; 
    color: #86868b !important; 
    cursor: not-allowed; 
}

/* 5. LISTA DE ITEMS (Recientes) */
.sqpm-list-item { 
    display: flex; 
    align-items: center; 
    background: #f5f5f7; 
    border-radius: 16px; 
    padding: 12px; 
    margin-bottom: 12px; 
    transition: background 0.2s;
}

.sqpm-list-item:hover { background: #ebebef; }

.sqpm-list-img { 
    width: 54px; 
    height: 54px; 
    border-radius: 10px; 
    object-fit: cover; 
    margin-right: 15px; 
    border: 1px solid #d2d2d7;
}

.sqpm-list-info { flex-grow: 1; }

.sqpm-edit-link { 
    background: #ffffff; 
    font-size: 13px; 
    font-weight: 600; 
    padding: 8px 16px; 
    border-radius: 20px; 
    border: 1px solid #d2d2d7; 
    text-decoration: none; 
    color: #1d1d1f !important;
    transition: all 0.2s;
}

.sqpm-edit-link:hover { background: #f5f5f7; border-color: #86868b; }

/* 6. MOTOR DE IMAGEN (Previews) */
.sqpm-image-row { display: flex; align-items: flex-start; gap: 12px; }
.sqpm-upload-square { 
    width: 80px; height: 80px; background: #f5f5f7; border: 2px dashed #d2d2d7; 
    border-radius: 16px; display: flex; flex-direction: column; align-items: center; 
    justify-content: center; cursor: pointer; transition: 0.2s;
}
.sqpm-upload-square:hover { border-color: #0071e3; background: #f0f7ff; }
.sqpm-img-thumb { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; border: 1px solid #d2d2d7; }

/* 7. ESTADOS Y UTILIDADES */
#sqpm-success-screen { display: none; text-align: center; padding: 40px 10px; animation: sqpmPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes sqpmPop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
.sqpm-required { color: #ff3b30; margin-left: 2px; }
.sqpm-cancel-link { display: inline-block; margin-top: 15px; color: #86868b; font-size: 13px; text-decoration: none; }
.sqpm-cancel-link:hover { text-decoration: underline; }