/* =============================
   CREACIÓN DE MODELOS v3 - SOLUCIÓN CORRECTA
   Sin padding lateral (lo gestiona el padre .configurador-main)
   ============================= */

/* CONTENEDOR PRINCIPAL - SIN PADDING LATERAL */
#configuradorMaestro {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 8px 0 !important;
  box-sizing: border-box !important;
}

/* GRID DE BLOQUES */
#configuradorMaestro .contenedor-bloques {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  gap: 15px !important;
  padding: 0 !important;
  width: 100% !important;
}

/* BLOQUES - ALTURA FIJA 250PX */
#configuradorMaestro .bloque-config {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  background: #f9f9f9;
  height: 250px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
}

#configuradorMaestro .bloque-config:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* TÍTULOS */
#configuradorMaestro .bloque-config h3 {
  margin: 0 0 10px 0;
  padding-bottom: 4px;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid #0073aa;
  flex-shrink: 0;
}

/* BOTONES DE CONTROL */
#configuradorMaestro .controles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  flex-shrink: 0;
}

#configuradorMaestro .btn-agregar,
#configuradorMaestro .btn-exportar,
#configuradorMaestro .btn-importar {
  background: #0073aa;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

#configuradorMaestro .btn-agregar:hover,
#configuradorMaestro .btn-exportar:hover,
#configuradorMaestro .btn-importar:hover {
  background: #005a87;
}

#configuradorMaestro .btn-agregar:focus,
#configuradorMaestro .btn-exportar:focus,
#configuradorMaestro .btn-importar:focus {
  outline: none;
}

/* LISTA CON SCROLL */
#configuradorMaestro .lista-items {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  max-height: 105px !important;
  scrollbar-width: thin;
  scrollbar-color: #0073aa transparent;
  min-height: 0;
}

#configuradorMaestro .lista-items::-webkit-scrollbar {
  width: 6px;
}

#configuradorMaestro .lista-items::-webkit-scrollbar-track {
  background: transparent;
}

#configuradorMaestro .lista-items::-webkit-scrollbar-thumb {
  background: #0073aa;
  border-radius: 3px;
}

#configuradorMaestro .lista-items::-webkit-scrollbar-thumb:hover {
  background: #005a87;
}

/* ITEMS */
#configuradorMaestro .item-config {
  background: white;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 6px 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  position: relative;
}

#configuradorMaestro .item-config:hover {
  background: #f0f8ff;
  border-color: #0073aa;
  transform: translateX(2px);
}

#configuradorMaestro .item-config.seleccionado {
  background: #e3f2fd;
  border-color: #1976d2;
  box-shadow: 0 0 3px rgba(25, 118, 210, 0.3);
}

/* CONTENIDO ITEMS */
#configuradorMaestro .item-nombre {
  font-weight: bold;
  color: #333;
  font-size: 12px;
  margin: 0 0 2px 0;
  padding-right: 60px;
}

#configuradorMaestro .item-info {
  font-size: 10px;
  color: #666;
  margin: 0;
}

/* BOTONES DE ACCIÓN */
#configuradorMaestro .item-acciones {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
  opacity: 0.8;
}

#configuradorMaestro .item-config:hover .item-acciones {
  opacity: 1;
}

#configuradorMaestro .btn-accion {
  background: #666;
  color: white;
  border: none;
  padding: 2px 5px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#configuradorMaestro .btn-accion:hover {
  transform: scale(1.1);
}

#configuradorMaestro .btn-editar {
  background: #ff9800;
}

#configuradorMaestro .btn-editar:hover {
  background: #f57c00;
}

#configuradorMaestro .btn-eliminar {
  background: #f44336;
}

#configuradorMaestro .btn-eliminar:hover {
  background: #d32f2f;
}

/* IMÁGENES DE VERSIONES */
#configuradorMaestro .imagen-version {
  max-width: 80px;
  max-height: 50px;
  border-radius: 3px;
  margin-top: 4px;
  object-fit: cover;
  display: block;
  border: 1px solid #ddd;
}

/* NOTIFICACIONES */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  z-index: 9999;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.notification.success { background: #4caf50; }
.notification.error { background: #f44336; }
.notification.info { background: #2196f3; }
.notification.show { transform: translateX(0); }

/* ANIMACIONES */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#configuradorMaestro .item-config {
  animation: fadeIn 0.3s ease-out;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  #configuradorMaestro .contenedor-bloques {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  #configuradorMaestro {
    padding: 10px 0 !important;
  }
  
  #configuradorMaestro .contenedor-bloques {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 10px !important;
  }
  
  #configuradorMaestro .bloque-config {
    padding: 10px;
  }
  
  #configuradorMaestro .controles {
    flex-direction: column;
    gap: 6px;
  }
  
  #configuradorMaestro .btn-agregar,
  #configuradorMaestro .btn-exportar,
  #configuradorMaestro .btn-importar {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  #configuradorMaestro {
    padding: 5px 0 !important;
  }
  
  #configuradorMaestro .contenedor-bloques {
    grid-template-columns: 1fr !important;
  }
  
  #configuradorMaestro .bloque-config {
    padding: 8px;
  }
  
  #configuradorMaestro .lista-items {
    max-height: 80px !important;
  }
}